diff --git a/src/gps.c b/src/gps.c --- a/src/gps.c +++ b/src/gps.c @@ -300,7 +300,7 @@ void parse_gps_transmission(void) { if (byte == ',') //end of this data type { - timestamp[4] = 0x00; // Cut off at 4 (no seconds) for APRS + //timestamp[4] = 0x00; // Cut off at 4 (no seconds) for APRS setParserState(GGA_LATITUDE); skipBytes = 0; //prep for next phase of parse numBytes = 0; diff --git a/src/main.c b/src/main.c --- a/src/main.c +++ b/src/main.c @@ -137,12 +137,19 @@ int main(void) HAL_GPIO_TogglePin(LED_BLUE); HAL_Delay(100); + uint8_t lastMinute = 0; while (1) { - if(HAL_GetTick() - last_wspr > 120000) + if(HAL_GetTick() - last_wspr > 500) { - encode_wspr(); + 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) + encode_wspr(); + + lastMinute = minute; last_wspr = HAL_GetTick(); }