Cleanup, comment "wired" eeproms

This commit is contained in:
Scott Lahteine 2020-04-30 17:33:20 -05:00
parent a521b0edbb
commit 3c080ee3e6
10 changed files with 57 additions and 9 deletions

View file

@ -25,6 +25,11 @@
#if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE) #if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
/**
* PersistentStore for Arduino-style EEPROM interface
* with implementations supplied by the framework.
*/
#include "../shared/eeprom_api.h" #include "../shared/eeprom_api.h"
size_t PersistentStore::capacity() { return E2END + 1; } size_t PersistentStore::capacity() { return E2END + 1; }

View file

@ -26,6 +26,11 @@
#if USE_WIRED_EEPROM #if USE_WIRED_EEPROM
/**
* PersistentStore for Arduino-style EEPROM interface
* with simple implementations supplied by Marlin.
*/
#include "../shared/eeprom_if.h" #include "../shared/eeprom_if.h"
#include "../shared/eeprom_api.h" #include "../shared/eeprom_api.h"

View file

@ -25,20 +25,25 @@
#if USE_WIRED_EEPROM #if USE_WIRED_EEPROM
#include "../shared/eeprom_if.h" /**
* PersistentStore for Arduino-style EEPROM interface
* with implementations supplied by the framework.
*/
#include "../shared/eeprom_api.h" #include "../shared/eeprom_api.h"
#ifndef EEPROM_SIZE #ifndef EEPROM_SIZE
#define EEPROM_SIZE 0x8000 // 32kB #define EEPROM_SIZE 0x8000 // 32kB
#endif #endif
size_t PersistentStore::capacity() { return EEPROM_SIZE; }
bool PersistentStore::access_finish() { return true; }
bool PersistentStore::access_start() { bool PersistentStore::access_start() {
TERN_(SPI_EEPROM, eeprom_init()); TERN_(SPI_EEPROM, eeprom_init());
return true; return true;
} }
bool PersistentStore::access_finish() { return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
while (size--) { while (size--) {
uint8_t v = *value; uint8_t v = *value;
@ -75,7 +80,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false; return false;
} }
size_t PersistentStore::capacity() { return EEPROM_SIZE; }
#endif // USE_WIRED_EEPROM #endif // USE_WIRED_EEPROM
#endif // TARGET_LPC1768 #endif // TARGET_LPC1768

View file

@ -24,6 +24,11 @@
#if USE_WIRED_EEPROM #if USE_WIRED_EEPROM
/**
* PersistentStore for Arduino-style EEPROM interface
* with simple implementations supplied by Marlin.
*/
#include "../shared/eeprom_if.h" #include "../shared/eeprom_if.h"
#include "../shared/eeprom_api.h" #include "../shared/eeprom_api.h"

View file

@ -26,14 +26,21 @@
#if USE_WIRED_EEPROM #if USE_WIRED_EEPROM
/**
* PersistentStore for Arduino-style EEPROM interface
* with simple implementations supplied by Marlin.
*/
#include "../shared/eeprom_if.h" #include "../shared/eeprom_if.h"
#include "../shared/eeprom_api.h" #include "../shared/eeprom_api.h"
size_t PersistentStore::capacity() { return E2END + 1; } size_t PersistentStore::capacity() { return E2END + 1; }
bool PersistentStore::access_start() { return true; }
bool PersistentStore::access_finish() { return true; } bool PersistentStore::access_finish() { return true; }
bool PersistentStore::access_start() {
return true;
}
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
while (size--) { while (size--) {
uint8_t v = *value; uint8_t v = *value;

View file

@ -23,6 +23,11 @@
#if USE_WIRED_EEPROM #if USE_WIRED_EEPROM
/**
* PersistentStore for Arduino-style EEPROM interface
* with simple implementations supplied by Marlin.
*/
#include "../shared/eeprom_if.h" #include "../shared/eeprom_if.h"
#include "../shared/eeprom_api.h" #include "../shared/eeprom_api.h"

View file

@ -24,7 +24,12 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ENABLED(EEPROM_SETTINGS) #if USE_WIRED_EEPROM
/**
* PersistentStore for Arduino-style EEPROM interface
* with simple implementations supplied by Marlin.
*/
#include "../shared/eeprom_if.h" #include "../shared/eeprom_if.h"
#include "../shared/eeprom_api.h" #include "../shared/eeprom_api.h"
@ -33,6 +38,10 @@ size_t PersistentStore::capacity() { return E2END + 1; }
bool PersistentStore::access_start() { return true; } bool PersistentStore::access_start() { return true; }
bool PersistentStore::access_finish() { return true; } bool PersistentStore::access_finish() { return true; }
bool PersistentStore::access_start() {
return true;
}
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
while (size--) { while (size--) {
uint8_t * const p = (uint8_t * const)pos; uint8_t * const p = (uint8_t * const)pos;
@ -64,5 +73,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false; return false;
} }
#endif // EEPROM_SETTINGS #endif // USE_WIRED_EEPROM
#endif // STM32GENERIC && (STM32F4 || STM32F7) #endif // STM32GENERIC && (STM32F4 || STM32F7)

View file

@ -26,5 +26,4 @@
#undef SRAM_EEPROM_EMULATION #undef SRAM_EEPROM_EMULATION
#undef SDCARD_EEPROM_EMULATION #undef SDCARD_EEPROM_EMULATION
#define FLASH_EEPROM_EMULATION #define FLASH_EEPROM_EMULATION
#warning "Forcing use of FLASH_EEPROM_EMULATION."
#endif #endif

View file

@ -22,6 +22,11 @@
#if USE_WIRED_EEPROM #if USE_WIRED_EEPROM
/**
* PersistentStore for Arduino-style EEPROM interface
* with implementations supplied by the framework.
*/
#include "../shared/eeprom_api.h" #include "../shared/eeprom_api.h"
bool PersistentStore::access_start() { return true; } bool PersistentStore::access_start() { return true; }

View file

@ -26,6 +26,11 @@
#if USE_WIRED_EEPROM #if USE_WIRED_EEPROM
/**
* PersistentStore for Arduino-style EEPROM interface
* with implementations supplied by the framework.
*/
#include "../shared/eeprom_api.h" #include "../shared/eeprom_api.h"
#include <avr/eeprom.h> #include <avr/eeprom.h>