aboutsummaryrefslogtreecommitdiffstats
path: root/demos/ARM7-LPC214x-GCC/buzzer.c
diff options
context:
space:
mode:
Diffstat (limited to 'demos/ARM7-LPC214x-GCC/buzzer.c')
-rw-r--r--demos/ARM7-LPC214x-GCC/buzzer.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/demos/ARM7-LPC214x-GCC/buzzer.c b/demos/ARM7-LPC214x-GCC/buzzer.c
index 25be0e2d9..1d3350bb2 100644
--- a/demos/ARM7-LPC214x-GCC/buzzer.c
+++ b/demos/ARM7-LPC214x-GCC/buzzer.c
@@ -58,9 +58,8 @@ void InitBuzzer(void) {
}
static void stop(void *p) {
- TC *tc = T1Base;
- StopCounter(tc);
+ StopCounter((TC *)p);
chEvtBroadcastI(&BuzzerSilentEventSource);
}
@@ -77,7 +76,7 @@ void PlaySound(int freq, systime_t duration) {
tc->TC_MR0 = tc->TC_MR1 = (PCLK / (freq * 2));
StartCounter(tc);
- chVTSetI(&bvt, duration, stop, NULL);
+ chVTSetI(&bvt, duration, stop, tc);
chSysUnlock();
}