AAP_HAL_ChibiOS: allow asserts to be printed on a GPIO pin

This commit is contained in:
Andy Piper 2021-01-23 13:54:41 +00:00 committed by Andrew Tridgell
parent d41c92d317
commit 6f5d5c2bf9
1 changed files with 15 additions and 0 deletions

View File

@ -53,6 +53,21 @@
#define CH_DBG_SYSTEM_STATE_CHECK TRUE
#undef CH_DBG_ENABLE_STACK_CHECK
#define CH_DBG_ENABLE_STACK_CHECK TRUE
// Generate assertions on a GPIO pin
#ifdef HAL_GPIO_PIN_FAULT
#ifndef _FROM_ASM_
#ifdef __cplusplus
extern "C" {
#endif
void fault_printf(const char *fmt, ...);
#ifdef __cplusplus
}
#endif
#endif
#define osalDbgAssert(c, remark) do { if (!(c)) { fault_printf("%s:%d: %s", __FILE__, __LINE__, remark ); chDbgAssert(c, remark); } } while (0)
#endif
#endif
#if HAL_ENABLE_THREAD_STATISTICS