LPC176x SPI / I2C PersistentStore (#17651)
This commit is contained in:
		@@ -28,13 +28,8 @@
 | 
			
		||||
 | 
			
		||||
#include "../shared/eeprom_api.h"
 | 
			
		||||
 | 
			
		||||
bool PersistentStore::access_start() {
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool PersistentStore::access_finish() {
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
bool PersistentStore::access_start()  { 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--) {
 | 
			
		||||
@@ -84,13 +79,7 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
size_t PersistentStore::capacity() {
 | 
			
		||||
  return (
 | 
			
		||||
    #if USE_WIRED_EEPROM
 | 
			
		||||
      E2END + 1
 | 
			
		||||
    #else
 | 
			
		||||
      4096 // 4kB
 | 
			
		||||
    #endif
 | 
			
		||||
  );
 | 
			
		||||
  return TERN(USE_WIRED_EEPROM, E2END + 1, 4096); // 4K for emulated
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif // USE_WIRED_EEPROM || SRAM_EEPROM_EMULATION
 | 
			
		||||
 
 | 
			
		||||
@@ -21,7 +21,7 @@
 | 
			
		||||
 */
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
// If no real EEPROM, Flash emulation, or SRAM emulation is available fall back to SD emulation
 | 
			
		||||
// If no real or emulated EEPROM selected, fall back to SD emulation
 | 
			
		||||
#if USE_FALLBACK_EEPROM
 | 
			
		||||
  #define SDCARD_EEPROM_EMULATION
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user