From 74e6e184df96ab1324dc4e136a67e7545a38b60c Mon Sep 17 00:00:00 2001 From: Andrey Gusakov Date: Sat, 24 Jun 2023 18:07:16 -0400 Subject: [PATCH] Stashed --- firmware/controllers/core/error_handling.cpp | 5 +++++ firmware/hw_layer/ports/stm32/stm32f4/cfg/halconf.h | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/firmware/controllers/core/error_handling.cpp b/firmware/controllers/core/error_handling.cpp index d3fbd92308..499da0e728 100644 --- a/firmware/controllers/core/error_handling.cpp +++ b/firmware/controllers/core/error_handling.cpp @@ -28,6 +28,8 @@ const char* getCriticalErrorMessage(void) { void checkLastBootError() { #if EFI_BACKUP_SRAM auto sramState = getBackupSram(); + if (sramState == NULL) + return; switch (sramState->Cookie) { case ErrorCookie::FirmwareError: @@ -82,6 +84,9 @@ void logHardFault(uint32_t type, uintptr_t faultAddress, port_extctx* ctx, uint3 TURN_FATAL_LED(); #if EFI_BACKUP_SRAM auto sramState = getBackupSram(); + if (sramState == NULL) + return; + sramState->Cookie = ErrorCookie::HardFault; sramState->FaultType = type; sramState->FaultAddress = faultAddress; diff --git a/firmware/hw_layer/ports/stm32/stm32f4/cfg/halconf.h b/firmware/hw_layer/ports/stm32/stm32f4/cfg/halconf.h index 2584ab0f91..7818e43b46 100644 --- a/firmware/hw_layer/ports/stm32/stm32f4/cfg/halconf.h +++ b/firmware/hw_layer/ports/stm32/stm32f4/cfg/halconf.h @@ -31,8 +31,6 @@ #define _CHIBIOS_HAL_CONF_ #define _CHIBIOS_HAL_CONF_VER_7_1_ -#include "mcuconf.h" - #include "rusefi_halconf.h" #include "../../cfg/halconf_community.h"