diff --git a/src/main.c b/src/main.c index 2477e21..235e28e 100644 --- a/src/main.c +++ b/src/main.c @@ -8,7 +8,7 @@ #define START_GAP_MIN 1500 #define ONE_WIDTH_MIN 170 -#define ONE_WIDTH_MAX 240 +#define ONE_WIDTH_MAX 250 #define ZERO_WIDTH_MIN 70 #define ZERO_WIDTH_MAX 140 @@ -40,14 +40,15 @@ typedef struct clock_s { uint8_t year; } clock_t; + +receivedData_t rd; + volatile clock_t clock; volatile uint8_t tick; volatile uint16_t captValue = 0; volatile uint16_t gapValue = 0; ISR(TIMER2_OVF_vect) { - //tick = 1; - clock.second++; if (clock.second >= 60) { clock.second = 0; @@ -106,7 +107,6 @@ int main() { uint8_t bit = 0; uint8_t state = 0; - receivedData_t rd; while (1) { if (tick != 0) { @@ -421,7 +421,10 @@ int main() { state++; } else { - printf("INVALID %u %u %u \n", bit, pulse, gap); + printf("INVALID %02d:%02d:%02d %02u.%02u.%02u %u %u %u %u \n", + clock.hour, clock.minute, clock.second, + clock.day, clock.month, clock.year, clock.weekday, + bit, pulse, gap); } } }