hal working

This commit is contained in:
Filipriec
2025-12-02 15:40:13 +01:00
parent af781eb1f8
commit ab932d1698
2 changed files with 20 additions and 3 deletions

View File

@@ -20,6 +20,12 @@ bind_interrupts!(struct Irqs {
USART1 => BufferedInterruptHandler<peripherals::USART1>;
});
unsafe extern "C" {
fn HAL_Init();
fn HAL_PWR_EnterSTANDBYMode();
fn HAL_PWREx_EnterSHUTDOWNMode();
}
#[embassy_executor::main]
async fn main(spawner: Spawner) {
info!("boot");
@@ -44,11 +50,19 @@ async fn main(spawner: Spawner) {
spawner.spawn(uart_task(uart, &PIPE_HW_TX, &PIPE_HW_RX).unwrap());
// END OF HARDWARE UART to the PC
unsafe {
HAL_Init();
HAL_PWR_EnterSTANDBYMode();
// Example 2 (unreachable if above executes): enter Shutdown
// HAL_PWREx_EnterSHUTDOWNMode();
}
loop {
info!("tick start");
// Timer::after(Duration::from_millis(100)).await;
// info!("tick end");
yield_now().await;
}
}