tim #6

Merged
Steins7 merged 16 commits from tim into dev 2024-11-03 12:07:39 +00:00
Showing only changes of commit 70e6cd2d19 - Show all commits

View File

@ -26,7 +26,7 @@ static volatile struct PWR* regs = (struct PWR*)PWR_BASE_ADDRESS;
void pwr_sleep(void)
{
scb_configure_deepsleep(false);
__asm("wfi");
__asm("wfe");
}
void pwr_stop(enum PwrWakeupSpeed speed)
@ -35,7 +35,7 @@ void pwr_stop(enum PwrWakeupSpeed speed)
scb_configure_deepsleep(true);
regs->CR.PDDS = 0;
regs->CR.LPDS = speed;
__asm("wfi");
__asm("wfe");
rcc_configure(RCC_PRESET_SPEED);
}
@ -44,7 +44,7 @@ void pwr_standby(void)
rcc_enable(RCC_AHB_NONE, RCC_APB1_PWR, RCC_APB2_NONE);
scb_configure_deepsleep(true);
regs->CR.PDDS = 1;
__asm("wfi");
__asm("wfe");
rcc_configure(RCC_PRESET_SPEED);
}