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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions porting/npl/freertos/src/npl_os_freertos.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
#include <string.h>
#include "nimble/nimble_npl.h"

#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.

static inline bool
in_isr(void)
{
Expand Down