diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 6a44566710..0b8b62957e 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -408,6 +408,7 @@ static void setDefaultEngineConfiguration() { engineConfiguration->canSleepPeriodMs = 50; engineConfiguration->canReadEnabled = true; engineConfiguration->canWriteEnabled = true; + engineConfiguration->canVssScaling = 1.0f; // Don't enable, but set default address engineConfiguration->verboseCanBaseAddress = CAN_DEFAULT_BASE; diff --git a/firmware/controllers/can/can_vss.cpp b/firmware/controllers/can/can_vss.cpp index d7ea3ac2f1..61430a6404 100644 --- a/firmware/controllers/can/can_vss.cpp +++ b/firmware/controllers/can/can_vss.cpp @@ -80,7 +80,7 @@ void processCanRxVss(const CANRxFrame& frame, efitick_t nowNt) { } if (auto speed = processCanRxVssImpl(frame)) { - canSpeed.setValidValue(speed.Value, nowNt); + canSpeed.setValidValue(speed.Value * engineConfiguration->canVssScaling, nowNt); #if EFI_DYNO_VIEW updateDynoViewCan(); diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 14557176d7..68f088e5b7 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -92,7 +92,7 @@ ! Any time an incompatible change is made to the configuration format stored in flash, ! update this string to the current date! It is required to also update TS_SIGNATURE above ! when this happens. -#define FLASH_DATA_VERSION 20011 +#define FLASH_DATA_VERSION 20012 ! this offset is part of console compatibility mechanism, please DO NOT change this offset #define TS_FILE_VERSION_OFFSET 124 @@ -1475,6 +1475,8 @@ pin_input_mode_e[LUA_DIGITAL_INPUT_COUNT iterate] luaDigitalInputPinModes; uint8_t ignTestCount;How many test bench pulses do you want;"", 1, 0, 0, 50, 0 uint8_t autoscale ignTestOffTime;Time between bench test pulses;"ms", 5, 0, 0, 2000, 0 + uint16_t autoscale canVssScaling;Scale the reported vehicle speed value from CAN. Example: Parameter set to 1.1, CAN VSS reports 50kph, ECU will report 55kph instead.;"ratio", 0.0001, 0, 0.5, 1.5, 4 + uint8_t[93] mainUnusedEnd;;"units", 1, 0, 0, 1, 0 ! end of engine_configuration_s diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 086663eec4..aa22da98cf 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -3549,7 +3549,8 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_ dialog = speedSensorCan, "CAN Vehicle Speed" field = "Enable CAN VSS", enableCanVss, { canReadEnabled } - field = "VSS CAN message type", canVssNbcType, { enableCanVss } + field = "CAN VSS type", canVssNbcType, { enableCanVss } + field = "CAN VSS scaling", canVssScaling, { canReadEnabled } dialog = speedSensorLeft, "", yAxis panel = speedSensorAnalog, { enableCanVss == 0 }