CAN lua refactoring

This commit is contained in:
rusefillc 2023-04-20 12:52:36 -04:00
parent 36397b6c0b
commit 0278c21a85
2 changed files with 2 additions and 4 deletions

View File

@ -51,16 +51,15 @@ canRxAdd(0x500)
function onCanRx(bus, id, dlc, data)
--print('got CAN id=' .. id .. ' dlc=' .. dlc)
id11 = id % 2048
if id11 == 0x500 then --Check can state of BCM
if id == 0x500 then --Check can state of BCM
canState = data[1]
if canState == 01 then
packet502[1] = 0x01
else
packet502[1] = 0x00
end
if id11 == 0x570 then
if id == 0x570 then
curState = data[1]
if curState == 06 then -- Cranking TODO: MUST ONLY DO THIS ON RPM TILL STARt
packet542[2] = 0x82

View File

@ -28,7 +28,6 @@ canRxAdd(0x4f0)
packet4f1 = { 0xFA, 0x54, 0x00, 0x0, 0x00, 0x51, 0x00, 0x00 }
function onCanRx(bus, id, dlc, data)
id11 = id % 2048
print('got CAN id=' .. id .. ' dlc=' .. dlc)
-- todo: add filtering logic if needed