Giter Site home page Giter Site logo

eepromwearlevel's People

Contributors

avandalen avatar gitmodu avatar per1234 avatar prosenb avatar spencekonde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

eepromwearlevel's Issues

Question: What happens if power gets cut while write is happening?

Hello!

You can see my question above.
I am wondering what happens in the unlikely case that the write happens exactly as a brownout happens.
Will the library catch that and restore to a known good state or will all the data be corrupt?

Will only the variable that gets written be corrupt? If thats the case, we could fix that by storing all values three times and comparing them.

BTW: thanks for your Lib, have a nice day!

ringBuffer and INDEX_RING_BUFFER

I'm running the ringBufffer example and it runs as expected...

but Im not clear on how to use the "AMOUNT_OF_INDEXES" , and "INDEX_RING_BUFFER".

INDEX_RING_BUFFER seems to crash the example with any value above 0,

and Im not sure how to access indexes above 1 ?

Thanks

Harry

Unnecessary write()

EEPROMWearLevel.cpp:57 is EEPROMClass::write(INDEX_VERSION, layoutVersion);
it probably should be: EEPROMClass::update(INDEX_VERSION, layoutVersion);

Minor correction in example: 18 -> 19

The example given says there are 18 bytes used, but actually there are 19: 1 version, 2 control, 16 for data (index 0 to 15).

AIUI, either we can say the region allows using actually 16 bytes to store data, and that requires 3 extra bytes, or the entire thing has 19 bytes in total, but never 18.

Am I missing something?

Description of parameters not clear

When declaring the int array to pass to the begin() method, is the int value meant as the size of one piece of data the partition is going to hold or the space that is being reserved for the respective partition?

Additionally: is the int value I pass to begin() supposed to include the bytes for control bytes and layoutVersion?

Generates warning about unused declaration for 'EEPROM'

It seems the library is declaring EEPROM but not using it. I assume this is a convenience so the project using the EEPROMWearLevel library can use EEPROM as before, but if so, it has the undesirable effect of generating a warning when not using EEPROM:

/home/eddy/opt/arduino-1.8.13/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I/home/eddy/opt/arduino-1.8.13/hardware/arduino/avr/cores/arduino -I/home/eddy/opt/arduino-1.8.13/hardware/arduino/avr/variants/eightanaloginputs -I/home/eddy/Arduino/libraries/Low-Power -I/home/eddy/Arduino/libraries/LiquidCrystal_PCF8574/src -I/home/eddy/opt/arduino-1.8.13/hardware/arduino/avr/libraries/Wire/src -I/home/eddy/Arduino/libraries/EEPROMWearLevel -I/home/eddy/opt/arduino-1.8.13/hardware/arduino/avr/libraries/EEPROM/src /home/eddy/Arduino/libraries/EEPROMWearLevel/EEPROMWearLevel.cpp -o /tmp/arduino_build_8835/libraries/EEPROMWearLevel/EEPROMWearLevel.cpp.o
In file included from /home/eddy/Arduino/libraries/EEPROMWearLevel/EEPROMWearLevel.h:23:0,
from /home/eddy/Arduino/libraries/EEPROMWearLevel/EEPROMWearLevel.cpp:2:
/home/eddy/opt/arduino-1.8.13/hardware/arduino/avr/libraries/EEPROM/src/EEPROM.h:145:20: warning: 'EEPROM' defined but not used [-Wunused-variable]
static EEPROMClass EEPROM;
^~~~~~

As EEPROMWearLevel.cpp does not seem to use EEPROM, a simple (void) EEPROM; in the EEPROMWearLevel code somewhere should be enough.

Unfortunately, the user of the library also has to do this, too. But accounting for the convenience and the fact that is code controlled by the user, they can add their silencing (void) EEPROM; statement.

missing overloading (long)

Hi Pete

This goes wrong
EEPROMwl.put(0, 125);

This goes well
EEPROMwl.put(0, (long)125);

Someting with overloading?

But the rest works fine, thank you for your library..
www.avdweb.nl
Albert

Question on efficacy of wear leveling on control bytes

Hey there! I don't have much experience in programming MCUs, so I may be misunderstanding the intent behind the code, but I noticed that you've created this concept of a control byte, whereby each bit is cleared one-by-one as you write new data to the index. Because the ATmega EEPROM writes in byte-sized blocks, each time you're clearing a bit from the control byte, it counts as a full write/erase cycle for the entire cell, meaning the control bytes will wear out approximately 8 times faster than the rest of the dataIndex cells.

If I'm understanding this correctly, was this done as a kind of trade-off to optimize for valuable EEPROM space? If I'm not understanding correctly, mind setting me straight?

Thanks!

Interrupt and write EEPROM

Hello!
Thank you for you library EEPROMWearLevel, it's really usefull.
I have one problem, when I use EEPROMwl.put function, Timer1 stop short time,
but and I have some problem.
Can I fix it?

Compiler error: 'EEPROMwl' was declared 'extern' and later 'static' [-fpermissive]

I get compiler errors when trying to compile the SimpleConfiguration.ino example using Arduino 1.8. The complete error message is pasted below:

`
C:\Users\me\Documents\Arduino\libraries\EEPROMWearLevel\EEPROMWearLevel.cpp:4:24: error: 'EEPROMwl' was declared 'extern' and later 'static' [-fpermissive]

static EEPROMWearLevel EEPROMwl;

                    ^

In file included from C:\Users\me\Documents\Arduino\libraries\EEPROMWearLevel\EEPROMWearLevel.cpp:2:0:

C:\Users\me\Documents\Arduino\libraries\EEPROMWearLevel\EEPROMWearLevel.h:323:24: note: previous declaration of 'EEPROMwl'

extern EEPROMWearLevel EEPROMwl;

                    ^

Using library EEPROMWearLevel at version 1.0.0 in folder: C:\Users\me\Documents\Arduino\libraries\EEPROMWearLevel
Using library EEPROM at version 2.0 in folder: C:\Users\me\Documents\Arduino\hardware\arduino\avr\libraries\EEPROM
exit status 1
Error compiling for board Arduino/Genuino Uno.
`

Troubles using the ATtiny3217

Dear Pete
I have troubles using the ATtiny3217
https://github.com/SpenceKonde/megaTinyCore

The error is:
'EECR' was not declared in this scope

Note that the standard Arduino library EEPROM.h still works fine on the ATtiny3217, see this sketch:

#include <EEPROM.h>  
void setup() 
{ Serial.begin(9600);
  while(!Serial);
  float f = 123.456f;  
  int eeAddress = 0;   
  EEPROM.put(eeAddress, f);
  EEPROM.get(eeAddress, f);
  Serial.println(f, 3);   
}
void loop() 
{
}

So, I think it is not a big compatiblity issue.

I have looked for a solution, but I don’t have enough knowledge of the Arduino platform.
Maybe you can talk to Spence Konde what to do.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.