Skip to content

Commit dfba2c6

Browse files
committed
[H7] Fix IWDG
Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 2aee412 commit dfba2c6

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Diff for: libraries/IWatchdog/src/IWatchdog.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,11 @@ void IWatchdogClass::reload(void)
145145
*/
146146
bool IWatchdogClass::isReset(bool clear)
147147
{
148+
#ifdef IWDG1
149+
bool status = LL_RCC_IsActiveFlag_IWDG1RST();
150+
#else
148151
bool status = LL_RCC_IsActiveFlag_IWDGRST();
152+
#endif
149153
if (status && clear) {
150154
clearReset();
151155
}

Diff for: libraries/IWatchdog/src/IWatchdog.h

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
#include "Arduino.h"
55

6+
#if !defined(IWDG) && defined(IWDG1)
7+
#define IWDG IWDG1
8+
#endif
9+
610
// Minimal timeout in microseconds
711
#define IWDG_TIMEOUT_MIN ((4*1000000)/LSI_VALUE)
812
// Maximal timeout in microseconds

0 commit comments

Comments
 (0)