summaryrefslogtreecommitdiff
path: root/hid/lib/drivers-stm32/board-stm32.h
diff options
context:
space:
mode:
authortomaszduda23 <[email protected]>2022-09-12 16:00:30 +0200
committerGitHub <[email protected]>2022-09-12 17:00:30 +0300
commitfa01d92dde2d4c199c8f6b394a72a4f41c28cfe9 (patch)
treec280173d27be97941d1862c5c160fbc1fe1c3dda /hid/lib/drivers-stm32/board-stm32.h
parent38f2da2e2e931c22d5ce1361d5e39bb5739022d5 (diff)
Watchdog (#108)
* add SW reset * adds watchdog
Diffstat (limited to 'hid/lib/drivers-stm32/board-stm32.h')
-rw-r--r--hid/lib/drivers-stm32/board-stm32.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/hid/lib/drivers-stm32/board-stm32.h b/hid/lib/drivers-stm32/board-stm32.h
index 212106b3..118138ad 100644
--- a/hid/lib/drivers-stm32/board-stm32.h
+++ b/hid/lib/drivers-stm32/board-stm32.h
@@ -23,16 +23,23 @@
#pragma once
#include "board.h"
+#include <libmaple/iwdg.h>
namespace DRIVERS {
class BoardStm32 : public Board {
public:
BoardStm32() : Board(BOARD){
+ //2 sec timeout
+ iwdg_init(IWDG_PRE_16, 0xFFF);
}
void reset() override {
nvic_sys_reset();
}
+
+ void periodic() {
+ iwdg_feed();
+ }
};
}