diff --git a/src/main.c b/src/main.c --- a/src/main.c +++ b/src/main.c @@ -22,7 +22,7 @@ enum _state SYSTEM_IDLE, // awaiting RTC interrupt for wakeup TODO wake up before scheduled time to get fix? SYSTEM_GPSACQ, // RTC interrupted SYSTEM_WSPRTX, // Wait for timeslot and actually transmit the message -} +}; int main(void) @@ -54,7 +54,7 @@ int main(void) { blink_rate = BLINK_SLOW; // Wait for RTC wakeup interrupt - wfi(); + //wfi(); //enter_sleep(); // Somehow go to another state when we get an interrupt @@ -68,9 +68,14 @@ int main(void) blink_rate = BLINK_FAST; // TODO: probably don't power on all the time, just on state transition - gps_poweron(); - HAL_Delay(500); - gps_update_position(); +// gps_poweron(); +// HAL_Delay(100); + HAL_Delay(1000); +// gps_update_position(); + + uint8_t fix_ok = 0; + uint8_t numsats = 0; + gps_check_lock(&fix_ok, &numsats); if(fix_ok) { @@ -84,10 +89,10 @@ int main(void) // TODO: Set wspr countdown timer for this transmission! state = SYSTEM_WSPRTX; } - else if(fix_timeout) - { - // Flash error code and go to idle probably? or just try forever? - } +// else if(fix_timeout) + // { + // // Flash error code and go to idle probably? or just try forever? + // } } break; @@ -96,10 +101,10 @@ int main(void) case SYSTEM_WSPRTX: { // Wait for wspr countdown timer to expire and go to tx - if(timeout_expired) - { - wspr_transmit(); - } +// if(timeout_expired) +// { +// wspr_transmit(); +// } // Schedule next wakeup (maybe 2mins prior ot timeslot if no osc trim) // Next wakeup should enter SYSTEM_GPSACQ state...