The unified diff between revisions [a39fe798..] and [8f4e93ab..] 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 [a39fe7980c8f14b70401f4c97f3e10232dce016a] # new_revision [8f4e93ab4d89edfdbd524b06b83511c6867a9150] # # patch "timer.c" # from [9ef2a6c50a8a227103c6c98477c1ce62327a0977] # to [345db97155c057df90bcbbdc2386ab54a8a12be7] # ============================================================ --- timer.c 9ef2a6c50a8a227103c6c98477c1ce62327a0977 +++ timer.c 345db97155c057df90bcbbdc2386ab54a8a12be7 @@ -58,7 +58,6 @@ void init_timer(void) TWREG(PC) = 0; TREG(TCR) = TCR_ENABLE; - event_register(EVENT_TIMER, timer_event_handler); } unsigned int timer_read(void) @@ -74,9 +73,10 @@ void timer_set_period(unsigned int perio void timer_set_period(unsigned int period) { + interrupt_register(TIMER0, timer_interrupt_handler); TWREG(MR0) = period; TWREG(MCR) = MR0I | MR0R; - interrupt_register(TIMER0, timer_interrupt_handler); + TWREG(TC) = 0; } void __attribute__((interrupt("IRQ"))) timer_interrupt_handler(void) @@ -87,15 +87,8 @@ void __attribute__((interrupt("IRQ"))) t if (ir & (1<<0)) { /* Match channel 0 */ - putstr(" *timer0* "); + event_set(EVENT_TIMER); } - event_set(EVENT_TIMER); - interrupt_clear(); } - -void timer_event_handler(void) -{ - putstr(" *t0event* "); -}