From 6c4b698fd7ac523f00a9dad124c0d9ff5fabb44b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Tue, 28 Jul 2020 23:29:35 +0200 Subject: [PATCH] Add safety flag for debugbuild --- .../include/reflow-controller/safety/safety-config.h | 1 + stm-firmware/safety/safety-controller.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/stm-firmware/include/reflow-controller/safety/safety-config.h b/stm-firmware/include/reflow-controller/safety/safety-config.h index 4d2e22b..7ecabc7 100644 --- a/stm-firmware/include/reflow-controller/safety/safety-config.h +++ b/stm-firmware/include/reflow-controller/safety/safety-config.h @@ -36,6 +36,7 @@ enum safety_flag { ERR_FLAG_SYSTICK = (1<<10), ERR_FLAG_WTCHDG_FIRED = (1<<11), ERR_FLAG_UNCAL = (1<<12), + ERR_FLAG_DEBUG = (1<<13), }; enum timing_monitor { diff --git a/stm-firmware/safety/safety-controller.c b/stm-firmware/safety/safety-controller.c index 2a7ad95..81af15b 100644 --- a/stm-firmware/safety/safety-controller.c +++ b/stm-firmware/safety/safety-controller.c @@ -85,6 +85,7 @@ static volatile struct error_flag flags[] = { ERR_FLAG_ENTRY(ERR_FLAG_SYSTICK, true), ERR_FLAG_ENTRY(ERR_FLAG_WTCHDG_FIRED, true), ERR_FLAG_ENTRY(ERR_FLAG_UNCAL, false), + ERR_FLAG_ENTRY(ERR_FLAG_DEBUG, true), }; static volatile struct timing_mon timings[] = { @@ -248,6 +249,10 @@ void safety_controller_init() if (watchdog_check_reset_source()) safety_controller_report_error(ERR_FLAG_WTCHDG_FIRED); + +#ifdef DEBUGBUILD + safety_controller_report_error(ERR_FLAG_DEBUG); +#endif } static void safety_controller_check_stack()