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

Add timer_set function. #23887

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add lock to chibios timer_set
  • Loading branch information
daskygit committed Jun 21, 2024
commit 124b1e380d3a7de4e5e89657b366b234268e210e
2 changes: 2 additions & 0 deletions platforms/chibios/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ void timer_clear(void) {
}

void timer_set(uint32_t time_ms) {
chSysLock();
ticks_offset = get_system_time_ticks();
last_ticks = 0;
ms_offset = time_ms;
chSysUnlock();
}

uint16_t timer_read(void) {
Expand Down
Loading