Fix STM32F1 SD-based EEPROM emulation (#13475)
If `openFile` is given `true`, then it has read-only access. Because all the writing occurs on the next line, this breaks SD card as EEPROM.
This commit is contained in:
parent
aacc1148b0
commit
ef3b93daa1
1 changed files with 1 additions and 1 deletions
|
@ -55,7 +55,7 @@ bool PersistentStore::access_start() {
|
|||
|
||||
bool PersistentStore::access_finish() {
|
||||
if (!card.isDetected()) return false;
|
||||
card.openFile(eeprom_filename, true);
|
||||
card.openFile(eeprom_filename, false);
|
||||
int16_t bytes_written = card.write(HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE);
|
||||
card.closefile();
|
||||
return (bytes_written == HAL_STM32F1_EEPROM_SIZE);
|
||||
|
|
Reference in a new issue