mirror of https://github.com/rusefi/rusefi.git
only:kia CAN
This commit is contained in:
parent
24763c4a62
commit
8d7794a265
|
@ -124,7 +124,7 @@ end \
|
|||
"
|
||||
|
||||
#define HYUNDAI_SUM_NIBBLES "\
|
||||
function hyuindaiSumNibbles(seed) \
|
||||
function hyuindaiSumNibbles(data, seed) \
|
||||
local sum = seed \
|
||||
for i = 1, 7, 1 \
|
||||
do \
|
||||
|
|
|
@ -31,10 +31,10 @@ rpm = 990
|
|||
}
|
||||
|
||||
TEST(LuaKia, calcSumOfNibbles) {
|
||||
#define real81Packet "\ndata = { 0x40, 0x85, 0x5F, 0x00, 0x00, 0x00, 0x00, 0xED}\n "
|
||||
#define real81Packet "\npacket = { 0x40, 0x85, 0x5F, 0x00, 0x00, 0x00, 0x00, 0xED}\n "
|
||||
const char* script = HYUNDAI_SUM_NIBBLES real81Packet R"(
|
||||
function testFunc()
|
||||
return hyuindaiSumNibbles(0xD)
|
||||
return hyuindaiSumNibbles(packet, 0xD)
|
||||
end
|
||||
)";
|
||||
EXPECT_NEAR_M3(testLuaReturnsNumberOrNil(script).value_or(0), 0xE);
|
||||
|
|
Loading…
Reference in New Issue