Skip to content

Commit

Permalink
EEPROM: Fix open error by array access in initial state
Browse files Browse the repository at this point in the history
The access of the EEPROM array causes a file open error without the
EEPROM emulation file on the SPI-Flash. To fix this issue, add
initialization process to the array access as well as other methods.
  • Loading branch information
SPRESENSE committed Jul 5, 2023
1 parent 76b9a7b commit 42f8125
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ struct EEPROMClass{
}

//Basic user access methods.
EERef operator[]( const int idx ) { return idx; }
EERef operator[]( const int idx ) { init(); return idx; }
uint8_t read( int idx ) { init(); return EERef( idx ); }
void write( int idx, uint8_t val ) { init(); (EERef( idx )) = val; }
void update( int idx, uint8_t val ) { init(); EERef( idx ).update( val ); }
Expand Down

0 comments on commit 42f8125

Please sign in to comment.