From 76b4a0e75618c70141f6f1e61b69774c807bfbfe Mon Sep 17 00:00:00 2001 From: Eggert Jung Date: Sun, 1 Dec 2019 12:42:50 +0100 Subject: [PATCH] enable blinking dots also change gps status led: blinking indicates gps status received blinking short on/long off -> last status has no time signal blinking long on/short off -> last status has time signal --- code/src/main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/src/main.c b/code/src/main.c index 89dffce..302cd2c 100644 --- a/code/src/main.c +++ b/code/src/main.c @@ -72,17 +72,19 @@ int main(void){ setup(); while(1){ - _delay_ms(200); - check_dip_switches(); uint8_t clock[3]; + cli(); DS3231_read(clock); + sei(); for(uint8_t i=0; i < 3; i++){ SR_Buffer[5-(2*i)] = number_Font[clock[i] & 0x0F]; SR_Buffer[5-(2*i)-1] = number_Font[(clock[i] & 0xF0)>>4]; } + PORTC = (PORTC & (~DOT)) | (clock[0]%2) << 4; // blink dots print_SR_Buffer(); + _delay_ms(100); } } @@ -99,7 +101,6 @@ void check_dip_switches() { } void setup(){ - DDRA = ENABLE_TUBE_SUPPLY; DDRB = STATUS_LED_B @@ -190,6 +191,7 @@ ISR(INT1_vect) { ISR(USART0_RX_vect) { + PORTB ^= STATUS_LED_C; static char async_input_buffer[RX_INPUT_BUFFER_SIZE]; static uint8_t async_buffer_pointer = 0;