mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
extra check in calculating CRC
This commit is contained in:
@@ -454,6 +454,11 @@ void ems_tx_pollAck() {
|
||||
* len is length of all the data in bytes (including the header & CRC byte at end)
|
||||
*/
|
||||
uint8_t _crcCalculator(uint8_t * data, uint8_t len) {
|
||||
|
||||
if (len <= 1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t crc = 0;
|
||||
|
||||
// read data and stop before the CRC
|
||||
|
||||
Reference in New Issue
Block a user