diff --git a/firmware/controllers/system/efi_gpio.h b/firmware/controllers/system/efi_gpio.h index 8045df64a7..573755eadb 100644 --- a/firmware/controllers/system/efi_gpio.h +++ b/firmware/controllers/system/efi_gpio.h @@ -63,12 +63,17 @@ public: #if EFI_GPIO_HARDWARE ioportid_t port = 0; uint8_t pin = 0; - #if (BOARD_EXT_GPIOCHIPS > 0) - /* used for external pins */ - brain_pin_e brainPin; - bool ext; - #endif #endif /* EFI_GPIO_HARDWARE */ + +#if (EFI_GPIO_HARDWARE && (BOARD_EXT_GPIOCHIPS > 0)) + /* used for external pins */ + brain_pin_e brainPin; + bool ext; +#elif EFI_SIMULATOR || EFI_UNIT_TEST + // used for setMockState + brain_pin_e brainPin; +#endif /* EFI_GPIO_HARDWARE */ + int8_t currentLogicValue = INITIAL_PIN_STATE; /** * we track current pin status so that we do not touch the actual hardware if we want to write new pin bit @@ -137,7 +142,7 @@ public: class RegisteredOutputPin : public virtual OutputPin { public: RegisteredOutputPin(const char *registrationName, short pinOffset, short pinModeOffset); - void init(); + void init(DECLARE_ENGINE_PARAMETER_SIGNATURE); void unregister(); RegisteredOutputPin *next; private: diff --git a/unit_tests/engine_test_helper.cpp b/unit_tests/engine_test_helper.cpp index d7318df14e..dee0d037a3 100644 --- a/unit_tests/engine_test_helper.cpp +++ b/unit_tests/engine_test_helper.cpp @@ -52,7 +52,6 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType, configuration_callb unitTestWarningCodeState.clear(); - memset(&activeConfiguration, 0, sizeof(activeConfiguration)); enginePins.reset(); @@ -79,6 +78,8 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType, configuration_callb resetConfigurationExt(NULL, configurationCallback, engineType PASS_ENGINE_PARAMETER_SUFFIX); + enginePins.startPins(PASS_ENGINE_PARAMETER_SIGNATURE); + commonInitEngineController(NULL PASS_ENGINE_PARAMETER_SUFFIX); engineConfiguration->mafAdcChannel = EFI_ADC_10;