aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-06-17 21:40:28 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-06-17 21:40:28 +0100
commitfcd110f5fcf58c7402d44eae516ee33e5df71deb (patch)
tree8ce8317e9bcf7a76e3e48d89b5206c2a95d544f8 /src
parent74516ba760b8b4fb2a33e115247ea38c29b4b584 (diff)
downloadgold-mine-run-fcd110f5fcf58c7402d44eae516ee33e5df71deb.tar.gz
gold-mine-run-fcd110f5fcf58c7402d44eae516ee33e5df71deb.zip
Use volatile
The parameter is used on the interrupt.
Diffstat (limited to 'src')
-rw-r--r--src/timer.c2
-rw-r--r--src/timer.h2
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();