only:nissan TCU R steps back

This commit is contained in:
rusEFI LLC 2024-06-28 14:40:35 -04:00
parent c0e2a87289
commit 57944732cc
1 changed files with 31 additions and 7 deletions

View File

@ -81,14 +81,15 @@ function onENGINE_1_505(bus, id, dlc, data)
-- RPM
payloadENGINE_1_505[3] = data[3]
payloadENGINE_1_505[4] = data[4]
txCan(TCU_BUS, ENGINE_1_505, 0, payloadENGINE_1_505)
-- txCan(TCU_BUS, ENGINE_1_505, 0, data)
-- txCan(TCU_BUS, ENGINE_1_505, 0, payloadENGINE_1_505)
txCan(TCU_BUS, ENGINE_1_505, 0, data)
end
payloadENGINE_2_561 = {0xe0, 0x80, 0x09, 0xe0, 0xd4, 0xc3, 0x4c, 0x9e}
function onENGINE_2_561(bus, id, dlc, data)
payloadENGINE_2_561[3] = data[3]
txCan(TCU_BUS, ENGINE_2_561, 0, payloadENGINE_2_561)
-- txCan(TCU_BUS, ENGINE_2_561, 0, payloadENGINE_2_561)
txCan(TCU_BUS, ENGINE_2_561, 0, data)
end
payloadENGINE_7_563 = {0x79, 0xa2, 0x00, 0x18, 0x0e, 0x00, 0x00, 0x01}
@ -96,8 +97,8 @@ function onENGINE_7_563(bus, id, dlc, data)
payloadENGINE_7_563[3] = data[3]
payloadENGINE_7_563[4] = data[4]
payloadENGINE_7_563[7] = data[7]
txCan(TCU_BUS, ENGINE_7_563, 0, payloadENGINE_7_563)
-- txCan(TCU_BUS, ENGINE_7_563, 0, data)
-- txCan(TCU_BUS, ENGINE_7_563, 0, payloadENGINE_7_563)
txCan(TCU_BUS, ENGINE_7_563, 0, data)
end
payloadENGINE_3_573 = {0x00, 0x0e, 0x0b, 0x0e, 0x01, 0x38, 0x00, 0x79}
@ -106,8 +107,8 @@ function onENGINE_3_573(bus, id, dlc, data)
payloadENGINE_3_573[2] = data[2]
payloadENGINE_3_573[3] = data[3]
payloadENGINE_3_573[7] = data[7]
-- txCan(TCU_BUS, ENGINE_3_573, 0, payloadENGINE_3_573)
txCan(TCU_BUS, ENGINE_3_573, 0, payloadENGINE_3_573)
end
canRxAdd(ECU_BUS, ENGINE_1_505, onENGINE_1_505)
@ -116,8 +117,31 @@ canRxAdd(ECU_BUS, ENGINE_7_563, onENGINE_7_563)
canRxAdd(ECU_BUS, ENGINE_3_573, onENGINE_3_573)
--canRxAdd(ECU_BUS, ENGINE_4_574, relayFromECU)
payloadTCU_251_593 = {0x10, 0x00, 0x00, 0x01, 0x00, 0xef, 0x16, 0xde}
function onTCU_251_593(bus, id, dlc, data)
-- payloadTCU_251_593[1] = data[1]
-- payloadTCU_251_593[2] = data[2]
-- payloadTCU_251_593[3] = data[3]
payloadTCU_251_593[4] = data[4] -- required for dash
-- payloadTCU_251_593[5] = data[5]
-- payloadTCU_251_593[6] = data[6]
-- txCan(ECU_BUS, TCU_251_593, 0, payloadTCU_251_593)
txCan(ECU_BUS, TCU_251_593, 0, data)
end
payloadTCU_253_595 = {0x03, 0x5c, 0xff, 0x00, 0x00, 0x00, 0x30, 0x03}
function onTCU_253_595(bus, id, dlc, data)
payloadTCU_253_595[3] = data[3]
-- txCan(ECU_BUS, TCU_253_595, 0, payloadTCU_253_595)
txCan(ECU_BUS, TCU_253_595, 0, data)
end
canRxAdd(TCU_BUS, TCU_251_593, onTCU_251_593)
--canRxAdd(TCU_BUS, TCU_253_595, onTCU_253_595)
-- last option: unconditional forward of all remaining messages
canRxAddMask(ECU_BUS, 0, 0, onAnythingFromECU)
--canRxAddMask(ECU_BUS, 0, 0, onAnythingFromECU)
--canRxAddMask(TCU_BUS, 0, 0, onAnythingFromTCU)
everySecondTimer = Timer.new()