From 6915852a7a9ad5dbda6260168489d3bc2ed3d67e Mon Sep 17 00:00:00 2001 From: rusefillc Date: Fri, 5 Feb 2021 23:41:26 -0500 Subject: [PATCH] reducing code duplication --- firmware/config/boards/hellen/cypress/chconf.h | 10 ---------- firmware/config/boards/kinetis/chconf.h | 10 +--------- firmware/config/chconf_common.h | 10 ++++++++++ firmware/config/stm32f4ems/chconf.h | 10 ---------- firmware/config/stm32f7ems/chconf.h | 10 ---------- 5 files changed, 11 insertions(+), 39 deletions(-) diff --git a/firmware/config/boards/hellen/cypress/chconf.h b/firmware/config/boards/hellen/cypress/chconf.h index d70d2032fe..1c1c471170 100644 --- a/firmware/config/boards/hellen/cypress/chconf.h +++ b/firmware/config/boards/hellen/cypress/chconf.h @@ -748,16 +748,6 @@ extern "C" void chDbgPanic3(const char *msg, const char * file, int line); #endif -/** - * declared as a macro so that this code does not use stack - * so that it would not crash the error handler in case of stack issues - */ -#if CH_DBG_SYSTEM_STATE_CHECK -#define hasOsPanicError() (ch.dbg.panic_msg != NULL) -#else -#define hasOsPanicError() (FALSE) -#endif - #define chDbgAssert(c, remark) do { \ if (CH_DBG_ENABLE_ASSERTS != FALSE) { \ diff --git a/firmware/config/boards/kinetis/chconf.h b/firmware/config/boards/kinetis/chconf.h index 8931de9249..07a69b0075 100644 --- a/firmware/config/boards/kinetis/chconf.h +++ b/firmware/config/boards/kinetis/chconf.h @@ -749,15 +749,7 @@ extern "C" void chDbgPanic3(const char *msg, const char * file, int line); #endif -/** - * declared as a macro so that this code does not use stack - * so that it would not crash the error handler in case of stack issues - */ -#if CH_DBG_SYSTEM_STATE_CHECK -#define hasOsPanicError() (ch.dbg.panic_msg != NULL) -#else -#define hasOsPanicError() (FALSE) -#endif + #define chDbgAssert(c, remark) do { \ diff --git a/firmware/config/chconf_common.h b/firmware/config/chconf_common.h index 69bac56ebf..a6b33e2322 100644 --- a/firmware/config/chconf_common.h +++ b/firmware/config/chconf_common.h @@ -112,4 +112,14 @@ extern "C" { irqExitHook(); \ } +/** + * declared as a macro so that this code does not use stack + * so that it would not crash the error handler in case of stack issues + */ +#if CH_DBG_SYSTEM_STATE_CHECK +#define hasOsPanicError() (ch.dbg.panic_msg != NULL) +#else +#define hasOsPanicError() (FALSE) +#endif + #endif /* CONFIG_CHCONF_COMMON_H_ */ diff --git a/firmware/config/stm32f4ems/chconf.h b/firmware/config/stm32f4ems/chconf.h index 187167d7e2..57cea7a7e2 100644 --- a/firmware/config/stm32f4ems/chconf.h +++ b/firmware/config/stm32f4ems/chconf.h @@ -758,16 +758,6 @@ extern "C" void chDbgPanic3(const char *msg, const char * file, int line); #endif -/** - * declared as a macro so that this code does not use stack - * so that it would not crash the error handler in case of stack issues - */ -#if CH_DBG_SYSTEM_STATE_CHECK -#define hasOsPanicError() (ch.dbg.panic_msg != NULL) -#else -#define hasOsPanicError() (FALSE) -#endif - #define chDbgAssert(c, remark) do { \ if (CH_DBG_ENABLE_ASSERTS != FALSE) { \ diff --git a/firmware/config/stm32f7ems/chconf.h b/firmware/config/stm32f7ems/chconf.h index be895edc55..3badf19966 100644 --- a/firmware/config/stm32f7ems/chconf.h +++ b/firmware/config/stm32f7ems/chconf.h @@ -760,16 +760,6 @@ extern "C" void chDbgPanic3(const char *msg, const char * file, int line); #endif -/** - * declared as a macro so that this code does not use stack - * so that it would not crash the error handler in case of stack issues - */ -#if CH_DBG_SYSTEM_STATE_CHECK -#define hasOsPanicError() (ch.dbg.panic_msg != NULL) -#else -#define hasOsPanicError() (FALSE) -#endif - #define chDbgAssert(c, remark) do { \ if (CH_DBG_ENABLE_ASSERTS != FALSE) { \