From 6c9d684dfdbb1c579372ca7da60c9e15b5b2a487 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Sat, 17 Aug 2019 17:33:44 -0400 Subject: [PATCH] MRE etb --- firmware/config/boards/microrusefi/board_configuration.cpp | 3 ++- firmware/controllers/settings.cpp | 4 ++++ firmware/rusefi.cpp | 4 ++-- firmware/util/math/pid.cpp | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/firmware/config/boards/microrusefi/board_configuration.cpp b/firmware/config/boards/microrusefi/board_configuration.cpp index d61efc8a7e..ad38a0203f 100644 --- a/firmware/config/boards/microrusefi/board_configuration.cpp +++ b/firmware/config/boards/microrusefi/board_configuration.cpp @@ -102,7 +102,8 @@ static void setupEtb() { #endif /* EFI_FSIO */ - // EFI_ADC_7: "31 - AN volt 3" + // set_analog_input_pin pps PA7 + // EFI_ADC_7: "31 - AN volt 3" - PA7 // engineConfiguration->throttlePedalPositionAdcChannel = EFI_ADC_7; // Unused diff --git a/firmware/controllers/settings.cpp b/firmware/controllers/settings.cpp index 889cefed50..4c1ef59f5b 100644 --- a/firmware/controllers/settings.cpp +++ b/firmware/controllers/settings.cpp @@ -778,6 +778,7 @@ static void setTriggerSimulatorPin(const char *indexStr, const char *pinName) { } #if HAL_USE_ADC +// set_analog_input_pin pps static void setAnalogInputPin(const char *sensorStr, const char *pinName) { brain_pin_e pin = parseBrainPin(pinName); if (pin == GPIO_INVALID) { @@ -792,6 +793,9 @@ static void setAnalogInputPin(const char *sensorStr, const char *pinName) { if (strEqual("map", sensorStr)) { engineConfiguration->map.sensor.hwChannel = channel; scheduleMsg(&logger, "setting MAP to %s/%d", pinName, channel); + } else if (strEqual("pps", sensorStr)) { + engineConfiguration->throttlePedalPositionAdcChannel = channel; + scheduleMsg(&logger, "setting PPS to %s/%d", pinName, channel); } else if (strEqual("clt", sensorStr)) { engineConfiguration->clt.adcChannel = channel; scheduleMsg(&logger, "setting CLT to %s/%d", pinName, channel); diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index b3d52b120b..04399d7aa9 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -155,9 +155,9 @@ void rebootNow(void) { * Once day we will write graceful shutdown, but that would be one day. */ static void scheduleReboot(void) { - scheduleMsg(&sharedLogger, "Rebooting in 5 seconds..."); + scheduleMsg(&sharedLogger, "Rebooting in 3 seconds..."); lockAnyContext(); - chVTSetI(&resetTimer, TIME_MS2I(5000), (vtfunc_t) rebootNow, NULL); + chVTSetI(&resetTimer, TIME_MS2I(3000), (vtfunc_t) rebootNow, NULL); unlockAnyContext(); } diff --git a/firmware/util/math/pid.cpp b/firmware/util/math/pid.cpp index dc5a79c51c..46addbc900 100644 --- a/firmware/util/math/pid.cpp +++ b/firmware/util/math/pid.cpp @@ -148,7 +148,7 @@ void Pid::sleep() { } void Pid::showPidStatus(Logging *logging, const char*msg) { - scheduleMsg(logging, "%s settings: offset=%d P=%.5f I=%.5f D=%.5f dT=%d", + scheduleMsg(logging, "%s settings: offset=%d P=%.5f I=%.5f D=%.5f period=%dms", msg, pid->offset, pid->pFactor,