Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value of CONFIG_BT_NIMBLE_NVS_PERSIST is ignored by compiler #518

Closed
Staars opened this issue Mar 25, 2023 · 2 comments · Fixed by #520
Closed

Value of CONFIG_BT_NIMBLE_NVS_PERSIST is ignored by compiler #518

Staars opened this issue Mar 25, 2023 · 2 comments · Fixed by #520
Labels
bug Something isn't working

Comments

@Staars
Copy link
Contributor

Staars commented Mar 25, 2023

In esp_nimble_cfg.h the existence of a #define for CONFIG_BT_NIMBLE_NVS_PERSIST is checked, but the value is ignored, so (at least for my compiler) this always sets MYNEWT_VAL_BLE_STORE_CONFIG_PERSIST to 1.
I am not totally sure, if this is undefined behavior and may work for some compilers or if it is completely wrong.

For me this change works:

#ifndef MYNEWT_VAL_BLE_STORE_CONFIG_PERSIST
#if     CONFIG_BT_NIMBLE_NVS_PERSIST==1
#define MYNEWT_VAL_BLE_STORE_CONFIG_PERSIST (1)
#else
#define MYNEWT_VAL_BLE_STORE_CONFIG_PERSIST (0)
#endif
#endif
@h2zero h2zero added the bug Something isn't working label Mar 25, 2023
@h2zero
Copy link
Owner

h2zero commented Mar 25, 2023

Thanks, I'll have a look into this.

@h2zero
Copy link
Owner

h2zero commented Mar 26, 2023

You're correct, I will update this shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants