Skip to content
Snippets Groups Projects
Commit ef3b93da authored by pinchies's avatar pinchies Committed by Scott Lahteine
Browse files

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.
parent aacc1148
Branches
Tags
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment