forked from Mirrors/Marlin
🩹 Fix EEPROM size sign warning
This commit is contained in:
@@ -53,7 +53,7 @@ bool PersistentStore::access_start() {
|
||||
int bytes_read = file.read(HAL_eeprom_data, MARLIN_EEPROM_SIZE);
|
||||
if (bytes_read < 0) return false;
|
||||
|
||||
for (; bytes_read < MARLIN_EEPROM_SIZE; bytes_read++)
|
||||
for (; bytes_read < long(MARLIN_EEPROM_SIZE); bytes_read++)
|
||||
HAL_eeprom_data[bytes_read] = 0xFF;
|
||||
|
||||
file.close();
|
||||
|
||||
@@ -45,7 +45,7 @@ bool PersistentStore::access_start() {
|
||||
fseek(eeprom_file, 0L, SEEK_END);
|
||||
std::size_t file_size = ftell(eeprom_file);
|
||||
|
||||
if (file_size < MARLIN_EEPROM_SIZE) {
|
||||
if (file_size < long(MARLIN_EEPROM_SIZE)) {
|
||||
memset(buffer + file_size, eeprom_erase_value, MARLIN_EEPROM_SIZE - file_size);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -74,7 +74,7 @@ bool PersistentStore::access_start() {
|
||||
|
||||
if (status == CMD_SUCCESS) {
|
||||
// sector is blank so nothing stored yet
|
||||
for (int i = 0; i < MARLIN_EEPROM_SIZE; i++) ram_eeprom[i] = EEPROM_ERASE;
|
||||
for (int i = 0; i < long(MARLIN_EEPROM_SIZE); i++) ram_eeprom[i] = EEPROM_ERASE;
|
||||
current_slot = EEPROM_SLOTS;
|
||||
}
|
||||
else {
|
||||
@@ -82,7 +82,7 @@ bool PersistentStore::access_start() {
|
||||
current_slot = first_nblank_loc / (MARLIN_EEPROM_SIZE);
|
||||
uint8_t *eeprom_data = SLOT_ADDRESS(EEPROM_SECTOR, current_slot);
|
||||
// load current settings
|
||||
for (int i = 0; i < MARLIN_EEPROM_SIZE; i++) ram_eeprom[i] = eeprom_data[i];
|
||||
for (int i = 0; i < long(MARLIN_EEPROM_SIZE); i++) ram_eeprom[i] = eeprom_data[i];
|
||||
}
|
||||
eeprom_dirty = false;
|
||||
|
||||
|
||||
@@ -125,13 +125,13 @@ bool PersistentStore::access_start() {
|
||||
}
|
||||
if (current_slot == -1) {
|
||||
// We didn't find anything, so we'll just initialize to empty
|
||||
for (int i = 0; i < MARLIN_EEPROM_SIZE; i++) ram_eeprom[i] = EMPTY_UINT8;
|
||||
for (int i = 0; i < long(MARLIN_EEPROM_SIZE); i++) ram_eeprom[i] = EMPTY_UINT8;
|
||||
current_slot = EEPROM_SLOTS;
|
||||
}
|
||||
else {
|
||||
// load current settings
|
||||
uint8_t *eeprom_data = (uint8_t *)SLOT_ADDRESS(current_slot);
|
||||
for (int i = 0; i < MARLIN_EEPROM_SIZE; i++) ram_eeprom[i] = eeprom_data[i];
|
||||
for (int i = 0; i < long(MARLIN_EEPROM_SIZE); i++) ram_eeprom[i] = eeprom_data[i];
|
||||
DEBUG_ECHOLNPGM("EEPROM loaded from slot ", current_slot, ".");
|
||||
}
|
||||
eeprom_data_written = false;
|
||||
|
||||
@@ -54,7 +54,7 @@ bool PersistentStore::access_start() {
|
||||
|
||||
int bytes_read = file.read(HAL_eeprom_data, MARLIN_EEPROM_SIZE);
|
||||
if (bytes_read < 0) return false;
|
||||
for (; bytes_read < MARLIN_EEPROM_SIZE; bytes_read++)
|
||||
for (; bytes_read < long(MARLIN_EEPROM_SIZE); bytes_read++)
|
||||
HAL_eeprom_data[bytes_read] = 0xFF;
|
||||
file.close();
|
||||
return true;
|
||||
|
||||
@@ -81,7 +81,7 @@ bool PersistentStore::access_finish() {
|
||||
if (status != FLASH_COMPLETE) ACCESS_FINISHED(true);
|
||||
|
||||
const uint16_t *source = reinterpret_cast<const uint16_t*>(ram_eeprom);
|
||||
for (size_t i = 0; i < MARLIN_EEPROM_SIZE; i += 2, ++source) {
|
||||
for (size_t i = 0; i < long(MARLIN_EEPROM_SIZE); i += 2, ++source) {
|
||||
if (FLASH_ProgramHalfWord(EEPROM_PAGE0_BASE + i, *source) != FLASH_COMPLETE)
|
||||
ACCESS_FINISHED(false);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ bool PersistentStore::access_start() {
|
||||
|
||||
int bytes_read = file.read(HAL_eeprom_data, MARLIN_EEPROM_SIZE);
|
||||
if (bytes_read < 0) return false;
|
||||
for (; bytes_read < MARLIN_EEPROM_SIZE; bytes_read++)
|
||||
for (; bytes_read < long(MARLIN_EEPROM_SIZE); bytes_read++)
|
||||
HAL_eeprom_data[bytes_read] = 0xFF;
|
||||
file.close();
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user