reducing code duplication
This commit is contained in:
parent
38dfe28d7a
commit
6915852a7a
|
@ -748,16 +748,6 @@ extern "C"
|
||||||
void chDbgPanic3(const char *msg, const char * file, int line);
|
void chDbgPanic3(const char *msg, const char * file, int line);
|
||||||
#endif
|
#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 { \
|
#define chDbgAssert(c, remark) do { \
|
||||||
if (CH_DBG_ENABLE_ASSERTS != FALSE) { \
|
if (CH_DBG_ENABLE_ASSERTS != FALSE) { \
|
||||||
|
|
|
@ -749,15 +749,7 @@ extern "C"
|
||||||
void chDbgPanic3(const char *msg, const char * file, int line);
|
void chDbgPanic3(const char *msg, const char * file, int line);
|
||||||
#endif
|
#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 { \
|
#define chDbgAssert(c, remark) do { \
|
||||||
|
|
|
@ -112,4 +112,14 @@ extern "C" {
|
||||||
irqExitHook(); \
|
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_ */
|
#endif /* CONFIG_CHCONF_COMMON_H_ */
|
||||||
|
|
|
@ -758,16 +758,6 @@ extern "C"
|
||||||
void chDbgPanic3(const char *msg, const char * file, int line);
|
void chDbgPanic3(const char *msg, const char * file, int line);
|
||||||
#endif
|
#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 { \
|
#define chDbgAssert(c, remark) do { \
|
||||||
if (CH_DBG_ENABLE_ASSERTS != FALSE) { \
|
if (CH_DBG_ENABLE_ASSERTS != FALSE) { \
|
||||||
|
|
|
@ -760,16 +760,6 @@ extern "C"
|
||||||
void chDbgPanic3(const char *msg, const char * file, int line);
|
void chDbgPanic3(const char *msg, const char * file, int line);
|
||||||
#endif
|
#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 { \
|
#define chDbgAssert(c, remark) do { \
|
||||||
if (CH_DBG_ENABLE_ASSERTS != FALSE) { \
|
if (CH_DBG_ENABLE_ASSERTS != FALSE) { \
|
||||||
|
|
Loading…
Reference in New Issue