Sfoglia il codice sorgente

stm32: implement halt and reset

Florent 1 anno fa
parent
commit
8ccd4f3660
1 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  1. 7 0
      src/helpers/stm32/STM32Board.h

+ 7 - 0
src/helpers/stm32/STM32Board.h

@@ -23,6 +23,13 @@ public:
   }
 
   void reboot() override {
+    NVIC_SystemReset(); 
+  }
+
+  void powerOff() override {
+    HAL_PWREx_DisableInternalWakeUpLine();
+    __disable_irq();
+    HAL_PWREx_EnterSHUTDOWNMode();
   }
 
 #if defined(P_LORA_TX_LED)