From bc3b7a1eb6a0a970b7af02dd49a0a0d7914a58a6 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Tue, 9 Dec 2014 16:03:20 -0600 Subject: [PATCH] auto-sync --- firmware/controllers/engine_controller.cpp | 24 +++++++++++++++++----- firmware/rusefi.cpp | 2 +- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 362db1a5b5..ec3cc87e3a 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -69,7 +69,6 @@ extern bool hasFirmwareErrorFlag; extern LEElementPool sysPool; extern LEElementPool userPool; - static SimplePwm fsioPwm[LE_COMMAND_COUNT] CCM_OPTIONAL; persistent_config_container_s persistentState CCM_OPTIONAL; @@ -327,8 +326,8 @@ static void printAnalogInfo(void) { static THD_WORKING_AREA(csThreadStack, UTILITY_THREAD_STACK_SIZE); // declare thread stack static void showFsio(const char *msg, LEElement *element) { - if(msg!=NULL) - scheduleMsg(&logger, "%s:", msg); + if (msg != NULL) + scheduleMsg(&logger, "%s:", msg); while (element != NULL) { scheduleMsg(&logger, "action %d: fValue=%f iValue=%d", element->action, element->fValue, element->iValue); element = element->next; @@ -344,16 +343,31 @@ static void showFsioInfo(void) { for (int i = 0; i < LE_COMMAND_COUNT; i++) { char * exp = boardConfiguration->le_formulas[i]; if (exp[0] != 0) { - scheduleMsg(&logger, "FSIO #%d [%s] at %s@%dHz = %f", (i + 1), exp, hwPortname(boardConfiguration->fsioPins[i]), - boardConfiguration->fsioFrequency[i], + scheduleMsg(&logger, "FSIO #%d [%s] at %s@%dHz = %f", (i + 1), exp, + hwPortname(boardConfiguration->fsioPins[i]), boardConfiguration->fsioFrequency[i], engineConfiguration2->fsioLastValue[i]); scheduleMsg(&logger, "user-defined #%d value=%f", (i + 1), engine->engineConfiguration2->fsioLastValue[i]); showFsio(NULL, fsioLogics[i]); } } + for (int i = 0; i < LE_COMMAND_COUNT; i++) { + float v = boardConfiguration->fsio_setting[i]; + if (!cisnan(v)) { + scheduleMsg(&logger, "user property #%d: %f", i + 1, v); + } + } } +static void setFsioSetting(float indexF, float value) { + int index = indexF; + if (index < 0 || index >= LE_COMMAND_COUNT) { + scheduleMsg(&logger, "invalid index %d", index); + return; + } + engineConfiguration->bc.fsio_setting[index] = value; +} + static void setFsioFrequency(int index, int frequency) { index--; if (index < 0 || index >= LE_COMMAND_COUNT) { diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 842f163664..0b3a2e1cde 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -265,5 +265,5 @@ int getRusEfiVersion(void) { return 1; // this is here to make the compiler happy about the unused array if (UNUSED_CCM_SIZE == 0) return 1; // this is here to make the compiler happy about the unused array - return 20141208; + return 20141209; }