Update B6-temp.md
This commit is contained in:
parent
a6daefaa56
commit
e70454024b
11
B6-temp.md
11
B6-temp.md
|
@ -8,6 +8,8 @@ MOTOR_6 = 0x488
|
|||
MOTOR_7 = 0x588
|
||||
|
||||
|
||||
fuelCounter = 0;
|
||||
|
||||
function xorChecksum(data, targetIndex)
|
||||
local index = 1
|
||||
local result = 0
|
||||
|
@ -95,6 +97,7 @@ totalTcuMessages = 0
|
|||
motor1Data = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
|
||||
canMotorInfo = { 0x00, 0x00, 0x00, 0x14, 0x1C, 0x93, 0x48, 0x14 }
|
||||
canMotor3 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
|
||||
motor5Data = { 0x1C, 0x08, 0xF3, 0x55, 0x19, 0x00, 0x06, 0xAD}
|
||||
motor6Data = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
|
||||
motor7Data = { 0x1A, 0x66, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00 }
|
||||
|
||||
|
@ -146,6 +149,10 @@ function onMotor3(bus, id, dlc, data)
|
|||
txCan(TCU_BUS, id, 0, canMotor3)
|
||||
end
|
||||
|
||||
function onMotor5(bus, id, dlc, data)
|
||||
txCan(TCU_BUS, id, 0, motor5Data)
|
||||
end
|
||||
|
||||
function printAndDrop(bus, id, dlc, data)
|
||||
print('Dropping ' ..arrayToString(data))
|
||||
end
|
||||
|
@ -164,7 +171,7 @@ end
|
|||
canRxAdd(ECU_BUS, MOTOR_1, onMotor1)
|
||||
|
||||
canRxAdd(ECU_BUS, MOTOR_3, onMotor3)
|
||||
canRxAdd(ECU_BUS, MOTOR_5, printAndDrop)
|
||||
canRxAdd(ECU_BUS, MOTOR_5, onMotor3)
|
||||
canRxAdd(ECU_BUS, MOTOR_INFO, printAndDrop)
|
||||
canRxAdd(ECU_BUS, MOTOR_6, printAndDrop)
|
||||
canRxAdd(ECU_BUS, MOTOR_7, printAndDrop)
|
||||
|
@ -180,6 +187,8 @@ function onTick()
|
|||
if everySecondTimer : getElapsedSeconds() > 1 then
|
||||
everySecondTimer : reset()
|
||||
print("Total from ECU " ..totalEcuMessages .." from TCU " ..totalTcuMessages)
|
||||
|
||||
fuelCounter = fuelCounter + 20
|
||||
|
||||
|
||||
canMotorInfoCounter = (canMotorInfoCounter + 1) % 8
|
||||
|
|
Loading…
Reference in New Issue