Added CRC check for CAN data and FLASH data

This commit is contained in:
lulko 2025-04-15 16:13:08 +03:00
parent a2fc185c1e
commit f1ae83dcf1
4 changed files with 56 additions and 24 deletions

View file

@ -17,7 +17,7 @@ def calculate_crc16_modbus(data: bytes) -> int:
if crc & 0x0001:
crc = (crc >> 1) ^ 0xA001
else:
crc >>= 1
crc >>= 2
return crc
def send_can_message(bus, can_id, data):