From f714cacefc9a04fbae7249cc4b707a27cedabc36 Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Tue, 10 Apr 2012 23:56:27 +0200 Subject: Decode and display flags --- main.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index cd9666a..c5e4bd2 100644 --- a/main.c +++ b/main.c @@ -37,7 +37,8 @@ enum stepstate { } stepstate = STEP_INACTIVE; const char PROGMEM disp[2] = {'_', '+'}; -const char PROGMEM status[24] = "normalsync adj + adj - "; +const char PROGMEM status[8] = "oksya+a-"; +const char PROGMEM zone[4] = "?12?"; const char PROGMEM cksumfail[] = "cksum fail"; static void puttwo(uint8_t arg) @@ -63,15 +64,18 @@ static void puttime(void) puttwo(time.second); lcd_line2(); + lcd_put(time.flags & FLAG_SUMMERTIME_PENDING ? '!' : ' '); + lcd_put(zone[is_cet() + (is_cest() << 1)]); + lcd_put(time.flags & FLAG_LEAP_SECOND ? '!' : ' '); + msg = &status[0]; if (time.year <= 10) - msg = &status[6]; + msg = &status[2]; if (~PINB & (1 << B_SW_FRWD)) - msg = &status[12]; + msg = &status[4]; if (~PINB & (1 << B_SW_BACK)) - msg = &status[18]; - - lcd_puts(msg, 6); + msg = &status[6]; + lcd_puts(msg, 2); lcd_put(__LPM(&disp[stepstate])); puttwo(ext_hour); puttwo(ext_minute); @@ -182,7 +186,7 @@ static void perform(void) extern void __vectors(void) __attribute__((noreturn)); __attribute__ ((noreturn)) -SIGNAL (SIG_ANA_COMP) +SIGNAL (ANA_COMP_vect) { PORTA = 0xff; -- cgit v1.2.1