Mercurial > public > ostc4
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 939:f41974734268 | 940:4a406e873a95 |
|---|---|
| 503 #ifdef ENABLE_GNSS_SUPPORT | 503 #ifdef ENABLE_GNSS_SUPPORT |
| 504 externalInterface_HandleUART(); | 504 externalInterface_HandleUART(); |
| 505 #else | 505 #else |
| 506 UART6_HandleUART(); | 506 UART6_HandleUART(); |
| 507 #endif | 507 #endif |
| 508 if((uartGnss_GetState() == UART_GNSS_INACTIVE) || (time_elapsed_ms(shutdownTick,HAL_GetTick()) > 5000)) | 508 if((uartGnss_GetState() == UART_GNSS_INACTIVE) || (time_elapsed_ms(shutdownTick,HAL_GetTick()) > 3000)) |
| 509 { | 509 { |
| 510 global.mode = MODE_SLEEP; | 510 global.mode = MODE_SLEEP; |
| 511 uartGnss_ReqPowerDown(0); /* release power down request */ | 511 uartGnss_ReqPowerDown(0); /* release power down request */ |
| 512 } | 512 } |
| 513 #else | 513 #else |
| 524 if (hasExternalClock()) | 524 if (hasExternalClock()) |
| 525 SystemClock_Config_HSI(); | 525 SystemClock_Config_HSI(); |
| 526 GPIO_LEDs_VIBRATION_Init(); | 526 GPIO_LEDs_VIBRATION_Init(); |
| 527 sleep_prepare(); | 527 sleep_prepare(); |
| 528 | 528 |
| 529 while(time_elapsed_ms(shutdownTick,HAL_GetTick()) < 1000 ) /* delay shutdown till shutdown animation is finished */ | |
| 530 { | |
| 531 HAL_Delay(10); | |
| 532 } | |
| 533 shutdownTick = 0; | |
| 529 scheduleSleepMode(); | 534 scheduleSleepMode(); |
| 530 if (hasExternalClock()) | 535 if (hasExternalClock()) |
| 531 SystemClock_Config_HSE(); | 536 SystemClock_Config_HSE(); |
| 532 EXTI_Wakeup_Button_DeInit(); | 537 EXTI_Wakeup_Button_DeInit(); |
| 533 ADCx_Init(); | 538 ADCx_Init(); |
| 932 /* | 937 /* |
| 933 __HAL_RCC_GPIOB_CLK_DISABLE(); | 938 __HAL_RCC_GPIOB_CLK_DISABLE(); |
| 934 */ | 939 */ |
| 935 #endif | 940 #endif |
| 936 __HAL_RCC_GPIOH_CLK_DISABLE(); | 941 __HAL_RCC_GPIOH_CLK_DISABLE(); |
| 937 | |
| 938 HAL_Delay(1000); | |
| 939 } | 942 } |
| 940 | 943 |
| 941 /* | 944 /* |
| 942 void sleep_test(void) | 945 void sleep_test(void) |
| 943 { | 946 { |
