only:proteus_f7

PB
This commit is contained in:
Andrey 2023-07-08 00:35:21 -04:00
parent 38e846bc7f
commit 74642961c3
2 changed files with 10 additions and 10 deletions

View File

@ -77,7 +77,7 @@ void setHyundaiPb() {
#endif // HW_PROTEUS
#if HW_PROTEUS
strncpy(config->luaScript, SET_TWO_BYTES HYUNDAI_SUM_NIBBLES R"(
strncpy(config->luaScript, TWO_BYTES_LSB PRINT_ARRAY SET_TWO_BYTES HYUNDAI_SUM_NIBBLES R"(
GDI4_BASE_ADDRESS = 0xF0
GDI_CHANGE_ADDRESS = GDI4_BASE_ADDRESS + 0x10
@ -103,7 +103,7 @@ EMS_DCT12_129 = 0x81
EMS11_790 = 0x316
EMS14_1349 = 0x545
int counter = 0
counter = 0
payLoad128 = { 0x00, 0x17, 0x70, 0x0F, 0x1B, 0x2C, 0x1B, 0x75 }
payLoad129 = { 0x40, 0x84, 0x5F, 0x00, 0x00, 0x00, 0x00, 0x75 }

View File

@ -71,9 +71,9 @@ end \
// Little-endian System, "Intel"
#define SET_TWO_BYTES " function setTwoBytes(data, offset, value) \
value = math.floor(value) \
data[offset + 2] = value >> 8 \
data[offset + 1] = value & 0xff \
value = math.floor(value) \n\
data[offset + 2] = value >> 8 \n\
data[offset + 1] = value & 0xff \n\
end \
"
@ -124,11 +124,11 @@ end \
"
#define HYUNDAI_SUM_NIBBLES "\
function hyuindaiSumNibbles(data, seed) \
local sum = seed \
for i = 1, 7, 1 \
do \
b = data[i] \
function hyuindaiSumNibbles(data, seed) \n\
local sum = seed \n\
for i = 1, 7, 1 \n\
do \n\
b = data[i] \n\
sum = sum + (b % 16) + math.floor(b / 16) \
end \
return (16 - sum) % 16 \