File tree Expand file tree Collapse file tree 3 files changed +9
-10
lines changed
examples/Example2_AllFunctions Expand file tree Collapse file tree 3 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ void setup()
3030
3131 long startTime;
3232 long endTime;
33- uint16_t randomLocation;
33+ int randomLocation;
3434
3535 // Test erase time
3636 startTime = millis ();
Original file line number Diff line number Diff line change 4343// Write a byte to a given "EEPROM" location
4444void write (uint16_t eepromLocation, uint8_t dataToWrite)
4545{
46- EEPROM. writeBlockToEEPROM (eepromLocation, &dataToWrite, 1 );
46+ writeBlockToEEPROM (eepromLocation, &dataToWrite, 1 );
4747}
4848
4949// Read a byte from a given location in "EEPROM"
@@ -65,7 +65,7 @@ void EEPROMClass::erase()
6565// 2) Record user data into SRAM. Check if new data is different from flash.
6666// 3) Erase flash page (8k)
6767// 4) Write SRAM back into flash
68- void EEPROMClass:: writeBlockToEEPROM (uint16_t eepromLocation, const uint8_t *dataToWrite, uint16_t blockSize)
68+ void writeBlockToEEPROM (uint16_t eepromLocation, const uint8_t *dataToWrite, uint16_t blockSize)
6969{
7070 // Error check
7171 if (eepromLocation + blockSize >= AP3_FLASH_EEPROM_SIZE)
Original file line number Diff line number Diff line change 6464Error : EEPROM start address must be divisble by 8192
6565#endif
6666
67- // By limiting EEPROM size to 1024 bytes, we reduce the amount of SRAM required and
68- // time needed to mask in individual bytes and words into flash. It can be increased
69- // to 8096 if needed
70- # define AP3_FLASH_EEPROM_SIZE 1024 // In bytes
67+ // By limiting EEPROM size to 1024 bytes, we reduce the amount of SRAM required and
68+ // time needed to read/write words into flash. It can be increased
69+ // to 8096 if needed
70+ const int AP3_FLASH_EEPROM_SIZE = 1024 * 2 ; // In bytes
7171
72- uint8_t
73- read (uint16_t eepromLocation);
72+ uint8_t read (uint16_t eepromLocation);
7473void write (uint16_t eepromLocation, uint8_t dataToWrite);
74+ void writeBlockToEEPROM (uint16_t eepromLocation, const uint8_t *dataToWrite, uint16_t blockSize);
7575
7676struct EERef
7777{
@@ -164,7 +164,6 @@ struct EEPROMClass
164164 void write (int idx, uint8_t val) { (EERef (idx)) = val; }
165165 void update (int idx, uint8_t val) { EERef (idx).update (val); }
166166 void erase ();
167- void writeBlockToEEPROM (uint16_t eepromLocation, const uint8_t *dataToWrite, uint16_t blockSize);
168167
169168 // STL and C++11 iteration capability.
170169 EEPtr
You can’t perform that action at this time.
0 commit comments