mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-08 16:41:55 +00:00
zinger: activate the watchdog.
Ensure we are never stuck somewhere without doing the safety checks by enabling the watchdog and reloading it in the safaty checks function. I have kept the default timing constants, so on STM32F0xx the watchdog period should be between 1.2s (LSI at 30kHz) and 2.0s (LSI at 50kHz). Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=add a 2s loop in the serial port interrupt handler and see the power supply rebooting. Change-Id: I000f2a36a31e1166adf63a36c2b7f52999adc928 Reviewed-on: https://chromium-review.googlesource.com/201575 Reviewed-by: Alec Berg <alecaberg@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
committed by
chrome-internal-fetch
parent
f4de7fb005
commit
8c89bcff4d
@@ -13,6 +13,7 @@
|
||||
#include "task.h"
|
||||
#include "timer.h"
|
||||
#include "util.h"
|
||||
#include "watchdog.h"
|
||||
|
||||
static void clock_init(void)
|
||||
{
|
||||
@@ -164,6 +165,7 @@ void hardware_init(void)
|
||||
pins_init();
|
||||
uart_init();
|
||||
timers_init();
|
||||
watchdog_init();
|
||||
adc_init();
|
||||
irq_init();
|
||||
}
|
||||
|
||||
@@ -186,6 +186,9 @@ int pd_board_checks(void)
|
||||
int vbus_volt, vbus_amp;
|
||||
int watchdog_enabled = STM32_ADC_CFGR1 & (1 << 23);
|
||||
|
||||
/* Reload the watchdog */
|
||||
STM32_IWDG_KR = STM32_IWDG_KR_RELOAD;
|
||||
|
||||
if (watchdog_enabled)
|
||||
/* if the watchdog is enabled, stop it to do other readings */
|
||||
adc_disable_watchdog();
|
||||
|
||||
Reference in New Issue
Block a user