mk60 byte order wrong

(cherry picked from commit 9a6a53c9fa)
This commit is contained in:
Matthew Kennedy 2023-04-13 02:51:26 -04:00 committed by Andrey
parent a0c512e3b7
commit 3d3873235b
1 changed files with 4 additions and 4 deletions

View File

@ -34,9 +34,9 @@ expected<uint16_t> look_up_can_id(can_vss_nbc_e type) {
/* Module specitifc processing functions */
/* source: http://z4evconversion.blogspot.com/2016/07/completely-forgot-but-it-does-live-on.html */
float processBMW_e46(const CANRxFrame& frame) {
/* left front wheel speed is used here */
uint16_t tmp = ((frame.data8[1] & 0x0f) << 8 );
tmp |= frame.data8[0];
// average the rear wheels since those are the driven ones (more accurate gear detection!)
uint16_t left = (((frame.data8[5] & 0x0f) << 8) | frame.data8[4]);
uint16_t right = (((frame.data8[7] & 0x0f) << 8) | frame.data8[6]);
return tmp / 16.0f;
}
@ -109,4 +109,4 @@ void setCanVss(int type) {
canVssInfo();
}
#endif // EFI_CAN_SUPPORT
#endif // EFI_CAN_SUPPORT