🔧 Fix SPI_FLASH_BACKUP flag (#27934)

Followup to #27373
This commit is contained in:
ellensp 2025-06-22 09:51:30 +12:00 committed by Scott Lahteine
parent fe6eb1745f
commit cdc996dd68
4 changed files with 10 additions and 7 deletions

View file

@ -49,7 +49,8 @@ void GcodeSuite::M993() {
W25QXX.SPI_FLASH_BufferRead(buf, addr, COUNT(buf));
addr += COUNT(buf);
card.write(buf, COUNT(buf));
if (addr % (COUNT(buf) * 10) == 0) SERIAL_CHAR('.');
if (!(addr % (COUNT(buf) * 10))) SERIAL_CHAR('.');
if (!(addr % (COUNT(buf) * 32))) hal.watchdog_refresh();
}
SERIAL_ECHOLNPGM(" done");
@ -78,7 +79,8 @@ void GcodeSuite::M994() {
card.read(buf, COUNT(buf));
W25QXX.SPI_FLASH_BufferWrite(buf, addr, COUNT(buf));
addr += COUNT(buf);
if (addr % (COUNT(buf) * 10) == 0) SERIAL_CHAR('.');
if (!(addr % (COUNT(buf) * 10))) SERIAL_CHAR('.');
if (!(addr % (COUNT(buf) * 32))) hal.watchdog_refresh();
}
SERIAL_ECHOLNPGM(" done");

View file

@ -677,7 +677,3 @@
#if ANY(PID_DEBUG, PID_BED_DEBUG, PID_CHAMBER_DEBUG)
#define HAS_PID_DEBUG 1
#endif
#if ALL(SPI_FLASH, HAS_MEDIA, MARLIN_DEV_MODE)
#define SPI_FLASH_BACKUP 1
#endif

View file

@ -3593,3 +3593,8 @@
#if ANY(AUTO_BED_LEVELING_UBL, M100_FREE_MEMORY_WATCHER, DEBUG_GCODE_PARSER, TMC_DEBUG, MARLIN_DEV_MODE, DEBUG_CARDREADER, M20_TIMESTAMP_SUPPORT, HAS_STM32_UID)
#define NEED_HEX_PRINT 1
#endif
// SPI Flash Backup
#if ALL(SPI_FLASH, HAS_MEDIA, MARLIN_DEV_MODE)
#define SPI_FLASH_BACKUP 1
#endif

View file

@ -226,7 +226,7 @@
#if ENABLED(SPI_FLASH)
#define HAS_SPI_FLASH 1
#define SPI_DEVICE 2
#define SPI_FLASH_SIZE 0x1000000
#define SPI_FLASH_SIZE 0x1000000 // 16MB
#define SPI_FLASH_CS_PIN PB12
#define SPI_FLASH_MOSI_PIN PC3
#define SPI_FLASH_MISO_PIN PC2