Skip to content

Commit

Permalink
stub mx5 NC wheel speed
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Nov 6, 2024
1 parent 0dbdeb1 commit 62ea264
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion firmware/controllers/algo/rusefi_enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,9 @@ typedef enum __attribute__ ((__packed__)) {
BMW_e46 = 0,
W202 = 1,
BMW_e90 = 2,
Mx5_NC = 3,

CanVssLast = 3,
CanVssLast = 4,
} can_vss_nbc_e;

/**
Expand Down
18 changes: 18 additions & 0 deletions firmware/controllers/can/can_vss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,28 @@ expected<WssResult> processBMW_e90Wss(const CANRxFrame& frame) {
};
}

expected<WssResult> processMx5NcWss(const CANRxFrame& frame) {
// NC ABS wheel speed frame
// TODO: set ID
if (CAN_SID(frame) != 0x000) {
return unexpected;
}

// TODO: decode wheel speeds from frame
return WssResult{
0,
0,
0,
0
};
}

expected<WssResult> tryDecodeWss(can_vss_nbc_e type, const CANRxFrame& frame) {
switch (type) {
case BMW_e90:
return processBMW_e90Wss(frame);
case Mx5_NC:
return processMx5NcWss(frame);
default:
return unexpected;
}
Expand Down
2 changes: 1 addition & 1 deletion firmware/integration/rusefi_config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ tChargeMode_e tChargeMode;
Gpio tle8888_cs;
pin_output_mode_e tle8888_csPinMode;

custom can_vss_nbc_e 2 bits, U08, @OFFSET@, [0:1], "BMW_e46", "W202", "BMW E8x/E9x MK60e5"
custom can_vss_nbc_e 2 bits, U08, @OFFSET@, [0:1], "BMW_e46", "W202", "BMW E8x/E9x MK60e5", "MX-5 NC"
can_vss_nbc_e canVssNbcType

Gpio mc33816_cs;
Expand Down

0 comments on commit 62ea264

Please sign in to comment.