reducing code duplication

This commit is contained in:
rusefillc 2021-02-05 23:41:26 -05:00
parent 38dfe28d7a
commit 6915852a7a
5 changed files with 11 additions and 39 deletions

View File

@ -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) { \

View File

@ -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 { \

View File

@ -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_ */

View File

@ -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) { \

View File

@ -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) { \