From d2fdbf06caa21ec4f0c95e270408cdf83ea6e9da Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sun, 18 Jun 2017 03:03:48 +0200 Subject: Added seconds with 1 bit missing --- software/main.c | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/software/main.c b/software/main.c index 9e2cb5d..b791647 100644 --- a/software/main.c +++ b/software/main.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "inc/int/dcf77.h" @@ -75,7 +76,14 @@ int main(void) // MCU Control Register (controls CPU-behaviours like interrupts & sleepmode) // MCUCR |= ~(1< 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) 0 - | ((uint16_t) (PINB & 0x0001))<<15 - | t_current.h<<8 - | t_current.m + // | ((uint16_t) (PINB & 0x0001))<<15 + | t_current.h<<10 + | t_current.m<<5 + | t_current.s>>1 ); + sleep_cpu(); + + // print_data(interval | ((PINB & PB0) == 1 ? 2 : 0)); //print_data(PINB); } -- cgit v1.2.3