You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Typical use of a boolean operator ('||') where the bitwise operator was meant ('|'). Fortunately there are compiler warnings.
grbl/eeprom.c:133:26: warning: '<<' in boolean context, did you mean '<' ? [-Wint-in-bool-context]
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]
checksum = (checksum << 1) || (checksum >> 7);
~~~~~~~~~~^~~~~
Yep. I found this a couple years ago and came to the same conclusion that it would wipe every EEPROM since the checksum would be wrong. Decided to leave it alone until the next major version.
Typical use of a boolean operator ('||') where the bitwise operator was meant ('|'). Fortunately there are compiler warnings.
Affected are the functions memcpy_to_eeprom_with_checksum() and memcpy_from_eeprom_with_checksum() here: https://github.com/gnea/grbl/blob/master/grbl/eeprom.c#L130
PS:
To fix this bug we would have to wipe every EEPROM again because otherwise the checksum would be "wrong".
The text was updated successfully, but these errors were encountered: