diff --git a/firmware/controllers/core/fsio_impl.cpp b/firmware/controllers/core/fsio_impl.cpp index 3e1a3595b7..ce1444d762 100644 --- a/firmware/controllers/core/fsio_impl.cpp +++ b/firmware/controllers/core/fsio_impl.cpp @@ -609,8 +609,7 @@ static void setFsioSetting(float humanIndexF, float value) { #endif } -void setFsioExpression(const char *indexStr, const char *quotedLine) { -#if EFI_PROD_CODE || EFI_SIMULATOR +void setFsioExpression(const char *indexStr, const char *quotedLine DECLARE_ENGINE_PARAMETER_SUFFIX) { int index = atoi(indexStr) - 1; if (index < 0 || index >= FSIO_COMMAND_COUNT) { scheduleMsg(logger, "invalid FSIO index: %d", index); @@ -627,7 +626,6 @@ void setFsioExpression(const char *indexStr, const char *quotedLine) { // this would apply the changes applyFsioConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE); showFsioInfo(); -#endif } static void rpnEval(char *line) { diff --git a/firmware/controllers/core/fsio_impl.h b/firmware/controllers/core/fsio_impl.h index 45a4ae2026..f9f728dadc 100644 --- a/firmware/controllers/core/fsio_impl.h +++ b/firmware/controllers/core/fsio_impl.h @@ -35,7 +35,7 @@ void setFsioExt(int index, brain_pin_e pin, const char * exp, int pwmFrequency D void initFsioImpl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX); void runFsio(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void setFsioExpression(const char *indexStr, const char *quotedLine); +void setFsioExpression(const char *indexStr, const char *quotedLine DECLARE_ENGINE_PARAMETER_SUFFIX); float getFsioOutputValue(int index DECLARE_ENGINE_PARAMETER_SUFFIX); void applyFsioConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE); void onConfigurationChangeFsioCallback(engine_configuration_s *previousConfiguration DECLARE_ENGINE_PARAMETER_SUFFIX); diff --git a/unit_tests/tests/test_idle_controller.cpp b/unit_tests/tests/test_idle_controller.cpp index c87838c402..566f44fc72 100644 --- a/unit_tests/tests/test_idle_controller.cpp +++ b/unit_tests/tests/test_idle_controller.cpp @@ -11,15 +11,20 @@ #include "pid.h" #include "fsio_impl.h" +#define Q(x) #x +#define QUOTE(x) Q(x) + TEST(idle, fsioPidParameters) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); // todo finish this unit test! engineConfiguration->useFSIO12ForIdleOffset = true; - setFsioExpression(MAGIC_OFFSET_FOR_IDLE_OFFSET, "\"ac_on_switch cfg_idleRpmPid_offset cfg_idleRpmPid2_offset if"); + setFsioExpression(QUOTE(MAGIC_OFFSET_FOR_IDLE_OFFSET), "\"ac_on_switch cfg_idleRpmPid_offset cfg_idleRpmPid2_offset if" PASS_ENGINE_PARAMETER_SUFFIX); engineConfiguration->useFSIO13ForIdleMinValue = true; - setFsioExpression(MAGIC_OFFSET_FOR_IDLE_MIN_VALUE, "\"ac_on_switch cfg_idleRpmPid_minValue cfg_idleRpmPid2_minValue if"); + setFsioExpression(QUOTE(MAGIC_OFFSET_FOR_IDLE_MIN_VALUE), "\"ac_on_switch cfg_idleRpmPid_minValue cfg_idleRpmPid2_minValue if" PASS_ENGINE_PARAMETER_SUFFIX); + + eth.engine.periodicSlowCallback(PASS_ENGINE_PARAMETER_SIGNATURE); } TEST(idle, pid) {