Skip to content

Commit

Permalink
stm32g4: move dead battery handling
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner committed Aug 3, 2024
1 parent 14764f0 commit c111ec1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/driver/stm32/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ void time_init() {
#endif
__HAL_RCC_SYSCFG_CLK_ENABLE();

#ifdef STM32G4
LL_PWR_DisableUCPDDeadBattery();
#endif
// interrupt only every 1ms
SysTick_Config(SYS_CLOCK_FREQ_HZ / 1000);

Expand Down
4 changes: 4 additions & 0 deletions src/system/stm32g473/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ static void SystemClock_Config(void) {

// Configure the main internal regulator output voltage
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1_BOOST);
HAL_PWREx_DisableBatteryCharging();
HAL_PWREx_DisableInternalWakeUpLine();
HAL_PWREx_DisableUCPDDeadBattery();
HAL_PWREx_DisableUCPDStandbyMode();

// Initializes the CPU, AHB and APB busses clocks
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
Expand Down

0 comments on commit c111ec1

Please sign in to comment.