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

porting/npl/freertos: Add way of including HW specific header #1591

Merged
merged 2 commits into from
Oct 2, 2023

Conversation

pfyra
Copy link

@pfyra pfyra commented Aug 11, 2023

As mentioned in the in_isr function, there is HW specific code in this file but there is no way to include a header file that defines the SCB etc. This PR adds a way to include a header file so it is possible to make this file compile without local changes.

#ifdef NIMBLE_NPL_OS_EXTRA_INCLUDE
#include NIMBLE_NPL_OS_EXTRA_INCLUDE
#endif

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since in_isr() is HW specific anyway, why not just include required file here explicitly?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose all ARM MCUs have the SCB so it should be enough to include a header file for the HW specific stuff. At least in my case (stm32) it is. I suppose everyone who use this code needs to add an include statement to this file (or modify it further).
It is a bit cumbersome to maintain changes to the nimble repo at our end since we want to use the nimble repo as a submodule and it is very close to work without changes. Having a possibility to specify a file to include here makes it possible for us to use nimble without any changes.

Perhaps there is a CMSIS file that can be included that specifies the SCB? That might introduce some unwanted dependencies though...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough, but could you put some comment above this include? explaining why it is needed etc

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certainly. I have added a comment now and I tried to keep it short but descriptive. To me, it is borderline obvious that you use this to avoid changes in the code and if other changes are required anyway then I guess people simply won't bother with this. Let me know what you think and I'll update.

@sjanc sjanc merged commit 080e6d3 into apache:master Oct 2, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants