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

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 4 times, most recently from 3bc1989 to 32418ab Compare July 16, 2025 07:42
… initialization"

This reverts commit de4fad1.

Signed-off-by: Adam Kondraciuk <[email protected]>
…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 <[email protected]>
(cherry picked from commit e77f942)
@adamkondraciuk adamkondraciuk force-pushed the NRFX-NONE-fix-last-count-init-for-grtc branch from 32418ab to dcbe0bf Compare July 17, 2025 08:07
@adamkondraciuk
Copy link
Contributor Author

Change already pulled in: 8686e2f

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.

4 participants