From 73eb23b36f020d15cbeff06fd16f90cb818bf4da Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sun, 18 Jun 2017 18:11:54 +0200 Subject: DCF indicator in the middle between h and m --- software/main.c | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) (limited to 'software/main.c') diff --git a/software/main.c b/software/main.c index b791647..2b7322e 100644 --- a/software/main.c +++ b/software/main.c @@ -19,7 +19,7 @@ static inline void BIT_CLEAR(volatile uint8_t* target, uint8_t bit) { *target &= /* - * + * * PB2 : connected to ShiftClock on Port 11 * PB3 : connected to MemoryClock on Port 12 (shows content of memory) * PB4 (PIN3) : connected to SERIAL_IN on pin 14 @@ -108,37 +108,33 @@ int main(void) } - char lastsec = 0; + t_current.m = 0xffff; + t_current.h = 0xffff; + while (1) { //print_data(lastinterval<<1 | (PINB & PB0)); - if(lastsec != t_current.s) + + /* + if(t_current.s & 0x1) // uneven number? { - //for (uint8_t i = 16; i > 0; i--) - // { - print_data( - ~( - (uint16_t) 0 - // | ((uint16_t) (PINB & 0x0001))<<15 - | t_current.h<<10 - | t_current.m<<5 - | t_current.s>>1) - ); - _delay_us(50); - // } - lastsec = t_current.s; + print_data((uint16_t) 31<<6); + _delay_us(50); } + */ + print_data( (uint16_t) 0 - // | ((uint16_t) (PINB & 0x0001))<<15 - | t_current.h<<10 - | t_current.m<<5 - | t_current.s>>1 + | ((uint16_t) (PINB & 0x0001) ? 0x3<<7 : 0<<7) + | ((t_current.h & 0x1F)<<10) + | ((t_current.m & 0x3F)<<0) ); + sleep_cpu(); + // print_data(interval | ((PINB & PB0) == 1 ? 2 : 0)); //print_data(PINB); } -- cgit v1.2.3