BMW E8x/E9x MK60e5

This commit is contained in:
rusefillc 2023-11-26 23:32:56 -05:00
parent 5f26bf9d35
commit d5cb3c8080
1 changed files with 11 additions and 0 deletions

View File

@ -21,6 +21,8 @@ expected<uint16_t> look_up_can_id(can_vss_nbc_e type) {
switch (type) {
case BMW_e46:
return 0x01F0; /* BMW e46 ABS Message */
case BMW_e90:
return 0x10A; // BMW E90 ABS speed frame (not wheel speeds, vehicle speed)
case W202:
return 0x0200; /* W202 C180 ABS signal */
case LUA:
@ -41,6 +43,13 @@ float processBMW_e46(const CANRxFrame& frame) {
return (left + right) / (16 * 2);
}
float processBMW_e90(const CANRxFrame& frame) {
uint8_t low = frame.data8[0];
uint8_t high = frame.data8[1] & 0x0F;
return (low | high << 8);
}
float processW202(const CANRxFrame& frame) {
uint16_t tmp = (frame.data8[2] << 8);
tmp |= frame.data8[3];
@ -53,6 +62,8 @@ expected<float> processCanRxVssImpl(const CANRxFrame& frame) {
switch (engineConfiguration->canVssNbcType){
case BMW_e46:
return processBMW_e46(frame);
case BMW_e90:
return processBMW_e90(frame);
case W202:
return processW202(frame);
default: