Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
CONFIG_GPIO_P0_DEV_NAME
is really unavailable? It should be included from fixups brought bysoc.h
. I think all boards include this file in theirboard.h
file. Maybe this is missing?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.
Yes, when compiling for nRF91,
CONFIG_GPIO_P0_DEV_NAME
is currently not defined. I need to refer to @barsok for an explanation of why this is. I agree that usingCONFIG_GPIO_P0_DEV_NAME
without the need of any extra header file would be the preferred solution, but as of now I don't think it's possible.CONFIG_GPIO_0_LABEL
is defined, but my understanding is thatCONFIG_GPIO_P0_DEV_NAME
is the preferred way to get the device name.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.
it seems that somebody forgot to include a header but in such case it would be better to fix the actual problem. Otherwise people will have to make sure they add this additional include.
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 point was to reduce dts_fixup.h to a minimum. In each compilation autoconfig.h is available (injected in gcc command line). A lot of other includes also include generated_dts_board.h and there are all necessary labels etc. The legacy kconfig names have been moved to nrfx.h. Some discussion may be needed if there is a need to duplicate DTS definitions, ie CONFIG_GPIO_P0_DEV_NAME with CONFIG_GPIO_0_LABEL. If you think so we can discuss what is really needed short-term and long-term
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.
From what I have seen in zephyr code base then CONFIG_GPIO_P0_DEV_NAME is very often used.
Uh oh!
There was an error while loading. Please reload this page.
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 don't have strong opinions on this, other than that we need a fix for this as soon as possible so samples using this library can compile.
I'll leave it up to you as the author of the lib to decide which solution to use @jhn-nordic , I will update the PR accordingly.
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.
@jtguggedal I think you should include nrfx.h and then we can remove it when CONFIG_GPIO_P0_DEV_NAME gets available again.
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.
Ok, then this PR is merge-ready I think
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.
@barsok I have created a ticket in Zephyr to improve the way labels are defined. Maybe there will be some further discussion regarding this.
zephyrproject-rtos/zephyr#10938