clean up unused files
This commit is contained in:
		@@ -1,60 +0,0 @@
 | 
			
		||||
/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * The information contained herein is property of Nordic Semiconductor ASA.
 | 
			
		||||
 * Terms and conditions of usage are described in detail in NORDIC
 | 
			
		||||
 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
 | 
			
		||||
 *
 | 
			
		||||
 * Licensees are granted free, non-transferable use of the information. NO
 | 
			
		||||
 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
 | 
			
		||||
 * the file.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
#ifndef HARFAULT_H__
 | 
			
		||||
#define HARFAULT_H__
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
#include <stddef.h>
 | 
			
		||||
/**
 | 
			
		||||
 * @defgroup hardfault_default HardFault exception
 | 
			
		||||
 * @{
 | 
			
		||||
 * @brief Default HardFault exception implementation.
 | 
			
		||||
 * @ingroup app_common
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Contents of the stack.
 | 
			
		||||
 *
 | 
			
		||||
 * This structure is used to re-create the stack layout after a HardFault exception was raised.
 | 
			
		||||
 */
 | 
			
		||||
typedef struct HardFault_stack
 | 
			
		||||
{
 | 
			
		||||
    uint32_t r0;  ///< R0 register.
 | 
			
		||||
    uint32_t r1;  ///< R1 register.
 | 
			
		||||
    uint32_t r2;  ///< R2 register.
 | 
			
		||||
    uint32_t r3;  ///< R3 register.
 | 
			
		||||
    uint32_t r12; ///< R12 register.
 | 
			
		||||
    uint32_t lr;  ///< Link register.
 | 
			
		||||
    uint32_t pc;  ///< Program counter.
 | 
			
		||||
    uint32_t psr; ///< Program status register.
 | 
			
		||||
}HardFault_stack_t;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Function for processing HardFault exceptions.
 | 
			
		||||
 *
 | 
			
		||||
 * An application that needs to process HardFault exceptions should provide an implementation of this function.
 | 
			
		||||
 * It will be called from the HardFault handler.
 | 
			
		||||
 * If no implementation is provided, the library uses a default one, which just restarts the MCU.
 | 
			
		||||
 *
 | 
			
		||||
 * @note If the DEBUG_NRF macro is defined, the software breakpoint is set just before the call 
 | 
			
		||||
 *       to this function.
 | 
			
		||||
 *
 | 
			
		||||
 * @param p_stack Pointer to the stack bottom.
 | 
			
		||||
 *                This pointer might be NULL if the HardFault was called when the main stack was
 | 
			
		||||
 *                the active stack and a stack overrun is detected.
 | 
			
		||||
 *                In such a situation, the stack pointer is reinitialized to the default position,
 | 
			
		||||
 *                and the stack content is lost.
 | 
			
		||||
 */
 | 
			
		||||
void HardFault_process(HardFault_stack_t *p_stack);
 | 
			
		||||
 | 
			
		||||
/** @} */
 | 
			
		||||
#endif /* HARFAULT_H__ */
 | 
			
		||||
 | 
			
		||||
@@ -1,47 +0,0 @@
 | 
			
		||||
/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * The information contained herein is property of Nordic Semiconductor ASA.
 | 
			
		||||
 * Terms and conditions of usage are described in detail in NORDIC
 | 
			
		||||
 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
 | 
			
		||||
 *
 | 
			
		||||
 * Licensees are granted free, non-transferable use of the information. NO
 | 
			
		||||
 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
 | 
			
		||||
 * the file.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
#include "hardfault.h"
 | 
			
		||||
#include "nrf.h"
 | 
			
		||||
#include "compiler_abstraction.h"
 | 
			
		||||
#include "nordic_common.h"
 | 
			
		||||
#ifdef SOFTDEVICE_PRESENT
 | 
			
		||||
#include "nrf_soc.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(DEBUG_NRF)
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Pointer to the last received stack pointer.
 | 
			
		||||
 *
 | 
			
		||||
 * This pointer is set in the debug version of the HardFault handler.
 | 
			
		||||
 * It helps to debug HardFault reasons.
 | 
			
		||||
 */
 | 
			
		||||
volatile HardFault_stack_t *HardFault_p_stack;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*lint -save -e14 */
 | 
			
		||||
__WEAK void HardFault_process(HardFault_stack_t *p_stack)
 | 
			
		||||
{
 | 
			
		||||
    // Restart the system by default
 | 
			
		||||
    NVIC_SystemReset();
 | 
			
		||||
}
 | 
			
		||||
/*lint -restore */
 | 
			
		||||
 | 
			
		||||
void HardFault_c_handler( uint32_t *p_stack_address )
 | 
			
		||||
{
 | 
			
		||||
#if defined(DEBUG_NRF)
 | 
			
		||||
    HardFault_p_stack = (HardFault_stack_t*)p_stack_address;
 | 
			
		||||
    /* Generate breakpoint if debugger is connected */
 | 
			
		||||
    __BKPT(0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    HardFault_process((HardFault_stack_t*)p_stack_address);
 | 
			
		||||
}
 | 
			
		||||
@@ -1,49 +0,0 @@
 | 
			
		||||
/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * The information contained herein is property of Nordic Semiconductor ASA.
 | 
			
		||||
 * Terms and conditions of usage are described in detail in NORDIC
 | 
			
		||||
 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
 | 
			
		||||
 *
 | 
			
		||||
 * Licensees are granted free, non-transferable use of the information. NO
 | 
			
		||||
 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
 | 
			
		||||
 * the file.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
 | 
			
		||||
void HardFault_Handler(void) __attribute__(( naked ));
 | 
			
		||||
 | 
			
		||||
void HardFault_Handler(void)
 | 
			
		||||
{
 | 
			
		||||
    __asm volatile(
 | 
			
		||||
    "   ldr r3, =HardFault_c_handler            \n"
 | 
			
		||||
    "   tst lr, #4                              \n"
 | 
			
		||||
 | 
			
		||||
    /* PSP is quite simple and does not require additional handler */
 | 
			
		||||
    "   itt ne                                  \n"
 | 
			
		||||
    "   mrsne r0, psp                           \n"
 | 
			
		||||
    /* Jump to the handler, do not store LR - returning from handler just exits exception */
 | 
			
		||||
    "   bxne  r3                                \n"
 | 
			
		||||
 | 
			
		||||
    /* Processing MSP requires stack checking */
 | 
			
		||||
    "   mrs r0, msp                             \n"
 | 
			
		||||
 | 
			
		||||
    "   ldr   r1, =__StackTop                   \n"
 | 
			
		||||
    "   ldr   r2, =__StackLimit                 \n"
 | 
			
		||||
 | 
			
		||||
    /* MSP is in the range of <__StackTop, __StackLimit) */
 | 
			
		||||
    "   cmp   r0, r1                            \n"
 | 
			
		||||
    "   bhi   HardFault_MoveSP                  \n"
 | 
			
		||||
    "   cmp   r0, r2                            \n"
 | 
			
		||||
    "   bhi   HardFault_Handler_Continue        \n"
 | 
			
		||||
 | 
			
		||||
    "HardFault_MoveSP:                          \n"
 | 
			
		||||
    "   mov   sp, r1                            \n"
 | 
			
		||||
    "   mov   r0, #0                            \n"
 | 
			
		||||
 | 
			
		||||
    "HardFault_Handler_Continue:                \n"
 | 
			
		||||
    "   bx r3                                   \n"
 | 
			
		||||
 | 
			
		||||
    "   .align                                  \n"
 | 
			
		||||
    );
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user