-
Notifications
You must be signed in to change notification settings - Fork 3k
feature_ble: rename error_t to nrf_error_t #5979
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
Conversation
error_t is a builtin type on gcc
User not whitelisted, CI not run. |
@andrewleech Can you please sign https://os.mbed.com/contributor_agreement/ ? |
@andrewleech Which NRF51 board did you use ? |
Hi @0xc0170, all signed (https://os.mbed.com/users/corona/) |
@pan- I'm actually using a custom board currently but it's based around a raytac mdbt40 module (nrf51 256K / 16K, no 32k crystal) |
Looking more closely at the error; it is caused by the inclusion of newlib's However with the same setup (win 10 x64; mbed os 5.7.3 and gcc 6 2017-q1-update) I cannot reproduce the issue :( |
@0xc0170 The nanostack may encounter the same kind of failure as it defines its own |
Thanks @pan- ! @kjbracey-arm Have you experienced this. Looking at the codebase, there are 3 functions This PR looks good to me (the changes are internal changes ). |
No, not seen this problem. The |
@pan- Sounds like compiler settings might have something to do with it.... in my project I'm using |
Hi, is there anything particularly stopping this being merged? Do you need to see a rock solid reproduction, or is it ok as is? |
Ok, I can confirm that the cxx standard change unearths this issue. On a minimal example, it all compiles fine with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look fine (no braking changes in the user facing API, only internal API changed) and works with the current toolchain profiles we support (c+11 is not there yet)
Just one minor comment below, to the one change that might not be related.
One question, is errno.h included in nrf files, and if yes, why it is pulling that header file (what is needed) ?
@@ -126,7 +126,7 @@ error_t btle_init(void) | |||
* Characteristics turned off, then clients are allowed to cache attribute | |||
* handles making applications simpler on both sides. | |||
*/ | |||
static const bool IS_SRVC_CHANGED_CHARACT_PRESENT = true; | |||
static const bool IS_SRVC_CHANGED_CHARACT_PRESENT = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is this change relevant to error_t
? separate commit or PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was not supposed to be changed, thanks for catching that.
My fault for working on multiple issues at once and trying to split them up in git.
@andrewleech, starting test whilst waiting for a reply to @0xc0170's comment. |
Revert accidental change to IS_SRVC_CHANGED_CHARACT_PRESENT
With regard to So no direct inclusion, but via other standard libe. |
It's not more clear. I can not find why memory header file there is needed |
@0xc0170 yes you're right, removing the I don't have access to the other compilers though to check one of them doesn't need the import, but I can't see anything in the file that should need it either. Regardless of how safe this PR should be, there's no denying simply removing one import is a much smaller change. |
Yes please, lets remove that header if not used. @ARMmbed/team-nordic please review |
@andrewleech That's a mistake, |
Description
I just updated to mbed-os-5.7.3 and could no longer build for NRF51 (windows, offline, gcc 6 2017-q1-update).
The definition of the new
error_t
type inTARGET_NRF5/source/common/ble_error.h
states that the enum has been mapped from nrf_error.h (softdevice code) so in this PR I've simply renamederror_t
tonrf_error_t
to avoid conflicting with the standard library typeStatus
READY
Migrations
There should be no changes to end user code.
NO
Related PRs
None
Deploy notes
Notes regarding the deployment of this PR. These should note any required changes in the build environment, tools, compilers and so on.
Steps to test or reproduce
Any code using the unified nordic target and ble should trigger this issue when compiled with gcc.
I've only tested with arm's distribution of gcc 6 2017-q1-update on windows 10 x64.