Master is now using the same FW_Update Methode as the Slaves
This commit is contained in:
@@ -30,7 +30,7 @@ def make_header(typeid: PackageType, length: int) -> bytearray:
|
||||
struct_format = '<HHB' # '<' for little-endian, 'H' for uint16_t, 'B' for uint8_t
|
||||
# Calculate the check byte as the sum of length and type
|
||||
typeidint = int(typeid)
|
||||
check = (length & 0xFF) + ((length >> 8) & 0xFF) + (typeidint & 0xFF) + ((typeidint >> 8) & 0xFF)
|
||||
check = ((length & 0xFF) + ((length >> 8) & 0xFF) + (typeidint & 0xFF) + ((typeidint >> 8) & 0xFF) ) & 0xff
|
||||
packed_data = struct.pack(struct_format, length, typeid, check)
|
||||
return packed_data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user