diff --git a/src/main.c b/src/main.c --- a/src/main.c +++ b/src/main.c @@ -38,7 +38,6 @@ int main(void) rtc_init(); gpio_init(); adc_init(); - i2c_init(); wspr_init(); uint32_t led_timer = HAL_GetTick(); @@ -61,7 +60,7 @@ int main(void) { // Every 10 minutes, wake up and try to wspr - if(HAL_GetTick() - last_wspr_tx_time > 60000 * 10) + if(state == SYSTEM_IDLE && (HAL_GetTick() - last_wspr_tx_time > 60000 * 10)) { state = SYSTEM_GPSACQ; } @@ -150,7 +149,7 @@ int main(void) // Wait for wspr timeslot and start transmitting case SYSTEM_WSPRTX: { - blink_rate = BLINK_SLOW; + blink_rate = BLINK_MED; // Wait for wspr countdown timer to expire and go to tx // if(timeout_expired) // { @@ -166,8 +165,8 @@ int main(void) __calc_gridloc(grid_locator, latitude_flt, longitude_flt); + last_wspr_tx_time = HAL_GetTick(); wspr_transmit(grid_locator); - last_wspr_tx_time = HAL_GetTick(); state = SYSTEM_IDLE; } else