New ML support - cond.trans. for LANG_MODE 0

This commit is contained in:
Robert Pelnar 2018-06-10 16:28:15 +02:00
parent 1e35067c3f
commit 076258ff99
3 changed files with 14 additions and 2 deletions

View File

@ -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
@ -1502,6 +1510,8 @@ 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;

View File

@ -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)

View File

@ -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