From a4d6908d556afd77cf66ef7a8adc7c34fee81674 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Wed, 2 Dec 2020 03:23:34 -0800 Subject: [PATCH] Permit SD EEPROM emulation on E3V2 (#20353) --- Marlin/src/lcd/dwin/e3v2/dwin.cpp | 4 +-- Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 32 ++++++-------------- buildroot/tests/STM32F103RET6_creality-tests | 3 +- 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.cpp b/Marlin/src/lcd/dwin/e3v2/dwin.cpp index 89ab77ba3c..5a21000698 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.cpp +++ b/Marlin/src/lcd/dwin/e3v2/dwin.cpp @@ -216,7 +216,7 @@ void HMI_SetLanguageCache() { } void HMI_SetLanguage() { - #if ENABLED(EEPROM_SETTINGS) + #if BOTH(EEPROM_SETTINGS, IIC_BL24CXX_EEPROM) BL24CXX::read(DWIN_LANGUAGE_EEPROM_ADDRESS, (uint8_t*)&HMI_flag.language, sizeof(HMI_flag.language)); #endif HMI_SetLanguageCache(); @@ -225,7 +225,7 @@ void HMI_SetLanguage() { void HMI_ToggleLanguage() { HMI_flag.language = HMI_IsChinese() ? DWIN_ENGLISH : DWIN_CHINESE; HMI_SetLanguageCache(); - #if ENABLED(EEPROM_SETTINGS) + #if BOTH(EEPROM_SETTINGS, IIC_BL24CXX_EEPROM) BL24CXX::write(DWIN_LANGUAGE_EEPROM_ADDRESS, (uint8_t*)&HMI_flag.language, sizeof(HMI_flag.language)); #endif } diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index f0c1611cb8..28ff16d4e4 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -43,30 +43,16 @@ // EEPROM // #if NO_EEPROM_SELECTED - // FLASH - //#define FLASH_EEPROM_EMULATION + #define IIC_BL24CXX_EEPROM // EEPROM on I2C-0 + //#define SDCARD_EEPROM_EMULATION +#endif - // I2C - #define IIC_BL24CXX_EEPROM // EEPROM on I2C-0 used only for display settings - #if ENABLED(IIC_BL24CXX_EEPROM) - #define IIC_EEPROM_SDA PA11 - #define IIC_EEPROM_SCL PA12 - #define MARLIN_EEPROM_SIZE 0x800 // 2Kb (24C16) - #else - #define SDCARD_EEPROM_EMULATION // SD EEPROM until all EEPROM is BL24CXX - #define MARLIN_EEPROM_SIZE 0x800 // 2Kb - #endif - - // SPI - //#define SPI_EEPROM // EEPROM on SPI-0 - //#define SPI_CHAN_EEPROM1 ? - //#define SPI_EEPROM1_CS ? - - // 2K EEPROM - //#define SPI_EEPROM2_CS ? - - // 32Mb FLASH - //#define SPI_FLASH_CS ? +#if ENABLED(IIC_BL24CXX_EEPROM) + #define IIC_EEPROM_SDA PA11 + #define IIC_EEPROM_SCL PA12 + #define MARLIN_EEPROM_SIZE 0x800 // 2Kb (24C16) +#elif ENABLED(SDCARD_EEPROM_EMULATION) + #define MARLIN_EEPROM_SIZE 0x800 // 2Kb #endif // diff --git a/buildroot/tests/STM32F103RET6_creality-tests b/buildroot/tests/STM32F103RET6_creality-tests index f0377c68f7..4e6c4f988b 100644 --- a/buildroot/tests/STM32F103RET6_creality-tests +++ b/buildroot/tests/STM32F103RET6_creality-tests @@ -15,6 +15,7 @@ exec_test $1 $2 "Ender 3 v2" "$3" use_example_configs "Creality/Ender-3 V2" opt_disable CLASSIC_JERK -exec_test $1 $2 "Ender 3 v2 w/o CLASSIC_JERK" "$3" +opt_add SDCARD_EEPROM_EMULATION +exec_test $1 $2 "Ender 3 v2, SD EEPROM, w/o CLASSIC_JERK" "$3" restore_configs