timer.c: simplify clock counting a bit.
Nothing fancy, but it saves 8 bytes, so likely 8 cycles.
This commit is contained in:
parent
9c489911b6
commit
69610a6dae
8
timer.c
8
timer.c
|
|
@ -54,14 +54,14 @@ ISR(TIMER1_COMPB_vect) {
|
|||
clock_counter_10ms -= 10;
|
||||
clock_flag_10ms = 1;
|
||||
|
||||
clock_counter_250ms += 1;
|
||||
clock_counter_250ms++;
|
||||
if (clock_counter_250ms >= 25) {
|
||||
clock_counter_250ms -= 25;
|
||||
clock_counter_250ms = 0;
|
||||
clock_flag_250ms = 1;
|
||||
|
||||
clock_counter_1s += 1;
|
||||
clock_counter_1s++;
|
||||
if (clock_counter_1s >= 4) {
|
||||
clock_counter_1s -= 4;
|
||||
clock_counter_1s = 0;
|
||||
clock_flag_1s = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue