grbl/eeprom.c: In function 'memcpy_to_eeprom_with_checksum': grbl/eeprom.c:133:26: warning: '<<' in boolean context, did you mean '' ? [-Wint-in-bool-context] 133 | checksum = (checksum << 1) || (checksum >> 7); | ~~^~~ grbl/eeprom.c: In function 'memcpy_from_eeprom_with_checksum': grbl/eeprom.c:144:26: warning: '<<' in boolean context, did you mean '' ? [-Wint-in-bool-context] 144 | checksum = (checksum << 1) || (checksum >> 7); | ~~^~~
That looks like it was a typo -- it squashes the checksum down to a single bit of information, when it looks like it intended to roll it right one bit, so the final checksum ends up either zero or one larger than the last character in the data:
That looks like it was a typo -- it squashes the checksum down to a single bit of information, when it looks like it intended to roll it right one bit, so the final checksum ends up either zero or one larger than the last character in the data:
https://github.com/gnea/grbl-Mega/blob/df87b36f48b90930714accf03b411b60d5d948e5/grbl/eeprom.c#L130-L149
Maybe it was supposed to be
Originally posted by @drf5n in https://github.com/gnea/grbl-Mega/issues/157#issuecomment-1095029184