EFI_CONFIGURATION_STORAGE reducing code duplication
This commit is contained in:
parent
217546b02d
commit
944a9375d3
|
@ -66,7 +66,7 @@
|
||||||
#include "periodic_task.h"
|
#include "periodic_task.h"
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
|
|
||||||
#if (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE)
|
#if EFI_CONFIGURATION_STORAGE
|
||||||
#include "flash_main.h"
|
#include "flash_main.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -306,10 +306,10 @@ extern int totalLoggedBytes;
|
||||||
} else if (consoleByteArrived) {
|
} else if (consoleByteArrived) {
|
||||||
offTimeMs = 100;
|
offTimeMs = 100;
|
||||||
onTimeMs = 33;
|
onTimeMs = 33;
|
||||||
#if (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE)
|
#if EFI_CONFIGURATION_STORAGE
|
||||||
} else if (getNeedToWriteConfiguration()) {
|
} else if (getNeedToWriteConfiguration()) {
|
||||||
offTimeMs = onTimeMs = 500;
|
offTimeMs = onTimeMs = 500;
|
||||||
#endif /* (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE) */
|
#endif /* EFI_CONFIGURATION_STORAGE */
|
||||||
} else {
|
} else {
|
||||||
onTimeMs =
|
onTimeMs =
|
||||||
#if EFI_USB_SERIAL
|
#if EFI_USB_SERIAL
|
||||||
|
@ -609,9 +609,9 @@ static void updateFlags() {
|
||||||
engine->outputChannels.isTriggerError = isTriggerErrorNow();
|
engine->outputChannels.isTriggerError = isTriggerErrorNow();
|
||||||
#endif // EFI_PROD_CODE
|
#endif // EFI_PROD_CODE
|
||||||
|
|
||||||
#if (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE)
|
#if EFI_CONFIGURATION_STORAGE
|
||||||
engine->outputChannels.needBurn = getNeedToWriteConfiguration();
|
engine->outputChannels.needBurn = getNeedToWriteConfiguration();
|
||||||
#endif /* (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE) */
|
#endif /* EFI_CONFIGURATION_STORAGE */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void updateWarningCodes() {
|
static void updateWarningCodes() {
|
||||||
|
|
|
@ -662,7 +662,7 @@ void loadConfiguration() {
|
||||||
#endif /* EFI_ACTIVE_CONFIGURATION_IN_FLASH */
|
#endif /* EFI_ACTIVE_CONFIGURATION_IN_FLASH */
|
||||||
|
|
||||||
/* If board have any storage */
|
/* If board have any storage */
|
||||||
#if (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE)
|
#if EFI_CONFIGURATION_STORAGE
|
||||||
if (IGNORE_FLASH_CONFIGURATION) {
|
if (IGNORE_FLASH_CONFIGURATION) {
|
||||||
engineConfiguration->engineType = DEFAULT_ENGINE_TYPE;
|
engineConfiguration->engineType = DEFAULT_ENGINE_TYPE;
|
||||||
resetConfigurationExt(engineConfiguration->engineType);
|
resetConfigurationExt(engineConfiguration->engineType);
|
||||||
|
@ -676,7 +676,7 @@ void loadConfiguration() {
|
||||||
// This board doesn't load configuration, initialize the default
|
// This board doesn't load configuration, initialize the default
|
||||||
engineConfiguration->engineType = DEFAULT_ENGINE_TYPE;
|
engineConfiguration->engineType = DEFAULT_ENGINE_TYPE;
|
||||||
resetConfigurationExt(engineConfiguration->engineType);
|
resetConfigurationExt(engineConfiguration->engineType);
|
||||||
#endif /* (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE) */
|
#endif /* EFI_CONFIGURATION_STORAGE */
|
||||||
|
|
||||||
// Force any board configuration options that humans shouldn't be able to change
|
// Force any board configuration options that humans shouldn't be able to change
|
||||||
setBoardConfigOverrides();
|
setBoardConfigOverrides();
|
||||||
|
|
|
@ -463,9 +463,9 @@ static void handleCommandX14(uint16_t index) {
|
||||||
return;
|
return;
|
||||||
case TS_WRITE_FLASH:
|
case TS_WRITE_FLASH:
|
||||||
// cmd_write_config
|
// cmd_write_config
|
||||||
#if (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE)
|
#if EFI_CONFIGURATION_STORAGE
|
||||||
writeToFlashNow();
|
writeToFlashNow();
|
||||||
#endif /* (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE) */
|
#endif /* EFI_CONFIGURATION_STORAGE */
|
||||||
return;
|
return;
|
||||||
case TS_TRIGGER_STIMULATOR_ENABLE:
|
case TS_TRIGGER_STIMULATOR_ENABLE:
|
||||||
#if EFI_EMULATE_POSITION_SENSORS == TRUE
|
#if EFI_EMULATE_POSITION_SENSORS == TRUE
|
||||||
|
@ -517,12 +517,10 @@ static void handleCommandX14(uint16_t index) {
|
||||||
benchSemaphore.signal();
|
benchSemaphore.signal();
|
||||||
return;
|
return;
|
||||||
case TS_BURN_WITHOUT_FLASH:
|
case TS_BURN_WITHOUT_FLASH:
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE && EFI_CONFIGURATION_STORAGE
|
||||||
#if (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE)
|
|
||||||
extern bool burnWithoutFlash;
|
extern bool burnWithoutFlash;
|
||||||
burnWithoutFlash = true;
|
burnWithoutFlash = true;
|
||||||
#endif /* (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE) */
|
#endif /* EFI_PROD_CODE && EFI_CONFIGURATION_STORAGE */
|
||||||
#endif // EFI_PROD_CODE
|
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
criticalError("Unexpected bench x14 %d", index);
|
criticalError("Unexpected bench x14 %d", index);
|
||||||
|
|
|
@ -217,9 +217,9 @@ static void doPeriodicSlowCallback() {
|
||||||
#endif /* EFI_CONFIGURATION_STORAGE */
|
#endif /* EFI_CONFIGURATION_STORAGE */
|
||||||
}
|
}
|
||||||
#else /* if EFI_SHAFT_POSITION_INPUT */
|
#else /* if EFI_SHAFT_POSITION_INPUT */
|
||||||
#if (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE)
|
#if EFI_CONFIGURATION_STORAGE
|
||||||
writeToFlashIfPending();
|
writeToFlashIfPending();
|
||||||
#endif /* (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE) */
|
#endif /* EFI_CONFIGURATION_STORAGE */
|
||||||
#endif /* EFI_SHAFT_POSITION_INPUT */
|
#endif /* EFI_SHAFT_POSITION_INPUT */
|
||||||
|
|
||||||
#if EFI_TCU
|
#if EFI_TCU
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
|
||||||
/* If any setting storage is exist */
|
/* If any setting storage is exist */
|
||||||
#if (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE)
|
#if EFI_CONFIGURATION_STORAGE
|
||||||
|
|
||||||
#include "mpu_util.h"
|
#include "mpu_util.h"
|
||||||
#include "flash_main.h"
|
#include "flash_main.h"
|
||||||
|
@ -367,4 +367,4 @@ void initFlash() {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE) */
|
#endif /* EFI_CONFIGURATION_STORAGE */
|
||||||
|
|
|
@ -31,9 +31,9 @@
|
||||||
#include "electronic_throttle.h"
|
#include "electronic_throttle.h"
|
||||||
#endif // EFI_ELECTRONIC_THROTTLE_BODY
|
#endif // EFI_ELECTRONIC_THROTTLE_BODY
|
||||||
|
|
||||||
#if (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE)
|
#if EFI_CONFIGURATION_STORAGE
|
||||||
#include "flash_main.h"
|
#include "flash_main.h"
|
||||||
#endif /* (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE) */
|
#endif // EFI_CONFIGURATION_STORAGE
|
||||||
|
|
||||||
#if EFI_ENGINE_SNIFFER
|
#if EFI_ENGINE_SNIFFER
|
||||||
#include "engine_sniffer.h"
|
#include "engine_sniffer.h"
|
||||||
|
@ -951,11 +951,11 @@ void setEngineType(int value, bool isWriteToFlash) {
|
||||||
resetConfigurationExt((engine_type_e)value);
|
resetConfigurationExt((engine_type_e)value);
|
||||||
engine->resetEngineSnifferIfInTestMode();
|
engine->resetEngineSnifferIfInTestMode();
|
||||||
|
|
||||||
#if (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE)
|
#if EFI_CONFIGURATION_STORAGE
|
||||||
if (isWriteToFlash) {
|
if (isWriteToFlash) {
|
||||||
writeToFlashNow();
|
writeToFlashNow();
|
||||||
}
|
}
|
||||||
#endif /* (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE) */
|
#endif /* EFI_CONFIGURATION_STORAGE */
|
||||||
}
|
}
|
||||||
incrementGlobalConfigurationVersion("engineType");
|
incrementGlobalConfigurationVersion("engineType");
|
||||||
#if EFI_ENGINE_CONTROL && ! EFI_UNIT_TEST
|
#if EFI_ENGINE_CONTROL && ! EFI_UNIT_TEST
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
#include "map_averaging.h"
|
#include "map_averaging.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE)
|
#if EFI_CONFIGURATION_STORAGE
|
||||||
#include "flash_main.h"
|
#include "flash_main.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -496,7 +496,7 @@ void initHardwareNoConfig() {
|
||||||
initRtc();
|
initRtc();
|
||||||
#endif // EFI_PROD_CODE && EFI_RTC
|
#endif // EFI_PROD_CODE && EFI_RTC
|
||||||
|
|
||||||
#if (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE)
|
#if EFI_CONFIGURATION_STORAGE
|
||||||
initFlash();
|
initFlash();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue