Browse Source

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.
pull/1/head
pinchies 6 years ago
committed by Scott Lahteine
parent
commit
ef3b93daa1
  1. 2
      Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp

2
Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp

@ -55,7 +55,7 @@ bool PersistentStore::access_start() {
bool PersistentStore::access_finish() { bool PersistentStore::access_finish() {
if (!card.isDetected()) return false; 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); int16_t bytes_written = card.write(HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE);
card.closefile(); card.closefile();
return (bytes_written == HAL_STM32F1_EEPROM_SIZE); return (bytes_written == HAL_STM32F1_EEPROM_SIZE);

Loading…
Cancel
Save