Set watchdog to approximately 2s and add refreshing
This commit is contained in:
parent
8e15ee72f3
commit
5169ddd4bd
@ -90,7 +90,6 @@ void init(void)
|
||||
MX_GPIO_Init();
|
||||
MX_ADC_Init();
|
||||
MX_USB_DEVICE_Init();
|
||||
MX_IWDG_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
||||
/* USER CODE END 2 */
|
||||
|
@ -31,7 +31,7 @@ void MX_IWDG_Init(void)
|
||||
{
|
||||
|
||||
hiwdg.Instance = IWDG;
|
||||
hiwdg.Init.Prescaler = IWDG_PRESCALER_4;
|
||||
hiwdg.Init.Prescaler = IWDG_PRESCALER_16;
|
||||
hiwdg.Init.Window = 4095;
|
||||
hiwdg.Init.Reload = 4095;
|
||||
if (HAL_IWDG_Init(&hiwdg) != HAL_OK)
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "init.h"
|
||||
#include "iwdg.h"
|
||||
#include "terminal.hpp"
|
||||
#include "uart.hpp"
|
||||
|
||||
@ -37,11 +38,13 @@ static inline void initializeHardware()
|
||||
int main()
|
||||
{
|
||||
initializeHardware();
|
||||
MX_IWDG_Init();
|
||||
|
||||
terminal_t terminal;
|
||||
|
||||
while(true) {
|
||||
terminal.callback();
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user