WearLeveling icon indicating copy to clipboard operation
WearLeveling copied to clipboard

Ability to designate buffer memory position / offset manually

Open dantaeusb opened this issue 4 months ago • 3 comments

I would like to use the leveling only for the variable that I know I am going to update frequently, but I do still have a fixed EEPROM memory layout. Looking at this library, it appears that while I can set the size for the leveling buffer, there's no way to put it somewhere not in the beginning of the EEPROM. I am referring to this:

uint8_t EEPROMWearLevel::getQueueTail(const uint8_t idx) {
  return idx * queueEntriesCount;
}

Perfectly, I'd like to use a volatile EEMEM variable of proper size so that the compiler does that itself), and not just put it to 0 for the 0 index. Is that by design? Any plans of adding that memory offset?

dantaeusb avatar Aug 13 '25 22:08 dantaeusb

You mean something like adding a way to start from a custom offset in EEPROM, instead of always starting the wear leveling buffer at EEPROM address 0, right?

chayanforyou avatar Aug 14 '25 03:08 chayanforyou

Yes, correct, I'm not very experienced with microcontroller code, but feels like that would be very handy.

dantaeusb avatar Aug 14 '25 08:08 dantaeusb

I’m not planning to add this right now, but if you’re interested, I’d be happy to collaborate on making it happen.

chayanforyou avatar Aug 14 '25 10:08 chayanforyou