mirror of https://github.com/rusefi/rusefi.git
move causeHardFault() to arm_common.cpp
This commit is contained in:
parent
08b6c3e25a
commit
04779c374f
|
@ -15,6 +15,7 @@ HW_LAYER_CPP = \
|
|||
$(PROJECT_DIR)/hw_layer/digital_input/trigger/trigger_input_exti.cpp \
|
||||
$(PROJECT_DIR)/hw_layer/digital_input/trigger/trigger_input_adc.cpp \
|
||||
$(PROJECT_DIR)/hw_layer/hardware.cpp \
|
||||
$(PROJECT_DIR)/hw_layer/ports/arm_common.cpp \
|
||||
$(PROJECT_DIR)/hw_layer/kline.cpp \
|
||||
$(PROJECT_DIR)/hw_layer/mmc_card.cpp \
|
||||
$(PROJECT_DIR)/hw_layer/adc/adc_inputs.cpp \
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
/**
|
||||
* @file arm_common.cpp
|
||||
* @brief Low level common ARM code
|
||||
*
|
||||
* @date Nov 14, 2023
|
||||
* @author Andrey Belomutskiy, (c) 2012-2023
|
||||
* @author andreika <prometheus.pcb@gmail.com>
|
||||
*/
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
#include "mpu_util.h"
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
void causeHardFault() {
|
||||
#if EFI_PROD_CODE
|
||||
// Set the function pointer to an invalid address
|
||||
void (*invalidFunction)() = (void(*)())0xDEADBEEF;
|
||||
// Calling the invalid function will trigger a hard fault
|
||||
invalidFunction();
|
||||
#endif /* EFI_PROD_CODE */
|
||||
}
|
|
@ -138,13 +138,6 @@ void baseMCUInit(void) {
|
|||
BOR_Set(BOR_Level_1); // one step above default value
|
||||
}
|
||||
|
||||
void causeHardFault() {
|
||||
// Set the function pointer to an invalid address
|
||||
void (*invalidFunction)() = (void(*)())0xDEADBEEF;
|
||||
// Calling the invalid function will trigger a hard fault
|
||||
invalidFunction();
|
||||
}
|
||||
|
||||
/* used to detect additional RAM available for LUA
|
||||
* TODO: find RAM on AT32
|
||||
* TODO: better name */
|
||||
|
|
|
@ -24,13 +24,6 @@ extern "C" {
|
|||
void baseMCUInit(void) {
|
||||
}
|
||||
|
||||
void causeHardFault() {
|
||||
// Set the function pointer to an invalid address
|
||||
void (*invalidFunction)() = (void(*)())0xDEADBEEF;
|
||||
// Calling the invalid function will trigger a hard fault
|
||||
invalidFunction();
|
||||
}
|
||||
|
||||
void _unhandled_exception(void) {
|
||||
/*lint -restore*/
|
||||
|
||||
|
|
|
@ -16,13 +16,6 @@
|
|||
void baseMCUInit(void) {
|
||||
}
|
||||
|
||||
void causeHardFault() {
|
||||
// Set the function pointer to an invalid address
|
||||
void (*invalidFunction)() = (void(*)())0xDEADBEEF;
|
||||
// Calling the invalid function will trigger a hard fault
|
||||
invalidFunction();
|
||||
}
|
||||
|
||||
void _unhandled_exception(void) {
|
||||
/*lint -restore*/
|
||||
|
||||
|
|
|
@ -110,15 +110,6 @@ void baseMCUInit(void) {
|
|||
BOR_Set(BOR_Level_1); // one step above default value
|
||||
}
|
||||
|
||||
void causeHardFault() {
|
||||
#if EFI_PROD_CODE
|
||||
// Set the function pointer to an invalid address
|
||||
void (*invalidFunction)() = (void(*)())0xDEADBEEF;
|
||||
// Calling the invalid function will trigger a hard fault
|
||||
invalidFunction();
|
||||
#endif /* EFI_PROD_CODE */
|
||||
}
|
||||
|
||||
extern uint32_t __main_stack_base__;
|
||||
|
||||
typedef struct port_intctx intctx_t;
|
||||
|
|
Loading…
Reference in New Issue