-
Notifications
You must be signed in to change notification settings - Fork 8.3k
drivers: counter: fix nRF prescaler overflow #22019
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
drivers: counter: fix nRF prescaler overflow #22019
Conversation
|
All checks are passing now. Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
|
@ChristianHirsch thanks for the PR! Can you follow the instructions here to fix Gitlint? |
pabigot
left a comment
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've seen something like this somewhere else very recently. I don't believe there's any benefit to specifying a formal parameter that is smaller than u32_t; in fact there will be a cost, because code must be generated to truncate values to the specified representation. Here nrf_rtc_prescaler_set() takes a u32_t when receiving this value, so it's really unjustified.
I recommend that somebody from Nordic go through all these APIs make sure that an appropriate and standardized size is used when passing values.
|
@pabigot thanks for the hints. should I change the line to |
|
looks ok, fix commit message and i'll approve.
Please do. |
use u32_t in init_rtc to be able to use the full 12 bit prescaler values fixes zephyrproject-rtos#22014 Signed-off-by: Christian Hirsch <christian.hirsch@tuwien.ac.at>
4cbe125 to
299578f
Compare
|
Thanks for your contribution @ChristianHirsch |
use
u16_t prescalerinstead ofu8_t prescalerininit_rtcto be able to use the full 12 bit prescaler values.fixes #22014.