Use MARLIN_EEPROM_SIZE with E2END as fallback (#18059)

This commit is contained in:
Scott Lahteine
2020-05-22 02:15:40 -05:00
committed by GitHub
parent 31eb487da5
commit 461647fcee
49 changed files with 205 additions and 201 deletions

View File

@ -32,13 +32,13 @@
#include "../shared/eeprom_if.h"
#include "../shared/eeprom_api.h"
size_t PersistentStore::capacity() { return E2END + 1; }
bool PersistentStore::access_finish() { return true; }
#ifndef MARLIN_EEPROM_SIZE
#error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM."
#endif
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
bool PersistentStore::access_start() {
eeprom_init();
return true;
}
bool PersistentStore::access_start() { eeprom_init(); return true; }
bool PersistentStore::access_finish() { return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
while (size--) {