From 0a94dc188c6a07aa6a99bef00991d9226af917ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=9B=88=ED=9D=AC?= Date: Fri, 11 Jan 2019 15:06:58 +0900 Subject: [PATCH] Resolved #7 - add watchdog --- WIZ550SR_App/src/common.h | 2 +- WIZ550SR_App/src/main.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/WIZ550SR_App/src/common.h b/WIZ550SR_App/src/common.h index b9b903c..5b591c0 100644 --- a/WIZ550SR_App/src/common.h +++ b/WIZ550SR_App/src/common.h @@ -6,7 +6,7 @@ #define MAJOR_VER 1 #define MINOR_VER 1 -#define MAINTENANCE_VER 8 +#define MAINTENANCE_VER 9 #define SOCK_DATA 0 #define SOCK_TFTP 1 diff --git a/WIZ550SR_App/src/main.c b/WIZ550SR_App/src/main.c index 2aae7ad..f611c01 100644 --- a/WIZ550SR_App/src/main.c +++ b/WIZ550SR_App/src/main.c @@ -25,6 +25,7 @@ #include "dhcp_cb.h" #include "i2cHandler.h" #include "eepromHandler.h" +#include "stm32f10x_iwdg.h" // ---------------------------------------------------------------------------- // @@ -172,7 +173,16 @@ int main(int argc, char* argv[]) atc_init(); op_mode = OP_DATA; + + IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable); + IWDG_SetPrescaler(IWDG_Prescaler_256); + IWDG_SetReload(156); + IWDG_ReloadCounter(); + IWDG_Enable(); + while (1) { + IWDG_ReloadCounter(); + if(op_mode == OP_COMMAND) { // Command Mode atc_run(); sockwatch_run();