summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2014-03-17 17:32:28 +0700
committerhathach <[email protected]>2014-03-17 17:32:28 +0700
commitfe1b39e539adcee6be4b9b8637a13debc3f6811c (patch)
tree2561a8d9c9df41084da26b321ff89ee2d0f4c253
parent23aa7070df9b461954d232c25de023cc5228e2e2 (diff)
remove hardfault handler
-rw-r--r--boards/board.c94
-rw-r--r--tinyusb/osal/osal_none.h4
-rw-r--r--tinyusb/tusb.h6
3 files changed, 0 insertions, 104 deletions
diff --git a/boards/board.c b/boards/board.c
index 90afd59b8..06ed9f0fd 100644
--- a/boards/board.c
+++ b/boards/board.c
@@ -58,97 +58,3 @@ void check_failed(uint8_t *file, uint32_t line)
(void) file;
(void) line;
}
-
-#if 0
-
-/**
- * HardFault_HandlerAsm:
- * Alternative Hard Fault handler to help debug the reason for a fault.
- * To use, edit the vector table to reference this function in the HardFault vector
- * This code is suitable for Cortex-M3 and Cortex-M0 cores
- */
-
-// Use the 'naked' attribute so that C stacking is not used.
-__attribute__((naked))
-void HardFault_HandlerAsm(void){
- /*
- * Get the appropriate stack pointer, depending on our mode,
- * and use it as the parameter to the C handler. This function
- * will never return
- */
-
- __asm( ".syntax unified\n"
- "MOVS R0, #4 \n"
- "MOV R1, LR \n"
- "TST R0, R1 \n"
- "BEQ _MSP \n"
- "MRS R0, PSP \n"
- "B HardFault_HandlerC \n"
- "_MSP: \n"
- "MRS R0, MSP \n"
- "B HardFault_HandlerC \n"
- ".syntax divided\n") ;
-}
-
-/**
- * HardFaultHandler_C:
- * This is called from the HardFault_HandlerAsm with a pointer the Fault stack
- * as the parameter. We can then read the values from the stack and place them
- * into local variables for ease of reading.
- * We then read the various Fault Status and Address Registers to help decode
- * cause of the fault.
- * The function ends with a BKPT instruction to force control back into the debugger
- */
-void HardFault_HandlerC(unsigned long *hardfault_args){
- ATTR_UNUSED volatile unsigned long stacked_r0 ;
- ATTR_UNUSED volatile unsigned long stacked_r1 ;
- ATTR_UNUSED volatile unsigned long stacked_r2 ;
- ATTR_UNUSED volatile unsigned long stacked_r3 ;
- ATTR_UNUSED volatile unsigned long stacked_r12 ;
- ATTR_UNUSED volatile unsigned long stacked_lr ;
- ATTR_UNUSED volatile unsigned long stacked_pc ;
- ATTR_UNUSED volatile unsigned long stacked_psr ;
- ATTR_UNUSED volatile unsigned long _CFSR ;
- ATTR_UNUSED volatile unsigned long _HFSR ;
- ATTR_UNUSED volatile unsigned long _DFSR ;
- ATTR_UNUSED volatile unsigned long _AFSR ;
- ATTR_UNUSED volatile unsigned long _BFAR ;
- ATTR_UNUSED volatile unsigned long _MMAR ;
-
- stacked_r0 = ((unsigned long)hardfault_args[0]) ;
- stacked_r1 = ((unsigned long)hardfault_args[1]) ;
- stacked_r2 = ((unsigned long)hardfault_args[2]) ;
- stacked_r3 = ((unsigned long)hardfault_args[3]) ;
- stacked_r12 = ((unsigned long)hardfault_args[4]) ;
- stacked_lr = ((unsigned long)hardfault_args[5]) ;
- stacked_pc = ((unsigned long)hardfault_args[6]) ;
- stacked_psr = ((unsigned long)hardfault_args[7]) ;
-
- // Configurable Fault Status Register
- // Consists of MMSR, BFSR and UFSR
- _CFSR = (*((volatile unsigned long *)(0xE000ED28))) ;
-
- // Hard Fault Status Register
- _HFSR = (*((volatile unsigned long *)(0xE000ED2C))) ;
-
- // Debug Fault Status Register
- _DFSR = (*((volatile unsigned long *)(0xE000ED30))) ;
-
- // Auxiliary Fault Status Register
- _AFSR = (*((volatile unsigned long *)(0xE000ED3C))) ;
-
- // Read the Fault Address Registers. These may not contain valid values.
- // Check BFARVALID/MMARVALID to see if they are valid values
- // MemManage Fault Address Register
- _MMAR = (*((volatile unsigned long *)(0xE000ED34))) ;
- // Bus Fault Address Register
- _BFAR = (*((volatile unsigned long *)(0xE000ED38))) ;
-
-// if ((CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk)==CoreDebug_DHCSR_C_DEBUGEN_Msk) /* if there is debugger connected */
-// {
-// __asm("BKPT #0\n");
-// }
-
- hal_debugger_breakpoint();
-}
-#endif
diff --git a/tinyusb/osal/osal_none.h b/tinyusb/osal/osal_none.h
index f81e86231..0d4bee1b1 100644
--- a/tinyusb/osal/osal_none.h
+++ b/tinyusb/osal/osal_none.h
@@ -108,7 +108,6 @@ uint32_t tusb_tick_get(void);
//--------------------------------------------------------------------+
// SUBTASK (a sub function that uses OS blocking services & called by a task
//--------------------------------------------------------------------+
-//------------- Sub Task -------------//
#define OSAL_SUBTASK_INVOKED_AND_WAIT(subtask, status) \
do {\
state = __LINE__; case __LINE__:\
@@ -315,9 +314,6 @@ static inline void osal_queue_flush(osal_queue_handle_t const queue_hdl)
}\
}while(0)
-
-// queue_send, queue_receive
-
#ifdef __cplusplus
}
#endif
diff --git a/tinyusb/tusb.h b/tinyusb/tusb.h
index 2630729b6..38c021751 100644
--- a/tinyusb/tusb.h
+++ b/tinyusb/tusb.h
@@ -36,12 +36,6 @@
*/
/**************************************************************************/
-/** \file
- * \brief Tiny USB header
- *
- * \note Tiny USB header Note
- */
-
#ifndef _TUSB_H_
#define _TUSB_H_