New lang, arduino 1.8.5 - disable multilanguage support by default

This commit is contained in:
Robert Pelnar 2018-10-23 17:32:52 +02:00
parent ac18eb67c0
commit 7e9eaf0f4b
2 changed files with 12 additions and 13 deletions

View file

@ -43,9 +43,9 @@
#define W25X20CL_SPSR SPI_SPSR(W25X20CL_SPI_RATE)
//LANG - Multi-language support
//#define LANG_MODE 0 // primary language only
#define LANG_MODE 1 // sec. language support
#define LANG_SIZE_RESERVED 0x2a00 // reserved space for secondary language (~10kb)
#define LANG_MODE 0 // primary language only
//#define LANG_MODE 1 // sec. language support
#define LANG_SIZE_RESERVED 0x2a00 // reserved space for secondary language (~10kb)
#endif //_CONFIG_H

View file

@ -23,22 +23,21 @@
#define STRINGIFY_(n) #n
#define STRINGIFY(n) STRINGIFY_(n)
/** @def PROGMEM_I2
* @brief section progmem0 will be used for localized translated strings */
#define PROGMEM_I2 __attribute__((section(".loc_sec")))
/** @def PROGMEM_I1
* @brief section progmem1 will be used for localized strings in english */
#define PROGMEM_I1 __attribute__((section(".loc_pri")))
/** @def PROGMEM_N1
* @brief section progmem2 will be used for not localized strings in english */
#define PROGMEM_N1 __attribute__((section(".noloc")))
#if (LANG_MODE == 0) //primary language only
#define PROGMEM_I2 __attribute__((section(".progmem0")))
#define PROGMEM_I1 __attribute__((section(".progmem1")))
#define PROGMEM_N1 __attribute__((section(".progmem2")))
#define _I(s) (__extension__({static const char __c[] PROGMEM_I1 = s; &__c[0];}))
#define ISTR(s) s
#define _i(s) _I(s)
#define _T(s) s
#else //(LANG_MODE == 0)
// section .loc_sec (originaly .progmem0) will be used for localized translated strings
#define PROGMEM_I2 __attribute__((section(".loc_sec")))
// section .loc_pri (originaly .progmem1) will be used for localized strings in english
#define PROGMEM_I1 __attribute__((section(".loc_pri")))
// section .noloc (originaly progmem2) will be used for not localized strings in english
#define PROGMEM_N1 __attribute__((section(".noloc")))
#define _I(s) (__extension__({static const char __c[] PROGMEM_I1 = "\xff\xff" s; &__c[0];}))
#define ISTR(s) "\xff\xff" s
#define _i(s) lang_get_translation(_I(s))