diff --git a/Firmware/config.h b/Firmware/config.h index ae7fde070..b7ab7df7b 100644 --- a/Firmware/config.h +++ b/Firmware/config.h @@ -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 diff --git a/Firmware/language.h b/Firmware/language.h index 1e7436a3b..6b18bd396 100644 --- a/Firmware/language.h +++ b/Firmware/language.h @@ -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))