From 69610a6dae8e0576797e3f9227c9b5b91522edad Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Wed, 16 Nov 2011 20:50:10 +0100 Subject: [PATCH] timer.c: simplify clock counting a bit. Nothing fancy, but it saves 8 bytes, so likely 8 cycles. --- timer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/timer.c b/timer.c index 9aa3a3a..5b1245b 100644 --- a/timer.c +++ b/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; } }