projects
/
renesas-ra-flasher
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a909d74
)
RAPacker: data package can aso start with 0x81
author
Robin Krens
<robin@robinkrens.nl>
Tue, 13 Feb 2024 19:08:36 +0000
(20:08 +0100)
committer
Robin Krens
<robin@robinkrens.nl>
Tue, 13 Feb 2024 19:08:36 +0000
(20:08 +0100)
src/RAPacker.py
patch
|
blob
|
history
diff --git
a/src/RAPacker.py
b/src/RAPacker.py
index
676a296
..
52fa9fd
100644
(file)
--- a/
src/RAPacker.py
+++ b/
src/RAPacker.py
@@
-97,8
+97,10
@@
def pack_command(cmd, data):
return fmt
# format of data packet is [SOD|LNH|LNL|RES|DAT|SUM|ETX]
-def pack_pkt(res, data):
+def pack_pkt(res, data
, ack=False
):
SOD = 0x01 # TODO: check if 0x81 header needed
+ if ack:
+ SOD = 0x81
if (len(data) > 1024):
raise Exception(f'Data packet too large, data length is {DATA_LEN} (>1024)')
LNH, LNL, SUM = calc_sum(int(res), data)