timer.c: simplify clock counting a bit.

Nothing fancy, but it saves 8 bytes, so likely 8 cycles.
This commit is contained in:
Markus Hitter 2011-11-16 20:50:10 +01:00
parent 9c489911b6
commit 69610a6dae
1 changed files with 4 additions and 4 deletions

View File

@ -54,14 +54,14 @@ ISR(TIMER1_COMPB_vect) {
clock_counter_10ms -= 10; clock_counter_10ms -= 10;
clock_flag_10ms = 1; clock_flag_10ms = 1;
clock_counter_250ms += 1; clock_counter_250ms++;
if (clock_counter_250ms >= 25) { if (clock_counter_250ms >= 25) {
clock_counter_250ms -= 25; clock_counter_250ms = 0;
clock_flag_250ms = 1; clock_flag_250ms = 1;
clock_counter_1s += 1; clock_counter_1s++;
if (clock_counter_1s >= 4) { if (clock_counter_1s >= 4) {
clock_counter_1s -= 4; clock_counter_1s = 0;
clock_flag_1s = 1; clock_flag_1s = 1;
} }
} }