Files
@ f2c57ce0cd7b
Branch filter:
Location: windsonde/Source/system/watchdog.c - annotation
f2c57ce0cd7b
640 B
text/plain
Refactor old pressure code and make optional. Fix high power output due to multiple Si446x power definitions
0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 2ee6c8e67f32 2ee6c8e67f32 | //
// Watchdog: configure and initialize the watchdog peripheral
//
#include "stm32f0xx_hal.h"
#include "config.h"
#include "system/watchdog.h"
#ifdef WATCHDOG_ENABLE
static IWDG_HandleTypeDef hiwdg;
#endif
void watchdog_init(void)
{
#ifdef WATCHDOG_ENABLE
hiwdg.Instance = IWDG;
hiwdg.Init.Prescaler = IWDG_PRESCALER_4;
hiwdg.Init.Window = 4095;
hiwdg.Init.Reload = 4095;
HAL_IWDG_Init(&hiwdg);
watchdog_feed();
HAL_IWDG_Start(&hiwdg);
#endif
}
void watchdog_feed(void)
{
#ifdef WATCHDOG_ENABLE
HAL_IWDG_Refresh(&hiwdg);
#endif
}
// vim:softtabstop=4 shiftwidth=4 expandtab
|