diff options
| author | Selene ToyKeeper | 2024-02-02 23:40:20 -0700 |
|---|---|---|
| committer | Selene ToyKeeper | 2024-02-02 23:40:20 -0700 |
| commit | bb5bb049a713034d5f2b75daccfc8431c1e63bf9 (patch) | |
| tree | 7c272249f3561f431d02c39c63816b0f67cf5f95 /fsm/eeprom.h | |
| parent | thefreeman-avr32dd20-devkit: enable boost bypass at boot, so AA/NiMH can boot (diff) | |
| download | anduril-bb5bb049a713034d5f2b75daccfc8431c1e63bf9.tar.gz anduril-bb5bb049a713034d5f2b75daccfc8431c1e63bf9.tar.bz2 anduril-bb5bb049a713034d5f2b75daccfc8431c1e63bf9.zip | |
enabled eeprom read/write stabilization by default on recent MCUs,
to prevent corrupt data
This was enabled on more build targets before, but the *_ENABLE_PIN
definition names changed and the eeprom code didn't, so it was not
compiled in for a few months on some lights which probably needed it.
To fix that, it's now enabled by default on everything bigger than
attiny85, since it doesn't really hurt anything if it's enabled when
not needed.
Diffstat (limited to '')
| -rw-r--r-- | fsm/eeprom.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fsm/eeprom.h b/fsm/eeprom.h index 1e10fd2..d5f0363 100644 --- a/fsm/eeprom.h +++ b/fsm/eeprom.h @@ -55,3 +55,11 @@ // if this marker isn't found, the eeprom is assumed to be blank #define EEP_MARKER 0b10100101 +// wait a few ms before eeprom operations, to wait for power to stabilize +// (otherwise reads or writes can get corrupt data) +// (not necessary on some hardware, +// but enabled by default when there's space) +#if defined(LED_ENABLE_PIN) || defined(LED2_ENABLE_PIN) || (ROM_SIZE > 10000) + #define USE_EEP_DELAY +#endif + |
