Skip to content

[nrf fromtree] drivers: timer: nrf_grtc_timer: fix last_count initialization #3009

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

adamkondraciuk
Copy link
Contributor

Minor fix for last_count variable initialization in GRTC driver.

@adamkondraciuk adamkondraciuk changed the title Fix last_count initialization for GRTC [nrf fromtree] Fix last_count initialization for GRTC Jul 1, 2025
@adamkondraciuk adamkondraciuk changed the title [nrf fromtree] Fix last_count initialization for GRTC [nrf fromtree] drivers: timer: nrf_grtc_timer: fix last_count initialization Jul 1, 2025
Copy link

sonarqubecloud bot commented Jul 1, 2025

@adamkondraciuk adamkondraciuk force-pushed the NRFX-NONE-fix-last-count-init-for-grtc branch 2 times, most recently from cafd03f to 10086a2 Compare July 11, 2025 12:14
… initialization"

This reverts commit de4fad1.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
…ization

The GRTC counter is not cleared at startup, therefore the
`last_count` variable needs to be initialized accordingly.
This change:
- Prevents overflow of the `sys_clock_announce()` int32_t parameter
- Ensures the correct uptime value, which should be reset during
  initialization

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
(cherry picked from commit e77f942cff5516140f7db48bb42eda49522c1c7a)
@adamkondraciuk adamkondraciuk force-pushed the NRFX-NONE-fix-last-count-init-for-grtc branch from 10086a2 to 3bc1989 Compare July 14, 2025 07:19
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.

3 participants