# HG changeset patch # User Ideenmodellierer # Date 1734034327 -3600 # Node ID 4a406e873a9541d56b004905236f39c6d89080e7 # Parent f4197473426801593ca1a4e86060d2d39702f235 GNSS improvments: - Introduce alive indicator; Status string will switch between white and grey with every message received from the module - shorten visibility of "shutting down" string. a busy wait of 1 second was applied in the sleep prepare function. The time is now included in the time needed to prepare the module for low power operation - make sure GPIO is properly initialized after deep sleep diff -r f41974734268 -r 4a406e873a95 Common/Inc/data_central.h --- a/Common/Inc/data_central.h Tue Dec 10 21:03:04 2024 +0100 +++ b/Common/Inc/data_central.h Thu Dec 12 21:12:07 2024 +0100 @@ -169,6 +169,7 @@ { float fLat; float fLon; + uint8_t alive; uint8_t fixType; uint8_t numSat; /* number of available satellites */ uint8_t signalQual[4]; /* signal quality indicator for x sats */ diff -r f41974734268 -r 4a406e873a95 Discovery/Src/t7.c --- a/Discovery/Src/t7.c Tue Dec 10 21:03:04 2024 +0100 +++ b/Discovery/Src/t7.c Thu Dec 12 21:12:07 2024 +0100 @@ -4046,7 +4046,14 @@ if(stateUsed->lifeData.gnssData.fixType < 2) { textpointer += snprintf(&text[textpointer],50,"\001Satellites\n\r"); - textpointer += snprintf(&text[textpointer],50,"\001Status\n\r"); + if(stateUsed->lifeData.gnssData.alive) + { + textpointer += snprintf(&text[textpointer],50,"\001\020Status\n\r"); + } + else + { + textpointer += snprintf(&text[textpointer],50,"\001\021Status\n\r"); + } } else { diff -r f41974734268 -r 4a406e873a95 Small_CPU/Inc/GNSS.h --- a/Small_CPU/Inc/GNSS.h Tue Dec 10 21:03:04 2024 +0100 +++ b/Small_CPU/Inc/GNSS.h Thu Dec 12 21:12:07 2024 +0100 @@ -91,6 +91,8 @@ uint8_t numSat; uint8_t statSat[4]; + uint8_t alive; + }GNSS_StateHandle; GNSS_StateHandle GNSS_Handle; diff -r f41974734268 -r 4a406e873a95 Small_CPU/Src/GNSS.c --- a/Small_CPU/Src/GNSS.c Tue Dec 10 21:03:04 2024 +0100 +++ b/Small_CPU/Src/GNSS.c Thu Dec 12 21:12:07 2024 +0100 @@ -138,6 +138,8 @@ { GNSS->fLat = searchCnt++; } + + GNSS->alive = !GNSS->alive; } /*! diff -r f41974734268 -r 4a406e873a95 Small_CPU/Src/baseCPU2.c --- a/Small_CPU/Src/baseCPU2.c Tue Dec 10 21:03:04 2024 +0100 +++ b/Small_CPU/Src/baseCPU2.c Thu Dec 12 21:12:07 2024 +0100 @@ -505,7 +505,7 @@ #else UART6_HandleUART(); #endif - if((uartGnss_GetState() == UART_GNSS_INACTIVE) || (time_elapsed_ms(shutdownTick,HAL_GetTick()) > 5000)) + if((uartGnss_GetState() == UART_GNSS_INACTIVE) || (time_elapsed_ms(shutdownTick,HAL_GetTick()) > 3000)) { global.mode = MODE_SLEEP; uartGnss_ReqPowerDown(0); /* release power down request */ @@ -526,6 +526,11 @@ GPIO_LEDs_VIBRATION_Init(); sleep_prepare(); + while(time_elapsed_ms(shutdownTick,HAL_GetTick()) < 1000 ) /* delay shutdown till shutdown animation is finished */ + { + HAL_Delay(10); + } + shutdownTick = 0; scheduleSleepMode(); if (hasExternalClock()) SystemClock_Config_HSE(); @@ -934,8 +939,6 @@ */ #endif __HAL_RCC_GPIOH_CLK_DISABLE(); - - HAL_Delay(1000); } /* diff -r f41974734268 -r 4a406e873a95 Small_CPU/Src/scheduler.c --- a/Small_CPU/Src/scheduler.c Tue Dec 10 21:03:04 2024 +0100 +++ b/Small_CPU/Src/scheduler.c Thu Dec 12 21:12:07 2024 +0100 @@ -1206,6 +1206,11 @@ setButtonsNow = 0; reinitGlobals(); ReInit_battery_charger_status_pins(); + + if(deepSleepCntDwn == 0) + { + GPIO_GNSS_Init(); + } } @@ -1771,6 +1776,8 @@ global.dataSendToMaster.data[0].gnssInfo.fLon = GNSS_Handle.fLon; global.dataSendToMaster.data[0].gnssInfo.fixType = GNSS_Handle.fixType; global.dataSendToMaster.data[0].gnssInfo.numSat = GNSS_Handle.numSat; + global.dataSendToMaster.data[0].gnssInfo.alive = GNSS_Handle.alive; + memcpy(&global.dataSendToMaster.data[0].gnssInfo.signalQual,&GNSS_Handle.statSat, sizeof(GNSS_Handle.statSat)); }