From fcd110f5fcf58c7402d44eae516ee33e5df71deb Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sat, 17 Jun 2023 21:40:28 +0100 Subject: Use volatile The parameter is used on the interrupt. --- src/timer.c | 2 +- src/timer.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/timer.c b/src/timer.c index ae76037..f3c5898 100644 --- a/src/timer.c +++ b/src/timer.c @@ -45,7 +45,7 @@ void timer_free() fprintf(stderr, "Failed to free the timer :(\n"); } -void timer_start(uint8_t secs, uint8_t *updated) +void timer_start(uint8_t secs, volatile uint8_t *updated) { *updated = 0; clock_updated = updated; diff --git a/src/timer.h b/src/timer.h index 3f66be5..8207e5b 100644 --- a/src/timer.h +++ b/src/timer.h @@ -8,7 +8,7 @@ void timer_init(); void timer_free(); /* countdown clock */ -void timer_start(uint8_t secs, uint8_t *updated); +void timer_start(uint8_t secs, volatile uint8_t *updated); uint8_t timer_value(); void timer_stop(); void timer_resume(); -- cgit v1.2.3