diff Small_CPU/Src/baseCPU2.c @ 940:4a406e873a95 Evo_2_23

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
author Ideenmodellierer
date Thu, 12 Dec 2024 21:12:07 +0100
parents df87dbfc9c21
children 06aaccaf2e02
line wrap: on
line diff
--- 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);
 }
 
 /*