# HG changeset patch # User Ethan Zonca # Date 2016-10-13 20:21:04 # Node ID 38f0f245740995ccc80892554b16115c2c32b9ab # Parent bb703e19f2428ccf05763bb58fc1552022ffc472 Fix issue where code would constantly enter gpsacq state because of last wspr timeout expiring diff --git a/src/gps.c b/src/gps.c --- a/src/gps.c +++ b/src/gps.c @@ -234,6 +234,20 @@ void gps_poweron(void) void gps_poweroff(void) { // NOTE: pchannel + position.hour = 0; + position.minute = 0; + position.second = 0; + position.altitude = 0; + position.latitude = 0; + position.longitude = 0; + position.day = 0; + position.month = 0; + position.fixtype = 0; + position.valid = 0; + position.pdop = 0; + position.sats_in_solution = 0; + position.speed = 0; + uart_deinit(); HAL_GPIO_WritePin(GPS_NOTEN, 1); gpson = 0; diff --git a/src/main.c b/src/main.c --- a/src/main.c +++ b/src/main.c @@ -140,6 +140,8 @@ int main(void) // Flash error code and go to idle, try again next time led_blink(4); gps_poweroff(); + fix_acq_starttime = 0; + last_wspr_tx_time = HAL_GetTick(); // repeat acq/tx cycle after big time delay state = SYSTEM_IDLE; } } break; diff --git a/src/uart.c b/src/uart.c --- a/src/uart.c +++ b/src/uart.c @@ -93,6 +93,8 @@ void uart_deinit(void) //HAL_DMA_DeInit(&hdma_usart1_rx); //HAL_DMA_DeInit(&hdma_usart1_tx); HAL_UART_DeInit(&huart1); + __HAL_RCC_USART1_CLK_DISABLE(); + uart_initted = 0; } }