Skip to content

Commit

Permalink
can vss tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Nov 6, 2024
1 parent 1e9bb0f commit 0dbdeb1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions firmware/controllers/can/can_vss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ expected<float> tryDecodeVss(can_vss_nbc_e type, const CANRxFrame& frame) {
case W202:
return processW202(frame);
default:
firmwareError(ObdCode::OBD_Vehicle_Speed_SensorB, "Wrong Can DBC selected: %d", type);
return unexpected;
}
}
Expand Down Expand Up @@ -141,12 +140,19 @@ void processCanRxVss(const CANRxFrame& frame, efitick_t nowNt) {
}

void initCanVssSupport() {
isInit = false;

if (engineConfiguration->enableCanVss) {
if (engineConfiguration->canVssNbcType < CanVssLast) {
auto type = engineConfiguration->canVssNbcType;
if (type < CanVssLast) {
canSpeed.Register();
wssLf.Register();
wssRf.Register();
wssLr.Register();
wssRr.Register();
isInit = true;
} else {
isInit = false;
firmwareError(ObdCode::OBD_Vehicle_Speed_SensorB, "Wrong Can DBC selected: %d", type);
}
}
}
Expand Down

0 comments on commit 0dbdeb1

Please sign in to comment.