-
Couldn't load subscription status.
- Fork 22
treewide: restructure includes #191
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
2b7b7fb to
7f56946
Compare
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.
I am thinking of moving all the SoftDevice files into its own subfolder for easier automated deploys, but that doesnt block this move
include/nrf_error.h
Outdated
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.
Is this correct? The file is called nrf_error.h. Also, would be nice to not encode the SoftDevice variant number in the path. Then this will have to be updated to work with other variants.
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.
No, this should be nrf_error.h.
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.
Would be nice to not have to specify the full path indeed. I'm looking at a way to include the softdevice headers with a softdevice prefix , so it can be referenced by #include <softdevice/nrf_error.h>, though I haven't gotten it to work yet with zephyr_include_directories.
include/nrf_error.h
Outdated
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.
Why change to having the comment on a different line? The previous one was much more readable.
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.
Code style and maximum line length.
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.
Why change to having the comment on a different line? The previous one was much more readable.
This file is supposed to be a generic error codes header for the whole Bare Metal (when SD not in use), so it needs to comply with the same coding style.
b964767 to
d50c90c
Compare
|
A suggestion to avoid clashing with users of ncs bare metal would be to namespace ncs bare metal, as a whole, that is, move every include into and since this matches the namespacing of most bm and nrf stuff from what I see, so and be included like and nrf_sde.h would go in etc. Also I believe reserving the namespace |
|
Yes please as @bjarki-andreasen says, the idea is that users should be able to have this repo or even extend it themselves with their own modules and ncs and bm should work without clashes so namespacing is important to avoid that |
I agree that might be good to do. As of SoftDevice headers starting with |
ec3e10f to
18b9520
Compare
eaaae3a to
30aed4a
Compare
Here's how you do it: Create a seperate include folder, somewhere, it does not need to be in the root of the project for example, I will suggest adding the following tree
and place your s155 specific headers like https://github.com/nrfconnect/sdk-nrf-bm/blob/main/include/s115/ble.h in You can now include and it will automatically include the correct header based on the CMakeLists.txt entry :) |
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.
Blocking until issues addressed :)
1824182 to
3eb1599
Compare
west.yml
Outdated
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.
Adding some comments for https://github.com/nrfconnect/sdk-zephyr/pull/3008/files here to keep it internal for now:
SD_PPI_*is not defined for hardware with DPPI so that code doesnt work on 54L- The fact that you have to change to
#include <softdevice/*is an example of everyone expecting to be able to just include the SoftDevice headers without any prefix. Existing customers will then have to update their code for no gain.
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.
This entry in zephyr was added a couple of months ago for nRF52 devices, so updating that is not an issue.
Though, in the broader context of existing customers then yes, this will be an extra change for them to do. On the other hand, if we want to do this to clarify what is part of the SoftDevice, now is the time for it. What do you think @bjarki-andreasen?
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.
We have spent effort to not make api changes unless necessary so that it is easy to port applications to the new SoftDevice. The reason for this whole project is to make it easy for existing bare-metal 52 customers to move to 54L.
But then again, existing customers are unlikely to use this repo since it doesnt fit into the nrf5 sdk and cannot be used with other RTOSes.
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.
With the suggestion I made the include path to nrf_sd_def.h would be #include <nrf/softdevice/nrf_sd_def.h> in BM, we could also forego nrf for the softdevice (though I would prefer nrf/) and the path would be the same as sdk-zephyr in this case.
How important is it that these paths are identical between the two (bm and sdk-zephyr)?
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.
With the suggestion I made the include path to
nrf_sd_def.hwould be#include <nrf/softdevice/nrf_sd_def.h>
Which is what would break existing users and I am thinking we should reconsider.
How important is it that these paths are identical between the two (bm and sdk-zephyr)?
It would be unexpected if the different repos had the same header with different include paths. But this is maybe the only place where a SoftDevice header is included in sdk-zephyr.
However, none of this is that important, and assuming no existing user will use this repo the renamings are ok.
Restructure includes. Update Bluetooth -> ble Signed-off-by: Eivind Jølsgard <[email protected]>
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.
Doc updates looking ok
Restructure includes.
Dependent on:
nrfconnect/sdk-zephyr#3008