The unified diff between revisions [4f22e7ef..] and [9ca449dd..] 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 [4f22e7ef7d3064e3b51a5b868a4722f3f13c747b] # new_revision [9ca449dd7941ad52e33bdcb5c28b2ba35d54219a] # # patch "timer.c" # from [7124cf1b41c7dfff9aa12b521db3b19870d7c718] # to [bcc39911ffda1137e85438b93c640cfb61c66a65] # ============================================================ --- timer.c 7124cf1b41c7dfff9aa12b521db3b19870d7c718 +++ timer.c bcc39911ffda1137e85438b93c640cfb61c66a65 @@ -105,7 +105,7 @@ void init_timer(void) T2REG(TCR) = TCR_ENABLE | TCR_RESET; T2REG(CTCR) = 0; /* Use PCLK */ - T2WREG(PR) = 0; // Prescaling + T2WREG(PR) = 3; // Prescaling T2WREG(PC) = 0; // Reset the prescale counter T2WREG(TC) = 0; // Reset the counter @@ -120,7 +120,7 @@ void init_timer(void) T1REG(TCR) = TCR_ENABLE | TCR_RESET; T1REG(CTCR) = 0; /* Use PCLK */ - T1WREG(PR) = 0; // Prescaling + T1WREG(PR) = 3; // Prescaling T1WREG(PC) = 0; // Reset the prescale counter T1WREG(TC) = 0; // Reset the counter @@ -151,7 +151,7 @@ void timer_set_period(unsigned int perio void timer_set_period(unsigned int period) { interrupt_register(TIMER3, timer_interrupt_handler); - T3WREG(MR0) = period; + T3WREG(MR0) = period-1; T3WREG(MCR) = MR0I | MR0R; T3WREG(TC) = 0; }