Skip to content

Commit 2883403

Browse files
authored
Merge pull request #3491 from Precidata/custom-breakpoint-function
Introduce CFG_TUSB_DEBUG_BREAKPOINT hook
2 parents e416a81 + 75adb35 commit 2883403

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/common/tusb_verify.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,13 @@
7373
#define TU_MESS_FAILED() do {} while (0)
7474
#endif
7575

76+
// Custom defined application function
77+
#ifdef CFG_TUSB_DEBUG_BREAKPOINT
78+
extern void CFG_TUSB_DEBUG_BREAKPOINT(void);
79+
#define TU_BREAKPOINT() CFG_TUSB_DEBUG_BREAKPOINT()
80+
7681
// Halt CPU (breakpoint) when hitting error, only apply for Cortex M3, M4, M7, M33. M55
77-
#if defined(__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__) || defined(__ARM_ARCH_8M_MAIN__) || defined(__ARM_ARCH_8_1M_MAIN__) || \
82+
#elif defined(__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__) || defined(__ARM_ARCH_8M_MAIN__) || defined(__ARM_ARCH_8_1M_MAIN__) || \
7883
defined(__ARM7M__) || defined (__ARM7EM__) || defined(__ARM8M_MAINLINE__) || defined(__ARM8EM_MAINLINE__)
7984
#define TU_BREAKPOINT() do { \
8085
volatile uint32_t* ARM_CM_DHCSR = ((volatile uint32_t*) 0xE000EDF0UL); /* Cortex M CoreDebug->DHCSR */ \

0 commit comments

Comments
 (0)