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

net: ieee802154: Fix nrf5_get_acc to return value selected for board. #64131

Conversation

canisLupus1313
Copy link
Contributor

nrf5_get_acc was returning value hardcoded from the Kconfig related to openthread rather than actual value selected for the board.

`nrf5_get_acc` was returning value hardcoded from the Kconfig related to
openthread rather than actual value selected for the board.

Signed-off-by: Przemyslaw Bida <[email protected]>
@@ -640,7 +640,7 @@ static uint8_t nrf5_get_acc(const struct device *dev)
{
ARG_UNUSED(dev);

return CONFIG_IEEE802154_NRF5_DELAY_TRX_ACC;
Copy link
Contributor

@fgrandel fgrandel Oct 19, 2023

Choose a reason for hiding this comment

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

This orphanes IEEE802154_NRF5_DELAY_TRX_ACC in Kconfig.nrf5, correct? I cannot see any other instance where it's used. Should be deprecated or removed then.

Additionally the previous implementation limited the range to 255 - is that no longer required?

return MIN(UINT8_MAX, CONFIG_CLOCK_CONTROL_NRF_ACCURACY);

The return value is uint8_t - so if this is not clamped, then it will return bad values.

@canisLupus1313
Copy link
Contributor Author

Will be fixed elsewhere.

@fgrandel
Copy link
Contributor

fgrandel commented Oct 19, 2023

@canisLupus1313 Could you at least elaborate please? We get two approvals and when I take the time to review then it's suddenly solved elsewhere? Otherwise it's just a waste of time to review that stuff from my side.

@canisLupus1313
Copy link
Contributor Author

@fgrandel this PR war closed after discussion with @edmont . Changing default value of CONFIG_CLOCK_CONTROL_NRF_ACCURACY board which is risky when it comes to BLE for example. So we would like to mitigate this risk from zephyr.

Secondly the issue isn't actually introduced in zephyr but rather in NCS by overriding the default in here: https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/net/openthread/Kconfig.defconfig#L188

And @fgrandel thanks for review.

@canisLupus1313 canisLupus1313 deleted the fix_nrf5_get_acc branch October 19, 2023 13:44
@fgrandel
Copy link
Contributor

@canisLupus1313 Thanks for the explanation. Makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants