comparison Small_CPU/Src/baseCPU2.c @ 942:06aaccaf2e02 Evo_2_23

Power down gnss module during dive: The gnss modul will now be send to powerdown at the start of the dive. After end of dive the module returns to normal operation. For development / test purpose a new simulated dive profile has been added.
author Ideenmodellierer
date Mon, 16 Dec 2024 19:09:00 +0100
parents 4a406e873a95
children e7f87ade3037
comparison
equal deleted inserted replaced
941:6d8ae8fbccf5 942:06aaccaf2e02
273 uint8_t measurementindex = 0; 273 uint8_t measurementindex = 0;
274 uint8_t lastsecond = 0xFF; 274 uint8_t lastsecond = 0xFF;
275 #endif 275 #endif
276 276
277 uint8_t extInterfaceActive = 0; 277 uint8_t extInterfaceActive = 0;
278 #if defined ENABLE_GNSS_SUPPORT || defined ENABLE_GPIO_V2
279 uint32_t shutdownTick = 0; 278 uint32_t shutdownTick = 0;
280 #endif
281 279
282 HAL_Init(); 280 HAL_Init();
283 SystemClock_Config(); 281 SystemClock_Config();
284 282
285 HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); 283 HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000);
460 vpm_init( &global.vpm, global.conservatism, global.repetitive_dive, 458 vpm_init( &global.vpm, global.conservatism, global.repetitive_dive,
461 global.seconds_since_last_dive ); 459 global.seconds_since_last_dive );
462 global.no_fly_time_minutes = 0; 460 global.no_fly_time_minutes = 0;
463 global.lifeData.dive_time_seconds = 0; 461 global.lifeData.dive_time_seconds = 0;
464 global.lifeData.dive_time_seconds_without_surface_time = 0; 462 global.lifeData.dive_time_seconds_without_surface_time = 0;
463
464 uartGnss_ReqPowerDown(1);
465
465 scheduleDiveMode(); 466 scheduleDiveMode();
466 // done now in scheduler prior to change mode: global.seconds_since_last_dive = 1; 467 // done now in scheduler prior to change mode: global.seconds_since_last_dive = 1;
467 468
468 if( global.lifeData.dive_time_seconds > 60 ) 469 if( global.lifeData.dive_time_seconds > 60 )
469 { 470 {
485 global.lifeData.dive_time_seconds_without_surface_time = 0; 486 global.lifeData.dive_time_seconds_without_surface_time = 0;
486 global.lifeData.counterSecondsShallowDepth = 0; 487 global.lifeData.counterSecondsShallowDepth = 0;
487 488
488 backup.no_fly_time_minutes = 0; 489 backup.no_fly_time_minutes = 0;
489 backup.seconds_since_last_dive = 0; 490 backup.seconds_since_last_dive = 0;
491
492 uartGnss_ReqPowerDown(0);
490 break; 493 break;
491 494
492 case MODE_SHUTDOWN: 495 case MODE_SHUTDOWN:
493 HAL_Delay(200); 496 HAL_Delay(200);
494 497