arduino / arduino/ArduinoCore-avr

REQUEST: EEPROM.update() should return whether or not a value was written

Open
#123 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
1.5k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

The EEPROM.update() function is the preferred way of writing to the built in EEPROM as it will only perform a write operation if the current value is different, thus not performing unneeded writes.

Currently however there is no way of knowing whether this function performed a write operation or not. In most cases this is not required, however given that writes take approximately 3ms to complete, performing a large number of these at a time can cause significant delays in time critical applications.

If the update() function was to return a 1 if the write operation was performed an 0 if it wasn't, a sketch could easily track how many writes have been performed and limit their frequency if they are taking too long. Currently the update() function is void, so making this change should not impact any existing sketches.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the EEPROM.update() implementation and its current callers in the Arduino AVR core. Trace how it decides whether the current value differs, then verify that the public result distinguishes a write from a skipped write while preserving existing update behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.