diff --git a/src/main.c b/src/main.c --- a/src/main.c +++ b/src/main.c @@ -14,7 +14,7 @@ // We have access to the 1PPS pin of the gps... could have trim routine for internal oscillator based on this when we have a fix -// Probabl wake up 1 minute early -- 0.45min possible +/- on wakeup time with 15min sync intervals +// Probable wake up 1 minute early -- 0.45min possible +/- on wakeup time with 15min sync intervals // TODO: Add JT9 message with more grid locator digits + altitude + vbatt + temp @@ -40,7 +40,7 @@ uint32_t statled_ontime = 0; int main(void) { HAL_Init(); - HAL_Delay(2000); // startup delay before infinisleep + HAL_Delay(1000); // startup delay before infinisleep sysclk_init(); rtc_init(); @@ -64,12 +64,13 @@ int main(void) uint8_t fix_ok = 0; uint8_t numsats = 0; + uint8_t packet_type = 0; while (1) { // Every 10 minutes, wake up and try to wspr - if(state == SYSTEM_IDLE && (HAL_GetTick() - last_wspr_tx_time > 60000))// * 10)) + if(state == SYSTEM_IDLE && (HAL_GetTick() - last_wspr_tx_time > 60000 /* * 10 */)) { state = SYSTEM_GPSACQ; } @@ -84,7 +85,7 @@ int main(void) // If odd minute if(gps_getdata()->minute % 2) { - // Wait until even minute, coming soon + // Wait until even minute plus one second, coming soon nextwspr_time = HAL_GetTick() + (60000 - (gps_getdata()->second * 1000)); nextwspr_time_valid = 1; @@ -190,7 +191,9 @@ int main(void) __calc_gridloc(grid_locator, latitude_flt, longitude_flt); - wspr_transmit(grid_locator); + // TODO: Switch between alternate and standard packet + wspr_transmit(grid_locator, packet_type); + //packet_type = !packet_type; // alternate packet type last_wspr_tx_time = HAL_GetTick(); state = SYSTEM_IDLE; }