diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 8abae976e0..193c0cf429 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -143,6 +143,18 @@ static void initTemperatureCurve(int size, float *bins, float *values) { } } +void prepareVoidConfiguration(engine_configuration_s *activeConfiguration) { + memset(activeConfiguration, 0xFF, sizeof(engine_configuration_s)); + board_configuration_s *boardConfiguration = &activeConfiguration->bc; + + /** + * -1 everywhere is probably good, but explicit values are probably better. Too bad GPIO_UNASSIGNED is not zero :( + */ + boardConfiguration->triggerInputPins[0] = GPIO_UNASSIGNED; + boardConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED; + boardConfiguration->triggerInputPins[2] = GPIO_UNASSIGNED; +} + /** * @brief Global default engine configuration * This method sets the default global engine configuration. These values are later overridden by engine-specific defaults diff --git a/firmware/controllers/algo/engine_configuration.h b/firmware/controllers/algo/engine_configuration.h index 11cbd197a6..2987429875 100644 --- a/firmware/controllers/algo/engine_configuration.h +++ b/firmware/controllers/algo/engine_configuration.h @@ -45,6 +45,7 @@ typedef struct { crc_t value; } persistent_config_container_s; +void prepareVoidConfiguration(engine_configuration_s *activeConfiguration); void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F); void setMap(fuel_table_t table, float value); void setWholeFuelMap(float value DECLARE_ENGINE_PARAMETER_S); diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 3464eb797c..86075af3d3 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -189,6 +189,8 @@ void runRusEfi(void) { swo_init(); + prepareVoidConfiguration(&activeConfiguration); + /** * First data structure keeps track of which hardware I/O pins are used by whom */ @@ -288,5 +290,5 @@ int getRusEfiVersion(void) { return 123; // this is here to make the compiler happy about the unused array if (UNUSED_CCM_SIZE[0] * 0 != 0) return 3211; // this is here to make the compiler happy about the unused array - return 20150407; + return 20150408; }