Selaa lähdekoodia

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.
pinchies 6 vuotta sitten
vanhempi
commit
ef3b93daa1
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1
    1
      Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp Näytä tiedosto

55
 
55
 
56
 bool PersistentStore::access_finish() {
56
 bool PersistentStore::access_finish() {
57
   if (!card.isDetected()) return false;
57
   if (!card.isDetected()) return false;
58
-  card.openFile(eeprom_filename, true);
58
+  card.openFile(eeprom_filename, false);
59
   int16_t bytes_written = card.write(HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE);
59
   int16_t bytes_written = card.write(HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE);
60
   card.closefile();
60
   card.closefile();
61
   return (bytes_written == HAL_STM32F1_EEPROM_SIZE);
61
   return (bytes_written == HAL_STM32F1_EEPROM_SIZE);

Loading…
Peruuta
Tallenna