Rename our "CRC" class to CRCCalculator, so as not to conflict with a

GD32 platform-specific macro
pull/1090/head
Jesse Vincent 3 years ago
parent addc341184
commit 14f2ef8c3e
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -101,7 +101,7 @@ void EEPROMSettings::ignoreHardcodedLayers(bool value) {
void EEPROMSettings::seal(void) {
sealed_ = true;
CRC.finalize();
CRCCalculator.finalize();
if (settings_.version != VERSION_CURRENT) {
is_valid_ = false;
@ -109,9 +109,9 @@ void EEPROMSettings::seal(void) {
}
if (settings_.crc == 0xffff) {
settings_.crc = CRC.crc;
settings_.crc = CRCCalculator.crc;
update();
} else if (settings_.crc != CRC.crc) {
} else if (settings_.crc != CRCCalculator.crc) {
return;
}
@ -134,7 +134,7 @@ uint16_t EEPROMSettings::requestSlice(uint16_t size) {
uint16_t start = next_start_;
next_start_ += size;
CRC.update((const void *)&size, sizeof(size));
CRCCalculator.update((const void *)&size, sizeof(size));
return start;
}
@ -159,7 +159,7 @@ EventHandlerResult FocusSettingsCommand::onFocusEvent(const char *command) {
DEFAULT_LAYER,
IS_VALID,
GET_VERSION,
CRC,
GET_CRC,
} sub_command;
if (::Focus.handleHelp(command, PSTR("settings.defaultLayer\nsettings.valid?\nsettings.version\nsettings.crc")))
@ -175,7 +175,7 @@ EventHandlerResult FocusSettingsCommand::onFocusEvent(const char *command) {
else if (strcmp_P(command + 9, PSTR("version")) == 0)
sub_command = GET_VERSION;
else if (strcmp_P(command + 9, PSTR("crc")) == 0)
sub_command = CRC;
sub_command = GET_CRC;
else
return EventHandlerResult::OK;
@ -196,8 +196,8 @@ EventHandlerResult FocusSettingsCommand::onFocusEvent(const char *command) {
case GET_VERSION:
::Focus.send(::EEPROMSettings.version());
break;
case CRC:
::Focus.sendRaw(::CRC.crc, F("/"), ::EEPROMSettings.crc());
case GET_CRC:
::Focus.sendRaw(::CRCCalculator.crc, F("/"), ::EEPROMSettings.crc());
break;
}

@ -66,4 +66,4 @@ CRC_::update(const void *data, uint8_t len) {
crc &= 0xffff;
}
CRC_ CRC;
CRC_ CRCCalculator;

@ -43,4 +43,4 @@ class CRC_ {
void reflect(uint8_t len);
};
extern CRC_ CRC;
extern CRC_ CRCCalculator;

Loading…
Cancel
Save