12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- #ifndef LANGUAGE_H
- #define LANGUAGE_H
- #include "config.h"
- #include <inttypes.h>
- #include <stdio.h>
- #define PROTOCOL_VERSION "1.0"
- #ifdef CUSTOM_MENDEL_NAME
-
- #else
- #define MACHINE_NAME "Mendel"
- #endif
- #ifndef MACHINE_UUID
- #define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
- #endif
- #define MSG_FW_VERSION "Firmware"
- #define STRINGIFY_(n) #n
- #define STRINGIFY(n) STRINGIFY_(n)
- #define PROGMEM_I2 __attribute__((section(".progmem0")))
- #define PROGMEM_I1 __attribute__((section(".progmem1")))
- #define PROGMEM_N1 __attribute__((section(".progmem2")))
- #if (LANG_MODE == 0)
- #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
- #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))
- #define _T(s) lang_get_translation(s)
- #endif
- #define _N(s) (__extension__({static const char __c[] PROGMEM_N1 = s; &__c[0];}))
- #define _n(s) _N(s)
- #define LANG_ID_PRI 0
- #define LANG_ID_SEC 1
- #define LANG_ID_FORCE_SELECTION 254
- #define LANG_ID_UNDEFINED 255
- #define LANG_ID_DEFAULT LANG_ID_PRI
- #define LANG_NUM 2
- #if defined(__cplusplus)
- extern "C" {
- #endif
- extern uint8_t lang_selected;
- #if (LANG_MODE != 0)
- extern const char _SEC_LANG[LANG_SIZE_RESERVED];
- #endif
- extern const char* lang_get_translation(const char* s);
- extern const char* lang_get_sec_lang_str(const char* s);
- extern const char* lang_get_sec_lang_str_by_id(uint16_t id);
- extern const char* lang_select(uint8_t lang);
- extern uint8_t lang_get_count();
- extern const char* lang_get_name(uint8_t lang);
- extern uint16_t lang_print_sec_lang(FILE* out);
- #if defined(__cplusplus)
- }
- #endif
- #define CAT2(_s1, _s2) _s1
- #define CAT4(_s1, _s2, _s3, _s4) _s1
- extern const char MSG_LANGUAGE_NAME[];
- #include "messages.h"
- #endif
|