comparison Small_CPU/Src/baseCPU2.c @ 1000:c386ae6635e4 GasConsumption

Improve GNSS operation: during OSTC 4/5 code merge a problem with the wakeup of the gnss module showed up which has been fixed with the new verion. In addition a compile switch has been added which activated the synchronization of time between OSTC and gnss module. This my cause problems if the time is not accurate => deactivated at the moment.
author Ideenmodellierer
date Mon, 28 Apr 2025 19:51:36 +0200
parents d63584d6428d
children efb7d18cc564
comparison
equal deleted inserted replaced
999:ac25c35a3c97 1000:c386ae6635e4
481 case MODE_SHUTDOWN: 481 case MODE_SHUTDOWN:
482 HAL_Delay(200); 482 HAL_Delay(200);
483 483
484 MX_SPI3_Init(); 484 MX_SPI3_Init();
485 485
486 #if defined ENABLE_GNSS_INTERN || ENABLE_GNSS_EXTERN 486 #if defined ENABLE_GNSS_INTERN || defined ENABLE_GNSS_EXTERN
487
488 do
489 {
487 if(GPIO_GetVersion() > 0) 490 if(GPIO_GetVersion() > 0)
488 { 491 {
489 if(shutdownTick == 0) 492 if(shutdownTick == 0)
490 { 493 {
491 shutdownTick = HAL_GetTick(); 494 shutdownTick = HAL_GetTick();
502 UART6_HandleUART(); 505 UART6_HandleUART();
503 } 506 }
504 #endif 507 #endif
505 #endif 508 #endif
506 #if defined ENABLE_GNSS_INTERN || defined ENABLE_GNSS_EXTERN 509 #if defined ENABLE_GNSS_INTERN || defined ENABLE_GNSS_EXTERN
507 if((uartGnss_GetState() == UART_GNSS_INACTIVE) || (time_elapsed_ms(shutdownTick,HAL_GetTick()) > 3000)) 510 if((uartGnss_GetState() == UART_GNSS_INACTIVE) || (time_elapsed_ms(shutdownTick,HAL_GetTick()) > 4000))
508 { 511 {
509 global.mode = MODE_SLEEP; 512 global.mode = MODE_SLEEP;
510 uartGnss_ReqPowerDown(0); /* release power down request */ 513 uartGnss_ReqPowerDown(0); /* release power down request */
514 uartGnss_SetState(UART_GNSS_INACTIVE);
511 } 515 }
516
512 #else 517 #else
513 global.mode = MODE_SLEEP; 518 global.mode = MODE_SLEEP;
514 #endif 519 #endif
515 520
516 521 }while (global.mode == MODE_SHUTDOWN);
517 break; 522 break;
518 523
519 case MODE_SLEEP: 524 case MODE_SLEEP:
520 extInterfaceActive = externalInterface_isEnabledPower33(); 525 extInterfaceActive = externalInterface_isEnabledPower33();
521 externalInterface_SwitchUART(EXT_INTERFACE_UART_OFF); 526 externalInterface_SwitchUART(EXT_INTERFACE_UART_OFF);
547 if(extInterfaceActive) 552 if(extInterfaceActive)
548 { 553 {
549 externalInterface_SwitchPower33(true); 554 externalInterface_SwitchPower33(true);
550 } 555 }
551 externalInterface_InitDatastruct(); 556 externalInterface_InitDatastruct();
557 MX_USART6_UART_Init();
558 GNSS_Init(&GNSS_Handle, &huart6);
552 // EXTILine0_Button_DeInit(); not now, later after testing 559 // EXTILine0_Button_DeInit(); not now, later after testing
553 break; 560 break;
554 } 561 }
555 562
556 #ifdef DEBUG_RUNTIME 563 #ifdef DEBUG_RUNTIME