only:gdi
This commit is contained in:
parent
c1c3840340
commit
dd3f4295cf
|
@ -1,4 +1,5 @@
|
||||||
-- communication with https://github.com/rusefi/rusefi-hardware/tree/main/GDI-4ch/firmware
|
-- communication with https://github.com/rusefi/rusefi-hardware/tree/main/GDI-4ch/firmware
|
||||||
|
-- hpfpbench
|
||||||
|
|
||||||
busIndex = 1
|
busIndex = 1
|
||||||
|
|
||||||
|
|
|
@ -27,13 +27,19 @@ function arrayToString(arr)
|
||||||
return str
|
return str
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function getTwoBytesLSB(data, offset, factor)
|
||||||
|
return (data[offset + 2] * 256 + data[offset + 1]) * factor
|
||||||
|
end
|
||||||
|
|
||||||
function onSensorData(bus, id, dlc, data)
|
function onSensorData(bus, id, dlc, data)
|
||||||
if data[8] ~= 0xDE then
|
if data[8] ~= 0xDE then
|
||||||
print ("invalid data: " ..arrayToString(data))
|
print ("invalid data: " ..arrayToString(data))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
print ("valid data: " ..arrayToString(data))
|
-- print ("valid data: " ..arrayToString(data))
|
||||||
-- sensor : set(packet / 512)
|
local pressureBar = getTwoBytesLSB(data, 0, 10)
|
||||||
|
sensor : set(pressureBar)
|
||||||
|
print ("valid pressureBar: " ..pressureBar)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- bus index '1' on most rusEFI boards, '1' or '2' on Proteus
|
-- bus index '1' on most rusEFI boards, '1' or '2' on Proteus
|
||||||
|
|
Loading…
Reference in New Issue