diff options
| author | hathach <[email protected]> | 2018-04-16 13:46:28 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-04-16 13:46:28 +0700 |
| commit | 6f7c4346c39bd57014e95b577255c3870a5979c6 (patch) | |
| tree | e8a3f3a039637934aa5c9916725c8d1e3c1cba1c /tinyusb/common | |
| parent | 29071c10b1e2f2574afb310a7197d599a25cd362 (diff) | |
add tud_set_descriptors
Diffstat (limited to 'tinyusb/common')
| -rw-r--r-- | tinyusb/common/tusb_common.h | 9 | ||||
| -rw-r--r-- | tinyusb/common/tusb_verify.h | 13 |
2 files changed, 8 insertions, 14 deletions
diff --git a/tinyusb/common/tusb_common.h b/tinyusb/common/tusb_common.h index b45027c44..2ac0e2e8b 100644 --- a/tinyusb/common/tusb_common.h +++ b/tinyusb/common/tusb_common.h @@ -106,13 +106,10 @@ // INLINE FUNCTION
//--------------------------------------------------------------------+
#define memclr_(buffer, size) memset((buffer), 0, (size))
+#define varclr_(_var) memclr_(_var, sizeof(*(_var)))
+#define arrclr_(_arr) memclr_(_arr, sizeof(_arr))
-
-#define memclr(buffer, size) memset(buffer, 0, size)
-#define varclr(_var) memclr(_var, sizeof(*(_var)))
-#define arrclr(_arr) memclr(_arr, sizeof(_arr))
-
-#define arrcount(_arr) ( sizeof(_arr) / sizeof(_arr[0]) )
+#define arrcount_(_arr) ( sizeof(_arr) / sizeof(_arr[0]) )
static inline uint8_t const * descriptor_next(uint8_t const p_desc[])
{
diff --git a/tinyusb/common/tusb_verify.h b/tinyusb/common/tusb_verify.h index 6e530fe79..0a7d22419 100644 --- a/tinyusb/common/tusb_verify.h +++ b/tinyusb/common/tusb_verify.h @@ -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() |
