Changeset - 8bad90087cda
[Not reviewed]
default
0 1 0
Ethan Zonca - 7 years ago 2019-09-04 21:11:14
ez@ethanzonca.com
Wspr transmissions now timed off of RTC directly
1 file changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/main.c
Show inline comments
 
@@ -64,7 +64,7 @@ int main(void)
 
    uint32_t fix_acq_starttime = 0;
 
    uint32_t nextwspr_time = 0;
 
    uint8_t nextwspr_time_valid = 0;
 
    uint32_t last_wspr_tx_time = 0;
 
    uint64_t last_wspr_tx_time = 0;
 
    uint64_t idle_blink_last = 0;
 
 
    uint8_t packet_type = 0;
 
@@ -82,7 +82,7 @@ int main(void)
 
    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 && (rtc_timestamp() - last_wspr_tx_time > 60000 * 10))
 
    	{
 
    		state = SYSTEM_GPSACQ;
 
    	}
 
@@ -182,7 +182,7 @@ int main(void)
 
                	led_blink(4);
 
                    gps_poweroff();
 
                    fix_acq_starttime = 0;
 
                    last_wspr_tx_time = HAL_GetTick(); // repeat acq/tx cycle after big time delay
 
                    last_wspr_tx_time = rtc_timestamp(); // repeat acq/tx cycle after big time delay
 
                	state = SYSTEM_IDLE;
 
                }
 
                else
 
@@ -216,14 +216,14 @@ int main(void)
 
                        // 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();
 
						last_wspr_tx_time = rtc_timestamp();
 
						state = SYSTEM_IDLE;
 
                        adc_stop();
 
            		}
 
            		else
 
            		{
 
            			// Window was missed, go back to idle, and try again after time delay
 
						last_wspr_tx_time = HAL_GetTick();
 
						last_wspr_tx_time = rtc_timestamp();
 
            			state = SYSTEM_IDLE;
 
                        adc_stop();
 
            		}
0 comments (0 inline, 0 general)