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:
pinchies 2019-03-25 12:07:31 +11:00 committed by Scott Lahteine
parent aacc1148b0
commit ef3b93daa1

View File

@ -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);