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);
~~~~~~~~~~^~~~~
布尔运算符(“||”)的典型用法,其中按位运算符是指(“|”)。幸运的是有编译器警告。
受影响的是 memcpy_to_eeprom_with_checksum() 和 memcpy_from_eeprom_with_checksum() 函数: https ://github.com/gnea/grbl/blob/master/grbl/eeprom.c#L130
PS:
要修复此错误,我们必须再次擦除每个 EEPROM,否则校验和将“错误”。