diff --git a/src/main.c b/src/main.c --- a/src/main.c +++ b/src/main.c @@ -138,22 +138,32 @@ int main(void) HAL_Delay(100); uint8_t lastMinute = 0; + uint16_t blink_rate = 250; while (1) { if(HAL_GetTick() - last_wspr > 500) { + if(get_hdop()[0] == '9' && get_hdop()[1] == '9') + blink_rate = 250; + else + blink_rate = 100; + volatile uint8_t minute = get_timestamp()[3] - 0x30; // If last minute was odd and this minute is even (transition) if(lastMinute%2 == 1 && minute%2 == 0) + { + // Wait until the first second of the minute + HAL_Delay(1000); encode_wspr(); + } lastMinute = minute; last_wspr = HAL_GetTick(); } - if(HAL_GetTick() - led_timer > 100) + if(HAL_GetTick() - led_timer > blink_rate) { HAL_GPIO_TogglePin(LED_BLUE); led_timer = HAL_GetTick();