stm32duino/STM32duinoBLE

Configurable BLE application

KMeldgaard opened this issue · 3 comments

Dear STM32Duino team

I want to change the BLE app configurations found in app_conf.h (generated with STM32CubeMX I presume).
The only way possible I can see at the moment, is forking this repo, risking to fall behind updated versions.
Is it in the pipeline to make the BLE interface configurable?

Regards
K_Meld

Hi @KMeldgaard

you're right.
One way should be to rename app_conf.h to app_conf_default.h
Don't forget to protect all define which should/could be redefined with #ifndef/#endif. ex:

#ifndef CFG_BLE_HSE_STARTUP_TIME
#define CFG_BLE_HSE_STARTUP_TIME  0x148
#endif

Then create a app_conf.h with:

#ifndef APP_CONF_H
#define APP_CONF_H

#if __has_include("app_conf_custom.h")
#include "app_conf_custom.h"
#endif
#include "app_conf_default.h"

#endif /* APP_CONF_H */

Hi @fpistm

Thanks for the quick response.
I've tested out your solution in my fork, and so far its works like a charm.
Do you accept a Pull-request to the official repo?

Regards

Of cousre :)
All contributions are welcome.