only:boardAfterTuneDefaults this is all a mess

This commit is contained in:
rusefillc 2025-01-13 15:08:33 -05:00 committed by rusefi
parent 8052d73e3a
commit b34b5aacfc
2 changed files with 7 additions and 4 deletions

View File

@ -119,7 +119,7 @@ void onBurnRequest() {
* this hook is about https://github.com/rusefi/rusefi/wiki/Custom-Firmware and https://github.com/rusefi/rusefi/wiki/Canned-Tune-Process * this hook is about https://github.com/rusefi/rusefi/wiki/Custom-Firmware and https://github.com/rusefi/rusefi/wiki/Canned-Tune-Process
* todo: why two hooks? is one already dead? * todo: why two hooks? is one already dead?
*/ */
PUBLIC_API_WEAK void boardTuneDefaults() { } PUBLIC_API_WEAK void boardBeforeTuneDefaults() { }
// Weak link a stub so that every board doesn't have to implement this function // Weak link a stub so that every board doesn't have to implement this function
PUBLIC_API_WEAK void boardOnConfigurationChange(engine_configuration_s* /*previousConfiguration*/) { } PUBLIC_API_WEAK void boardOnConfigurationChange(engine_configuration_s* /*previousConfiguration*/) { }
@ -678,7 +678,7 @@ void resetConfigurationExt(configuration_callback_t boardCallback, engine_type_e
/** /**
* custom board engine defaults. Yes, this overlaps with (older) engine_type_e approach. * custom board engine defaults. Yes, this overlaps with (older) engine_type_e approach.
*/ */
boardTuneDefaults(); boardBeforeTuneDefaults();
// set initial pin groups // set initial pin groups
setDefaultBasePins(); setDefaultBasePins();

View File

@ -53,10 +53,12 @@ static_assert(libPROTEUS_STIM_QC == (int)engine_type_e::PROTEUS_STIM_QC);
static_assert(libHELLEN_2CHAN_STIM_QC == (int)engine_type_e::HELLEN_2CHAN_STIM_QC); static_assert(libHELLEN_2CHAN_STIM_QC == (int)engine_type_e::HELLEN_2CHAN_STIM_QC);
static_assert(libHELLEN_4CHAN_STIM_QC == (int)engine_type_e::HELLEN_4CHAN_STIM_QC); static_assert(libHELLEN_4CHAN_STIM_QC == (int)engine_type_e::HELLEN_4CHAN_STIM_QC);
PUBLIC_API_WEAK_SOMETHING_WEIRD void applyEngineTypeExt(engine_type_e engineType) { PUBLIC_API_WEAK_SOMETHING_WEIRD void applyUnknownEngineType(engine_type_e engineType) {
firmwareError(ObdCode::CUSTOM_UNEXPECTED_ENGINE_TYPE, "Unexpected engine type: %d", (int)engineType); firmwareError(ObdCode::CUSTOM_UNEXPECTED_ENGINE_TYPE, "Unexpected engine type: %d", (int)engineType);
} }
PUBLIC_API_WEAK void boardAfterTuneDefaults(engine_type_e engineType) { }
void applyEngineType(engine_type_e engineType) { void applyEngineType(engine_type_e engineType) {
/** /**
* And override them with engine-specific defaults * And override them with engine-specific defaults
@ -417,8 +419,9 @@ void applyEngineType(engine_type_e engineType) {
break; break;
#endif //HW_SUBARU_EG33 #endif //HW_SUBARU_EG33
default: default:
applyEngineTypeExt(engineType); applyUnknownEngineType(engineType);
} }
boardAfterTuneDefaults(engineType);
} }
PUBLIC_API_WEAK_SOMETHING_WEIRD engine_type_e getLastEngineType() { PUBLIC_API_WEAK_SOMETHING_WEIRD engine_type_e getLastEngineType() {