From a4dc948a2e6b9bcfe985fdf6bc0500de5568fc23 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Sat, 8 Nov 2014 12:04:00 -0600 Subject: [PATCH] auto-sync --- firmware/controllers/error_handling.c | 6 +++--- firmware/hw_layer/stm32f4/mpu_util.cpp | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/firmware/controllers/error_handling.c b/firmware/controllers/error_handling.c index 7832237a01..940dbec0b9 100644 --- a/firmware/controllers/error_handling.c +++ b/firmware/controllers/error_handling.c @@ -38,11 +38,11 @@ void chDbgPanic3(const char *msg, const char * file, int line) { * low-level function is used here to reduce stack usage */ palWritePad(LED_ERROR_PORT, LED_ERROR_PIN, 1); - turnAllPinsOff(); + turnAllPinsOff(); #if EFI_HD44780_LCD lcdShowFatalMessage((char *) msg); #endif /* EFI_HD44780_LCD */ - + if (!main_loop_started) { print("fatal %s %s:%d\r\n", msg, file, line); chThdSleepSeconds(1); @@ -89,5 +89,5 @@ char *getWarninig(void) { void initErrorHandling(void) { initLogging(&logger, "error handling"); - msObjectInit(&warningStream, (uint8_t *)warningBuffer, WARNING_BUFFER_SIZE, 0); + msObjectInit(&warningStream, (uint8_t *) warningBuffer, WARNING_BUFFER_SIZE, 0); } diff --git a/firmware/hw_layer/stm32f4/mpu_util.cpp b/firmware/hw_layer/stm32f4/mpu_util.cpp index d9525eac97..e0bb9a0a36 100644 --- a/firmware/hw_layer/stm32f4/mpu_util.cpp +++ b/firmware/hw_layer/stm32f4/mpu_util.cpp @@ -184,7 +184,9 @@ void HardFaultVector(void) { #endif int cfsr = GET_CFSR(); - if (cfsr & 0x100) { + if (cfsr & 0x1) { + chDbgPanic3("H IACCVIOL", __FILE__, __LINE__); + } else if (cfsr & 0x100) { chDbgPanic3("H IBUSERR", __FILE__, __LINE__); } else if (cfsr & 0x20000) { chDbgPanic3("H INVSTATE", __FILE__, __LINE__);