The unified diff between revisions [cc8258a6..] and [253c6510..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'timer.c'
# # old_revision [cc8258a6c3643514892e84cf24fed008bc6f9660] # new_revision [253c65100e2208e0b8c93178896f5aab89e4ec0b] # # patch "timer.c" # from [bbb624ceb301647f8ffb240074c02ed3c3200135] # to [9ef2a6c50a8a227103c6c98477c1ce62327a0977] # ============================================================ --- timer.c bbb624ceb301647f8ffb240074c02ed3c3200135 +++ timer.c 9ef2a6c50a8a227103c6c98477c1ce62327a0977 @@ -1,6 +1,7 @@ #include "timer.h" #include "interrupt.h" #include "uart.h" +#include "event.h" #define TIMER0BASE 0xE0004000 #define TIMER1BASE 0xE0008000 @@ -45,6 +46,8 @@ void __attribute__((interrupt("IRQ"))) t void __attribute__((interrupt("IRQ"))) timer_interrupt_handler(void); +void timer_event_handler(void); + void init_timer(void) { TREG(TCR) = TCR_ENABLE | TCR_RESET; @@ -55,6 +58,7 @@ void init_timer(void) TWREG(PC) = 0; TREG(TCR) = TCR_ENABLE; + event_register(EVENT_TIMER, timer_event_handler); } unsigned int timer_read(void) @@ -86,6 +90,12 @@ void __attribute__((interrupt("IRQ"))) t putstr(" *timer0* "); } + event_set(EVENT_TIMER); + interrupt_clear(); } +void timer_event_handler(void) +{ + putstr(" *t0event* "); +}