From 076258ff9945c08aa9b7165793ea15a9a3981565 Mon Sep 17 00:00:00 2001 From: Robert Pelnar Date: Sun, 10 Jun 2018 16:28:15 +0200 Subject: [PATCH] New ML support - cond.trans. for LANG_MODE 0 --- Firmware/Marlin_main.cpp | 12 +++++++++++- Firmware/config.h | 2 +- Firmware/language.c | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 419c5597..f2d8b8ab 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -989,6 +989,8 @@ void erase_eeprom_section(uint16_t offset, uint16_t bytes) } +#if (LANG_MODE != 0) //secondary language support + #ifdef W25X20CL #include "bootapp.h" //bootloader support @@ -1076,6 +1078,8 @@ void list_sec_lang_from_external_flash() #endif //W25X20CL +#endif //(LANG_MODE != 0) + // "Setup" function is called by the Arduino framework on startup. // Before startup, the Timers-functions (PWM)/Analog RW and HardwareSerial provided by the Arduino-code @@ -1089,12 +1093,14 @@ void setup() lcd_splash(); +#if (LANG_MODE != 0) //secondary language support #ifdef W25X20CL if (w25x20cl_init()) update_sec_lang_from_external_flash(); else kill(_i("External SPI flash W25X20CL not responding.")); #endif //W25X20CL +#endif //(LANG_MODE != 0) setup_killpin(); setup_powerhold(); @@ -1478,6 +1484,8 @@ void setup() // is being written into the EEPROM, so the update procedure will be triggered only once. +#if (LANG_MODE != 0) //secondary language support + #ifdef DEBUG_W25X20CL W25X20CL_SPI_ENTER(); uint8_t uid[8]; // 64bit unique id @@ -1501,7 +1509,9 @@ void setup() // lang_print_sec_lang(uartout); #endif //DEBUG_SEC_LANG - + +#endif //(LANG_MODE != 0) + if (eeprom_read_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE) == 255) { eeprom_write_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); temp_cal_active = false; diff --git a/Firmware/config.h b/Firmware/config.h index a9172429..43691453 100644 --- a/Firmware/config.h +++ b/Firmware/config.h @@ -28,7 +28,7 @@ //LANG - Multi-language support //#define LANG_MODE 0 // primary language only -#define LANG_MODE 1 // sec. language support +#define LANG_MODE 0 // sec. language support #define LANG_SIZE_RESERVED 0x2700 // reserved space for secondary language (~10kb) //#define LANG_SIZE_RESERVED 0x1ef8 // reserved space for secondary language (~10kb) diff --git a/Firmware/language.c b/Firmware/language.c index 7ee7902e..acac7d1b 100644 --- a/Firmware/language.c +++ b/Firmware/language.c @@ -20,6 +20,8 @@ uint8_t lang_select(uint8_t lang) { return 0; } uint8_t lang_get_count() { return 1; } uint16_t lang_get_code(uint8_t lang) { return LANG_CODE_EN; } const char* lang_get_name_by_code(uint16_t code) { return _n("English"); } +void lang_reset(void) { } +uint8_t lang_is_selected(void) { return 1; } #else //(LANG_MODE == 0) //secondary languages in progmem or xflash