add tud_set_descriptors

This commit is contained in:
hathach
2018-04-16 13:46:28 +07:00
parent 29071c10b1
commit 6f7c4346c3
16 changed files with 103 additions and 65 deletions

View File

@@ -71,14 +71,11 @@
// Halt CPU (breakpoint) when hitting error, only apply for Cortex M3, M4, M7
#if defined(__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__)
static inline void verify_breakpoint(void)
{
// Cortex M CoreDebug->DHCSR
volatile uint32_t* ARM_CM_DHCSR = ((volatile uint32_t*) 0xE000EDF0UL);
// Only halt mcu if debugger is attached
if ( (*ARM_CM_DHCSR) & 1UL ) __asm("BKPT #0\n");
}
#define verify_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()