File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -27,18 +27,36 @@ reset_reason_t hal_reset_reason_get(void)
27
27
}
28
28
#endif
29
29
30
+ #ifdef RCC_FLAG_LPWR1RST
31
+ if ((__HAL_RCC_GET_FLAG (RCC_FLAG_LPWR1RST ))|| (__HAL_RCC_GET_FLAG (RCC_FLAG_LPWR2RST ))) {
32
+ return RESET_REASON_WAKE_LOW_POWER ;
33
+ }
34
+ #endif
35
+
30
36
#ifdef RCC_FLAG_WWDGRST
31
37
if (__HAL_RCC_GET_FLAG (RCC_FLAG_WWDGRST )) {
32
38
return RESET_REASON_WATCHDOG ;
33
39
}
34
40
#endif
35
41
42
+ #ifdef RCC_FLAG_WWDG1RST
43
+ if (__HAL_RCC_GET_FLAG (RCC_FLAG_WWDG1RST )) {
44
+ return RESET_REASON_WATCHDOG ;
45
+ }
46
+ #endif
47
+
36
48
#ifdef RCC_FLAG_IWDGRST
37
49
if (__HAL_RCC_GET_FLAG (RCC_FLAG_IWDGRST )) {
38
50
return RESET_REASON_WATCHDOG ;
39
51
}
40
52
#endif
41
53
54
+ #ifdef RCC_FLAG_IWDG1RST
55
+ if (__HAL_RCC_GET_FLAG (RCC_FLAG_IWDG1RST )) {
56
+ return RESET_REASON_WATCHDOG ;
57
+ }
58
+ #endif
59
+
42
60
#ifdef RCC_FLAG_SFTRST
43
61
if (__HAL_RCC_GET_FLAG (RCC_FLAG_SFTRST )) {
44
62
return RESET_REASON_SOFTWARE ;
@@ -69,7 +87,11 @@ reset_reason_t hal_reset_reason_get(void)
69
87
70
88
uint32_t hal_reset_reason_get_raw (void )
71
89
{
90
+ #if TARGET_STM32H7
91
+ return RCC -> RSR ;
92
+ #else /* TARGET_STM32H7 */
72
93
return RCC -> CSR ;
94
+ #endif /* TARGET_STM32H7 */
73
95
}
74
96
75
97
You can’t perform that action at this time.
0 commit comments