Skip to content

Commit 9dcda4e

Browse files
alexceltare2fpistm
andauthored
Minor changes (#67)
Signed-off-by: George Popa <[email protected]> Co-authored-by: Frederic Pillon <[email protected]> * fix: commented out potential non-included library * Update examples/Peripherals/Registers/Reset_reason/Reset_reason.ino Co-authored-by: Frederic Pillon <[email protected]> Signed-off-by: Alex <[email protected]> * Update examples/Peripherals/Registers/Reset_reason/Reset_reason.ino Co-authored-by: Frederic Pillon <[email protected]> Signed-off-by: Alex <[email protected]> * Update examples/Peripherals/Registers/Reset_reason/Reset_reason.ino Co-authored-by: Frederic Pillon <[email protected]> Signed-off-by: Alex <[email protected]> * Update examples/Peripherals/Registers/Reset_reason/Reset_reason.ino Co-authored-by: Frederic Pillon <[email protected]> Signed-off-by: Alex <[email protected]> * Update examples/Peripherals/Registers/Reset_reason/Reset_reason.ino Co-authored-by: Frederic Pillon <[email protected]> Signed-off-by: Alex <[email protected]> * Update examples/Peripherals/Registers/Reset_reason/Reset_reason.ino Co-authored-by: Frederic Pillon <[email protected]> Signed-off-by: Alex <[email protected]> --------- Signed-off-by: George Popa <[email protected]> Signed-off-by: Alex <[email protected]> Co-authored-by: Frederic Pillon <[email protected]>
1 parent 75a8c0b commit 9dcda4e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/Peripherals/Registers/Reset_reason/Reset_reason.ino

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#include <STM32LowPower.h>
2-
#include <low_power.h>
3-
41
/* Last Reset Reason Sketch
52
* This sketch will determine what caused the last reset on the STM32 MCU. Most microcontrollers
63
* have a register dedicated to storing the last reason of the chip, weather being from a
@@ -12,6 +9,7 @@
129

1310
#include "stm32yyxx_ll_rcc.h"
1411
#include "IWatchdog.h"
12+
// #include "STM32LowPower.h"
1513

1614
#define USER_BTN_PIN USER_BTN // Adjust this for your board
1715

@@ -36,6 +34,9 @@ static int default_button_state = LOW;
3634
void Reset_My_MCU() {
3735
// There are a few reset conditions. Keep the one you wish to use and comment out the others.
3836

37+
// Below is the WakeUp reset condition (needs STM32LowPower.h library)
38+
// LowPower.shutdown(1000);
39+
3940
// Below is the Software reset condition
4041
// NVIC_SystemReset();
4142

@@ -82,7 +83,7 @@ void setup() {
8283
#endif
8384

8485

85-
// Clear reset flags
86+
// Clear internal reset flags after they were captured
8687
LL_RCC_ClearResetFlags();
8788
#if defined(PWR_SCR_CSBF) || defined(PWR_CR1_CSBF) || defined(PWR_PMCR_CSSF) || defined(PWR_SR_CSSF)
8889
#if defined(STM32U0xx)

0 commit comments

Comments
 (0)