summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-10-24 12:37:43 +0700
committerhathach <[email protected]>2018-10-24 12:37:43 +0700
commitbfa10016ae353779f7b94da31156ac997062322a (patch)
treef06afdf7348ad6b34d90bf2593bf15fea49fca64 /src/common
parent55427606ef7fbdafa5a9da6b8a0f798dcb619817 (diff)
rename verify_breakpoint to TU_BREAKPOINT
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_verify.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/common/tusb_verify.h b/src/common/tusb_verify.h
index 41c2b5be1..1cb8443bc 100644
--- a/src/common/tusb_verify.h
+++ b/src/common/tusb_verify.h
@@ -74,14 +74,14 @@
// Halt CPU (breakpoint) when hitting error, only apply for Cortex M3, M4, M7
#if defined(__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__)
-#define verify_breakpoint() \
+#define TU_BREAKPOINT() \
do {\
volatile uint32_t* ARM_CM_DHCSR = ((volatile uint32_t*) 0xE000EDF0UL); /* Cortex M CoreDebug->DHCSR */ \
if ( (*ARM_CM_DHCSR) & 1UL ) __asm("BKPT #0\n"); /* Only halt mcu if debugger is attached */\
} while(0)
#else
-#define verify_breakpoint()
+#define TU_BREAKPOINT()
#endif
/*------------------------------------------------------------------*/
@@ -157,21 +157,21 @@
/*------------------------------------------------------------------*/
/* ASSERT
- * basically TU_VERIFY with verify_breakpoint() as handler
+ * basically TU_VERIFY with TU_BREAKPOINT() as handler
* - 1 arg : return false if failed
* - 2 arg : return error if failed
*------------------------------------------------------------------*/
-#define ASSERT_1ARGS(_cond) TU_VERIFY_DEFINE(_cond, _MESS_FAILED(); verify_breakpoint(), false)
-#define ASSERT_2ARGS(_cond, _ret) TU_VERIFY_DEFINE(_cond, _MESS_FAILED(); verify_breakpoint(), _ret)
+#define ASSERT_1ARGS(_cond) TU_VERIFY_DEFINE(_cond, _MESS_FAILED(); TU_BREAKPOINT(), false)
+#define ASSERT_2ARGS(_cond, _ret) TU_VERIFY_DEFINE(_cond, _MESS_FAILED(); TU_BREAKPOINT(), _ret)
#define TU_ASSERT(...) GET_3RD_ARG(__VA_ARGS__, ASSERT_2ARGS, ASSERT_1ARGS)(__VA_ARGS__)
/*------------------------------------------------------------------*/
/* ASSERT Error
- * basically TU_VERIFY Error with verify_breakpoint() as handler
+ * basically TU_VERIFY Error with TU_BREAKPOINT() as handler
*------------------------------------------------------------------*/
-#define ASERT_ERR_1ARGS(_error) TU_VERIFY_ERR_DEF2(_error, verify_breakpoint())
-#define ASERT_ERR_2ARGS(_error, _ret) TU_VERIFY_ERR_DEF3(_error, verify_breakpoint(), _ret)
+#define ASERT_ERR_1ARGS(_error) TU_VERIFY_ERR_DEF2(_error, TU_BREAKPOINT())
+#define ASERT_ERR_2ARGS(_error, _ret) TU_VERIFY_ERR_DEF3(_error, TU_BREAKPOINT(), _ret)
#define TU_ASSERT_ERR(...) GET_3RD_ARG(__VA_ARGS__, ASERT_ERR_2ARGS, ASERT_ERR_1ARGS)(__VA_ARGS__)