From 0af637cd4f3463f175dc4fbd47ded3abd5f53cd5 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 9 Mar 2018 23:04:53 +0700 Subject: clean up hal debugger --- tinyusb/tusb_hal.h | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) (limited to 'tinyusb') diff --git a/tinyusb/tusb_hal.h b/tinyusb/tusb_hal.h index 1dc905dc9..7560d6ff6 100644 --- a/tinyusb/tusb_hal.h +++ b/tinyusb/tusb_hal.h @@ -53,9 +53,6 @@ extern "C" { #include "common/tusb_errors.h" #include "common/compiler/compiler.h" -// from mcu port -#include "hal_tusb.h" - //--------------------------------------------------------------------+ // HAL API //--------------------------------------------------------------------+ @@ -87,30 +84,8 @@ void hal_usb_int_enable(uint8_t port); */ void hal_usb_int_disable(uint8_t port); - - - -static inline bool hal_debugger_is_attached(void) -{ -// TODO check core M3/M4 defined instead -#if !defined(_TEST_) && !(TUSB_CFG_MCU==MCU_LPC11UXX) - return ( (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) == CoreDebug_DHCSR_C_DEBUGEN_Msk ); -#elif TUSB_CFG_DEBUG == 3 - return true; // force to break into breakpoint with debug = 3 -#else - return false; -#endif -} - -static inline void hal_debugger_breakpoint(void) -{ -#ifndef _TEST_ - if (hal_debugger_is_attached()) /* if there is debugger connected */ - { - __asm("BKPT #0\n"); - } -#endif -} +// for debug only, halt mcu if assert/verify is failed if debugger is attached +void hal_debugger_breakpoint(void); #ifdef __cplusplus } -- cgit v1.3.1