mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-02 11:55:56 +00:00
Small tweak that reduces the number of lines of code in
XModemAdapter::check to 1. It should be functionally the same.
This commit is contained in:
parent
cb8532f2df
commit
f07963e802
@ -54,11 +54,7 @@ unsigned short XModemAdapter::crc16_ccitt(const pb_byte_t *buffer, int length)
|
||||
|
||||
int XModemAdapter::check(const pb_byte_t *buf, int sz, unsigned short tcrc)
|
||||
{
|
||||
unsigned short crc = crc16_ccitt(buf, sz);
|
||||
if (crc == tcrc)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
return crc16_ccitt(buf, sz) == tcrc;
|
||||
}
|
||||
|
||||
void XModemAdapter::sendControl(meshtastic_XModem_Control c)
|
||||
|
Loading…
Reference in New Issue
Block a user