comparison Small_CPU/Src/scheduler.c @ 937:d461d9e89e3c Evo_2_23

Compile switch for RTE sleep debug: there was already a compiler switch for enabling debugging while RTE is in sleep but the switches were distributed across the code => to make selection easier they are now part of the configuration.h
author Ideenmodellierer
date Tue, 10 Dec 2024 20:59:37 +0100
parents 3029f0332f4f
children 4a406e873a95
comparison
equal deleted inserted replaced
936:3029f0332f4f 937:d461d9e89e3c
19 * 19 *
20 ****************************************************************************** 20 ******************************************************************************
21 */ 21 */
22 22
23 23
24 //#define DEBUGMODE
25
26 /* Includes ------------------------------------------------------------------*/ 24 /* Includes ------------------------------------------------------------------*/
27 #include <string.h> 25 #include <string.h>
28 #include "baseCPU2.h" 26 #include "baseCPU2.h"
29 #include "stm32f4xx_hal.h" 27 #include "stm32f4xx_hal.h"
30 #include "i2c.h" 28 #include "i2c.h"
1113 else 1111 else
1114 do 1112 do
1115 { 1113 {
1116 I2C_DeInit(); 1114 I2C_DeInit();
1117 1115
1118 #ifdef DEBUGMODE 1116 #ifdef ENABLE_SLEEP_DEBUG
1119 HAL_Delay(2000); 1117 HAL_Delay(2000);
1120 #else 1118 #else
1121 RTC_StopMode_2seconds(); 1119 RTC_StopMode_2seconds();
1122 #endif 1120 #endif
1123 1121
1187 if(deepSleepCntDwn) 1185 if(deepSleepCntDwn)
1188 { 1186 {
1189 deepSleepCntDwn--; 1187 deepSleepCntDwn--;
1190 if(deepSleepCntDwn == 0) 1188 if(deepSleepCntDwn == 0)
1191 { 1189 {
1190 GPIO_GPS_OFF();
1192 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; 1191 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
1193 GPIO_InitStruct.Speed = GPIO_SPEED_LOW; 1192 GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
1194 GPIO_InitStruct.Pull = GPIO_NOPULL; 1193 GPIO_InitStruct.Pull = GPIO_NOPULL;
1195 GPIO_InitStruct.Pin = GPIO_PIN_All ^ (GPS_POWER_CONTROL_PIN | GPS_BCKP_CONTROL_PIN); 1194 GPIO_InitStruct.Pin = GPIO_PIN_All ^ (GPS_POWER_CONTROL_PIN | GPS_BCKP_CONTROL_PIN);
1196 HAL_GPIO_Init( GPIOB, &GPIO_InitStruct); 1195 HAL_GPIO_Init( GPIOB, &GPIO_InitStruct);
1197 GPIO_GPS_OFF(); 1196 __HAL_RCC_GPIOB_CLK_DISABLE();
1198 uartGnss_SetState(UART_GNSS_INIT); 1197 uartGnss_SetState(UART_GNSS_INIT);
1199 } 1198 }
1200 } 1199 }
1201 #endif 1200 #endif
1202 } 1201 }