diff --git a/src/Makefile b/src/Makefile index 89416b2f1..593023af2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -55,7 +55,6 @@ DELAY = 5 PCB = 9X # PCB revision -# Values: REVA, REVB PCBREV = # Enable JETI-Telemetry or FrSky Telemetry reception on UART0 @@ -557,6 +556,8 @@ ifeq ($(PCB), TARANIS) ARCH = ARM ifeq ($(PCBREV), REV3) CPPDEFS = -DREV3 + else ifeq ($(PCBREV), REV4a) + CPPDEFS = -DREV4a else CPPDEFS = -DREV4 endif @@ -650,8 +651,12 @@ FORMAT = ihex TARGET = opentx # List C++ source files here. (C dependencies are automatically generated.) -STD_TTS_SRC = translations/tts_$(shell sh -c "echo $(TTS) | tr '[:upper:]' '[:lower:]'").cpp -TTS_SRC = $(shell sh -c "if test -f $(STD_TTS_SRC); then echo $(STD_TTS_SRC); else echo translations/tts_en.cpp; fi") +ifeq ($(PCB), $(filter $(PCB), SKY9X TARANIS)) + TTS_SRC = translations/tts_en.cpp translations/tts_fr.cpp translations/tts_it.cpp +else + STD_TTS_SRC = translations/tts_$(shell sh -c "echo $(TTS) | tr '[:upper:]' '[:lower:]'").cpp + TTS_SRC = $(shell sh -c "if test -f $(STD_TTS_SRC); then echo $(STD_TTS_SRC); else echo translations/tts_en.cpp; fi") +endif CPPSRC += opentx.cpp $(PULSESSRC) stamp.cpp gui/menus.cpp gui/menu_model.cpp gui/menu_general.cpp gui/view_main.cpp gui/view_statistics.cpp $(EEPROMSRC) lcd.cpp keys.cpp maths.cpp translations.cpp $(TTS_SRC) diff --git a/src/audio_arm.cpp b/src/audio_arm.cpp index 32d1328c3..3915983b2 100644 --- a/src/audio_arm.cpp +++ b/src/audio_arm.cpp @@ -97,7 +97,8 @@ void refreshSystemAudioFiles() info.lfsize = sizeof(lfn); #endif - char filename[32] = SYSTEM_SOUNDS_PATH "/"; + char filename[32] = SYSTEM_SOUNDS_PATH "/en/"; + strncpy(filename+sizeof(SYSTEM_SOUNDS_PATH), currentLanguagePack->id, 2); assert(sizeof(audioFilenames)==AU_FRSKY_FIRST*sizeof(char *)); assert(sizeof(sdAvailableSystemAudioFiles)*8 > AU_FRSKY_FIRST); @@ -105,8 +106,8 @@ void refreshSystemAudioFiles() uint32_t availableAudioFiles = 0; for (uint32_t i=0; iid, 2); + strcpy(filename+sizeof(SYSTEM_SOUNDS_PATH)+3, audioFilenames[i]); + strcat(filename+sizeof(SYSTEM_SOUNDS_PATH)+3, SOUNDS_EXT); return true; } } @@ -914,10 +916,11 @@ void pushPrompt(uint16_t prompt, uint8_t id) { #if defined(SDCARD) - char filename[] = SYSTEM_SOUNDS_PATH "/0000" SOUNDS_EXT; + char filename[] = SYSTEM_SOUNDS_PATH "/en/0000" SOUNDS_EXT; + strncpy(filename+sizeof(SYSTEM_SOUNDS_PATH), currentLanguagePack->id, 2); for (int8_t i=3; i>=0; i--) { - filename[sizeof(SYSTEM_SOUNDS_PATH)+i] = '0' + (prompt%10); + filename[sizeof(SYSTEM_SOUNDS_PATH)+3+i] = '0' + (prompt%10); prompt /= 10; } diff --git a/src/audio_arm.h b/src/audio_arm.h index 95b34546a..de77fe32f 100644 --- a/src/audio_arm.h +++ b/src/audio_arm.h @@ -205,6 +205,7 @@ void audioStart(); extern void pushPrompt(uint16_t prompt, uint8_t id=0); +#define I18N_PLAY_FUNCTION(lng, x, ...) void lng ## _ ## x(__VA_ARGS__, uint8_t id) #define PLAY_FUNCTION(x, ...) void x(__VA_ARGS__, uint8_t id) #define PUSH_NUMBER_PROMPT(p) pushPrompt((p), id) #define PLAY_NUMBER(n, u, a) playNumber((n), (u), (a), id) diff --git a/src/audio_avr.h b/src/audio_avr.h index cae83183a..eaa382984 100644 --- a/src/audio_avr.h +++ b/src/audio_avr.h @@ -38,8 +38,8 @@ #define audio_h #if defined(PCBSTD) -#define SPEAKER_ON BUZZER_ON -#define SPEAKER_OFF toneFreq=0; BUZZER_OFF + #define SPEAKER_ON BUZZER_ON + #define SPEAKER_OFF toneFreq=0; BUZZER_OFF #endif //audio diff --git a/src/eeprom_raw.cpp b/src/eeprom_raw.cpp index 234080cbf..526aade7e 100644 --- a/src/eeprom_raw.cpp +++ b/src/eeprom_raw.cpp @@ -477,7 +477,17 @@ void eeReadAll() eeLoadModelHeaders() ; } - stickMode = g_eeGeneral.stickMode; // TODO common! + // TODO common! + stickMode = g_eeGeneral.stickMode; + +#if defined(CPUARM) + for (uint8_t i=0; languagePacks[i]!=NULL; i++) { + if (!strncmp(g_eeGeneral.ttsLanguage, languagePacks[i]->id, 2)) { + currentLanguagePackIdx = i; + currentLanguagePack = languagePacks[i]; + } + } +#endif } void eeWaitFinished() diff --git a/src/eeprom_rlc.cpp b/src/eeprom_rlc.cpp index 8a3b5b62b..40963ca66 100644 --- a/src/eeprom_rlc.cpp +++ b/src/eeprom_rlc.cpp @@ -1003,6 +1003,16 @@ void eeReadAll() } stickMode = g_eeGeneral.stickMode; + +#if defined(CPUARM) + for (uint8_t i=0; languagePacks[i]!=NULL; i++) { + if (!strncmp(g_eeGeneral.ttsLanguage, languagePacks[i]->id, 2)) { + currentLanguagePackIdx = i; + currentLanguagePack = languagePacks[i]; + } + } +#endif + #if !defined(CPUARM) eeLoadModel(g_eeGeneral.currModel); #endif diff --git a/src/eeprom_rlc.h b/src/eeprom_rlc.h index aa6e70a5e..94458e684 100644 --- a/src/eeprom_rlc.h +++ b/src/eeprom_rlc.h @@ -41,10 +41,10 @@ #if defined(PCBTARANIS) #define blkid_t uint16_t - #if defined(REV3) - #define EESIZE (32*1024) - #else + #if defined(REV4a) #define EESIZE (64*1024) + #else + #define EESIZE (32*1024) #endif #define EEFS_VERS 5 #define MAXFILES 62 diff --git a/src/gui/menu_general.cpp b/src/gui/menu_general.cpp index 74a3652d5..6b6e94d22 100644 --- a/src/gui/menu_general.cpp +++ b/src/gui/menu_general.cpp @@ -40,6 +40,19 @@ const pm_uchar sticks[] PROGMEM = { #include "../bitmaps/sticks.lbm" }; +#if defined(CPUARM) +extern LanguagePack enLanguagePack; +extern LanguagePack frLanguagePack; +extern LanguagePack itLanguagePack; +LanguagePack * languagePacks[] = { + // alphabetical order + &enLanguagePack, + &frLanguagePack, + &itLanguagePack, + NULL +}; +#endif + enum EnumTabDiag { e_Setup, IF_SDCARD(e_Sd) @@ -147,6 +160,7 @@ enum menuGeneralSetupItems { IF_FRSKY(ITEM_SETUP_TIMEZONE) IF_FRSKY(ITEM_SETUP_GPSFORMAT) IF_PXX(ITEM_SETUP_COUNTRYCODE) + IF_CPUARM(ITEM_SETUP_LANGUAGE) IF_CPUARM(ITEM_SETUP_IMPERIAL) ITEM_SETUP_RX_CHANNEL_ORD, ITEM_SETUP_STICK_MODE_LABELS, @@ -166,7 +180,7 @@ void menuGeneralSetup(uint8_t event) } #endif - MENU(STR_MENURADIOSETUP, menuTabDiag, e_Setup, ITEM_SETUP_MAX+1, {0, IF_RTCLOCK(2) IF_RTCLOCK(2) IF_BATTGRAPH(1) LABEL(SOUND), IF_AUDIO(0) IF_BUZZER(0) 0, IF_AUDIO(0) IF_VOICE(0) IF_HAPTIC(LABEL(HAPTIC)) IF_HAPTIC(0) IF_HAPTIC(0) IF_HAPTIC(0) IF_PCBSKY9X(0) IF_9X(0) LABEL(ALARMS), 0, IF_PCBSKY9X(0) IF_PCBSKY9X(0) 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, IF_SPLASH(0) IF_FRSKY(0) IF_FRSKY(0) IF_PXX(0) IF_CPUARM(0) 0, LABEL(TX_MODE), CASE_PCBTARANIS(0) 1/*to force edit mode*/}); + MENU(STR_MENURADIOSETUP, menuTabDiag, e_Setup, ITEM_SETUP_MAX+1, {0, IF_RTCLOCK(2) IF_RTCLOCK(2) IF_BATTGRAPH(1) LABEL(SOUND), IF_AUDIO(0) IF_BUZZER(0) 0, IF_AUDIO(0) IF_VOICE(0) IF_HAPTIC(LABEL(HAPTIC)) IF_HAPTIC(0) IF_HAPTIC(0) IF_HAPTIC(0) IF_PCBSKY9X(0) IF_9X(0) LABEL(ALARMS), 0, IF_PCBSKY9X(0) IF_PCBSKY9X(0) 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, IF_SPLASH(0) IF_FRSKY(0) IF_FRSKY(0) IF_PXX(0) IF_CPUARM(0) IF_CPUARM(0) 0, LABEL(TX_MODE), CASE_PCBTARANIS(0) 1/*to force edit mode*/}); uint8_t sub = m_posVert - 1; @@ -481,6 +495,18 @@ void menuGeneralSetup(uint8_t event) #endif #if defined(CPUARM) + case ITEM_SETUP_LANGUAGE: + lcd_putsLeft(y, PSTR("Language")); + lcd_putsAtt(RADIO_SETUP_2ND_COLUMN, y, currentLanguagePack->name, attr); + if (attr) { + currentLanguagePackIdx = checkIncDec(event, currentLanguagePackIdx, 0, DIM(languagePacks)-2, EE_GENERAL); + if (checkIncDec_Ret) { + currentLanguagePack = languagePacks[currentLanguagePackIdx]; + strncpy(g_eeGeneral.ttsLanguage, currentLanguagePack->id, 2); + } + } + break; + case ITEM_SETUP_IMPERIAL: g_eeGeneral.imperial = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_UNITSSYSTEM, STR_VUNITSSYSTEM, g_eeGeneral.imperial, 0, 1, attr, event); break; diff --git a/src/gui/menu_model.cpp b/src/gui/menu_model.cpp index bfff52732..18159af11 100644 --- a/src/gui/menu_model.cpp +++ b/src/gui/menu_model.cpp @@ -4039,7 +4039,9 @@ void onCustomFunctionsMenu(const char *result) int8_t sub = m_posVert - 1; if (result == STR_UPDATE_LIST) { - if (!listSdFiles(SOUNDS_PATH, SOUNDS_EXT, sizeof(g_model.funcSw[sub].param), NULL)) { + char directory[] = SOUNDS_PATH "/en"; + strncpy(directory+sizeof(SOUNDS_PATH), currentLanguagePack->id, 2); + if (!listSdFiles(directory, SOUNDS_EXT, sizeof(g_model.funcSw[sub].param), NULL)) { POPUP_WARNING(STR_NO_SOUNDS_ON_SD); s_menu_flags = 0; } @@ -4163,7 +4165,9 @@ void menuModelCustomFunctions(uint8_t event) lcd_putsiAtt(x, y, STR_VCSWFUNC, 0, attr); if (active && event==EVT_KEY_BREAK(KEY_ENTER)) { s_editMode = 0; - if (listSdFiles(SOUNDS_PATH, SOUNDS_EXT, sizeof(sd->param.name), sd->param.name)) { + char directory[] = SOUNDS_PATH "/en"; + strncpy(directory+sizeof(SOUNDS_PATH), currentLanguagePack->id, 2); + if (listSdFiles(directory, SOUNDS_EXT, sizeof(sd->param.name), sd->param.name)) { menuHandler = onCustomFunctionsMenu; } else { @@ -4324,16 +4328,20 @@ enum menuModelTelemetryItems { ITEM_TELEMETRY_A1_LABEL, ITEM_TELEMETRY_A1_RANGE, ITEM_TELEMETRY_A1_OFFSET, +#if !defined(PCBTARANIS) ITEM_TELEMETRY_A1_ALARM1, ITEM_TELEMETRY_A1_ALARM2, +#endif ITEM_TELEMETRY_A2_LABEL, ITEM_TELEMETRY_A2_RANGE, ITEM_TELEMETRY_A2_OFFSET, +#if !defined(PCBTARANIS) ITEM_TELEMETRY_A2_ALARM1, ITEM_TELEMETRY_A2_ALARM2, ITEM_TELEMETRY_RSSI_LABEL, ITEM_TELEMETRY_RSSI_ALARM1, ITEM_TELEMETRY_RSSI_ALARM2, +#endif #if defined(FRSKY_HUB) || defined(WS_HOW_HIGH) ITEM_TELEMETRY_USR_LABEL, #if !defined(PCBTARANIS) @@ -4392,9 +4400,17 @@ enum menuModelTelemetryItems { #define TELEM_BARS_COLMAX (14*FW-3) #endif +#if defined(PCBTARANIS) + #define CHANNEL_ROWS (uint8_t)-1, 1, 0, + #define RSSI_ROWS +#else + #define CHANNEL_ROWS (uint8_t)-1, 1, 0, 2, 2, + #define RSSI_ROWS (uint8_t)-1, 1, 1, +#endif + void menuModelTelemetry(uint8_t event) { - MENU(STR_MENUTELEMETRY, menuTabModel, e_Telemetry, ITEM_TELEMETRY_MAX+1, {0, (uint8_t)-1, 1, 0, 2, 2, (uint8_t)-1, 1, 0, 2, 2, (uint8_t)-1, 1, 1, USRDATA_LINES 0, 0, IF_VARIO((uint8_t)-1) IF_VARIO(0) IF_VARIO(3) 0, 2, 2, 2, 2, 0, 2, 2, 2, IF_CPUARM(2) IF_CPUARM(0) IF_CPUARM(2) IF_CPUARM(2) IF_CPUARM(2) 2 }); + MENU(STR_MENUTELEMETRY, menuTabModel, e_Telemetry, ITEM_TELEMETRY_MAX+1, {0, CHANNEL_ROWS CHANNEL_ROWS RSSI_ROWS USRDATA_LINES 0, 0, IF_VARIO((uint8_t)-1) IF_VARIO(0) IF_VARIO(3) 0, 2, 2, 2, 2, 0, 2, 2, 2, IF_CPUARM(2) IF_CPUARM(0) IF_CPUARM(2) IF_CPUARM(2) IF_CPUARM(2) 2 }); uint8_t sub = m_posVert - 1; @@ -4404,9 +4420,9 @@ void menuModelTelemetry(uint8_t event) #if !defined(PCBTARANIS) case EVT_KEY_BREAK(KEY_LEFT): case EVT_KEY_BREAK(KEY_RIGHT): -#endif if (s_editMode>0 && sub<=ITEM_TELEMETRY_RSSI_ALARM2) frskySendAlarms(); // update FrSky module when edit mode exited +#endif break; } @@ -4459,6 +4475,7 @@ void menuModelTelemetry(uint8_t event) if (attr) channel.offset = checkIncDec(event, channel.offset, -256, 256, EE_MODEL); break; +#if !defined(PCBTARANIS) case ITEM_TELEMETRY_A1_ALARM1: case ITEM_TELEMETRY_A1_ALARM2: case ITEM_TELEMETRY_A2_ALARM1: @@ -4516,6 +4533,7 @@ void menuModelTelemetry(uint8_t event) } break; } +#endif #if defined(FRSKY_HUB) || defined(WS_HOW_HIGH) case ITEM_TELEMETRY_USR_LABEL: diff --git a/src/myeeprom.h b/src/myeeprom.h index 28d4afa84..323d0d8cb 100644 --- a/src/myeeprom.h +++ b/src/myeeprom.h @@ -209,7 +209,8 @@ enum BeeperMode { uint8_t sticksGain; \ uint8_t rotarySteps; \ uint8_t countryCode; \ - uint8_t imperial; + uint8_t imperial; \ + char ttsLanguage[2]; #elif defined(PXX) #define EXTRA_GENERAL_FIELDS uint8_t countryCode; #else diff --git a/src/opentx.cpp b/src/opentx.cpp index e2498306c..4f1bc30c8 100644 --- a/src/opentx.cpp +++ b/src/opentx.cpp @@ -2422,11 +2422,12 @@ uint8_t fnSwitchDuration[NUM_CFN] = { 0 }; inline void playCustomFunctionFile(CustomFnData *sd, uint8_t id) { - char lfn[] = SOUNDS_PATH "/xxxxxx.wav"; - strncpy(lfn+sizeof(SOUNDS_PATH), sd->param.name, sizeof(sd->param.name)); - lfn[sizeof(SOUNDS_PATH)+sizeof(sd->param.name)] = '\0'; - strcat(lfn+sizeof(SOUNDS_PATH), SOUNDS_EXT); - PLAY_FILE(lfn, sd->func==FUNC_BACKGND_MUSIC ? PLAY_BACKGROUND : 0, id); + char filename[] = SOUNDS_PATH "/en/xxxxxx.wav"; + strncpy(filename+sizeof(SOUNDS_PATH), currentLanguagePack->id, 2); + strncpy(filename+sizeof(SOUNDS_PATH)+3, sd->param.name, sizeof(sd->param.name)); + filename[sizeof(SOUNDS_PATH)+3+sizeof(sd->param.name)] = '\0'; + strcat(filename+sizeof(SOUNDS_PATH)+3, SOUNDS_EXT); + PLAY_FILE(filename, sd->func==FUNC_BACKGND_MUSIC ? PLAY_BACKGROUND : 0, id); } #endif diff --git a/src/targets/gruvin9x/somo14d.h b/src/targets/gruvin9x/somo14d.h index d43b41319..4195042cb 100644 --- a/src/targets/gruvin9x/somo14d.h +++ b/src/targets/gruvin9x/somo14d.h @@ -41,6 +41,7 @@ extern void pushPrompt(uint16_t prompt); extern bool isPlaying(); +#define I18N_PLAY_FUNCTION(lng, x, ...) void x(__VA_ARGS__) #define PLAY_FUNCTION(x, ...) void x(__VA_ARGS__) #define PUSH_CUSTOM_PROMPT(p, id) pushPrompt(PROMPT_CUSTOM_BASE+(p)) #define PUSH_NUMBER_PROMPT(p) pushPrompt(PROMPT_I18N_BASE+(p)) diff --git a/src/targets/sky9x/pulses_driver.cpp b/src/targets/sky9x/pulses_driver.cpp index 6f1bdeac2..cf8f7f0fe 100644 --- a/src/targets/sky9x/pulses_driver.cpp +++ b/src/targets/sky9x/pulses_driver.cpp @@ -36,7 +36,13 @@ #include "../../opentx.h" +extern uint16_t ppmStream[NUM_MODULES][20]; volatile uint32_t ppmStreamIndex[NUM_MODULES] = { MODULES_INIT(0) }; // Modified in interrupt routine +extern uint16_t pxxStream[NUM_MODULES][400]; // Transitions +extern uint16_t *pxxStreamPtr[NUM_MODULES]; +extern uint8_t Bit_pulses[64] ; // Likely more than we need +extern uint8_t Serial_byte_count ; + void init_main_ppm( uint32_t period, uint32_t out_enable ) { diff --git a/src/targets/stock/voice.h b/src/targets/stock/voice.h index 061850e4b..8a092bb3f 100644 --- a/src/targets/stock/voice.h +++ b/src/targets/stock/voice.h @@ -128,6 +128,7 @@ inline bool isPlaying() } \ } +#define I18N_PLAY_FUNCTION(lng, x, ...) void x(__VA_ARGS__) #define PLAY_FUNCTION(x, ...) void x(__VA_ARGS__) #define PUSH_CUSTOM_PROMPT(p, ...) pushCustomPrompt((p)) #define PUSH_NUMBER_PROMPT(p) pushNumberPrompt((p)) diff --git a/src/translations.h b/src/translations.h index ec49f1652..bbc8f6c5e 100644 --- a/src/translations.h +++ b/src/translations.h @@ -553,9 +553,28 @@ extern const pm_char STR_ROTARY_ENCODER[]; extern const pm_char STR_DATE[]; extern const pm_char STR_CHANNELS_MONITOR[]; -#if defined(VOICE) +#if defined(VOICE) && defined(CPUARM) + struct LanguagePack { + const char *id; + const char *name; + void (*playNumber)(getvalue_t number, uint8_t unit, uint8_t att, uint8_t id); + void (*playDuration)(int16_t seconds, uint8_t id); + }; + extern LanguagePack * languagePacks[]; + extern LanguagePack * currentLanguagePack; + extern uint8_t currentLanguagePackIdx; + #define LANGUAGE_PACK_DECLARE(lng, name) LanguagePack lng ## LanguagePack = { #lng, name, lng ## _ ## playNumber, lng ## _ ## playDuration } + #define LANGUAGE_PACK_DECLARE_DEFAULT(lng, name) LANGUAGE_PACK_DECLARE(lng, name); LanguagePack * currentLanguagePack = & lng ## LanguagePack; uint8_t currentLanguagePackIdx + inline PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att) { currentLanguagePack->playNumber(number, unit, att, id); } + inline PLAY_FUNCTION(playDuration, int16_t seconds) { currentLanguagePack->playDuration(seconds, id); } +#elif defined(VOICE) PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att); PLAY_FUNCTION(playDuration, int16_t seconds); + #define LANGUAGE_PACK_DECLARE(lng, name) + #define LANGUAGE_PACK_DECLARE_DEFAULT(lng, name) +#else + #define LANGUAGE_PACK_DECLARE(lng, name) + #define LANGUAGE_PACK_DECLARE_DEFAULT(lng, name) #endif #if LCD_W >= 212 diff --git a/src/translations/tts_en.cpp b/src/translations/tts_en.cpp index 22347a8e5..b4b8409f6 100644 --- a/src/translations/tts_en.cpp +++ b/src/translations/tts_en.cpp @@ -37,45 +37,45 @@ #include "../opentx.h" enum EnglishPrompts { - PROMPT_NUMBERS_BASE = 0, - PROMPT_ZERO = PROMPT_NUMBERS_BASE+0, //02-99 - PROMPT_HUNDRED = PROMPT_NUMBERS_BASE+100, //100,200 .. 900 - PROMPT_THOUSAND = PROMPT_NUMBERS_BASE+109, //1000 - PROMPT_AND = PROMPT_NUMBERS_BASE+110, - PROMPT_MINUS = PROMPT_NUMBERS_BASE+111, - PROMPT_POINT = PROMPT_NUMBERS_BASE+112, + EN_PROMPT_NUMBERS_BASE = 0, + EN_PROMPT_ZERO = EN_PROMPT_NUMBERS_BASE+0, //02-99 + EN_PROMPT_HUNDRED = EN_PROMPT_NUMBERS_BASE+100, //100,200 .. 900 + EN_PROMPT_THOUSAND = EN_PROMPT_NUMBERS_BASE+109, //1000 + EN_PROMPT_AND = EN_PROMPT_NUMBERS_BASE+110, + EN_PROMPT_MINUS = EN_PROMPT_NUMBERS_BASE+111, + EN_PROMPT_POINT = EN_PROMPT_NUMBERS_BASE+112, - PROMPT_UNITS_BASE = 115, - PROMPT_VOLTS = PROMPT_UNITS_BASE+UNIT_VOLTS, //(one)volt,(two)volts - PROMPT_AMPS = PROMPT_UNITS_BASE+(UNIT_AMPS*2), - PROMPT_METERS_PER_SECOND = PROMPT_UNITS_BASE+(UNIT_METERS_PER_SECOND*2), - PROMPT_SPARE1 = PROMPT_UNITS_BASE+(UNIT_RAW*2), - PROMPT_KMH = PROMPT_UNITS_BASE+(UNIT_KMH*2), - PROMPT_METERS = PROMPT_UNITS_BASE+(UNIT_METERS*2), - PROMPT_DEGREES = PROMPT_UNITS_BASE+(UNIT_DEGREES*2), - PROMPT_PERCENT = PROMPT_UNITS_BASE+(UNIT_PERCENT*2), - PROMPT_MILLIAMPS = PROMPT_UNITS_BASE+(UNIT_MILLIAMPS*2), - PROMPT_MAH = PROMPT_UNITS_BASE+(UNIT_MAH*2), - PROMPT_WATTS = PROMPT_UNITS_BASE+(UNIT_WATTS*2), - PROMPT_DB = PROMPT_UNITS_BASE+(UNIT_DBM*2), - PROMPT_FEET = PROMPT_UNITS_BASE+(UNIT_FEET*2), - PROMPT_KTS = PROMPT_UNITS_BASE+(UNIT_KTS*2), - PROMPT_HOURS = PROMPT_UNITS_BASE+(UNIT_HOURS*2), - PROMPT_MINUTES = PROMPT_UNITS_BASE+(UNIT_MINUTES*2), - PROMPT_SECONDS = PROMPT_UNITS_BASE+(UNIT_SECONDS*2), - PROMPT_RPMS = PROMPT_UNITS_BASE+(UNIT_RPMS*2), - PROMPT_G = PROMPT_UNITS_BASE+(UNIT_G*2), - - PROMPT_POINT_BASE = 160, //.0 - .9 + EN_PROMPT_UNITS_BASE = 115, + EN_PROMPT_VOLTS = EN_PROMPT_UNITS_BASE+UNIT_VOLTS, //(one)volt,(two)volts + EN_PROMPT_AMPS = EN_PROMPT_UNITS_BASE+(UNIT_AMPS*2), + EN_PROMPT_METERS_PER_SECOND = EN_PROMPT_UNITS_BASE+(UNIT_METERS_PER_SECOND*2), + EN_PROMPT_SPARE1 = EN_PROMPT_UNITS_BASE+(UNIT_RAW*2), + EN_PROMPT_KMH = EN_PROMPT_UNITS_BASE+(UNIT_KMH*2), + EN_PROMPT_METERS = EN_PROMPT_UNITS_BASE+(UNIT_METERS*2), + EN_PROMPT_DEGREES = EN_PROMPT_UNITS_BASE+(UNIT_DEGREES*2), + EN_PROMPT_PERCENT = EN_PROMPT_UNITS_BASE+(UNIT_PERCENT*2), + EN_PROMPT_MILLIAMPS = EN_PROMPT_UNITS_BASE+(UNIT_MILLIAMPS*2), + EN_PROMPT_MAH = EN_PROMPT_UNITS_BASE+(UNIT_MAH*2), + EN_PROMPT_WATTS = EN_PROMPT_UNITS_BASE+(UNIT_WATTS*2), + EN_PROMPT_DB = EN_PROMPT_UNITS_BASE+(UNIT_DBM*2), + EN_PROMPT_FEET = EN_PROMPT_UNITS_BASE+(UNIT_FEET*2), + EN_PROMPT_KTS = EN_PROMPT_UNITS_BASE+(UNIT_KTS*2), + EN_PROMPT_HOURS = EN_PROMPT_UNITS_BASE+(UNIT_HOURS*2), + EN_PROMPT_MINUTES = EN_PROMPT_UNITS_BASE+(UNIT_MINUTES*2), + EN_PROMPT_SECONDS = EN_PROMPT_UNITS_BASE+(UNIT_SECONDS*2), + EN_PROMPT_RPMS = EN_PROMPT_UNITS_BASE+(UNIT_RPMS*2), + EN_PROMPT_G = EN_PROMPT_UNITS_BASE+(UNIT_G*2), + + EN_PROMPT_POINT_BASE = 160, //.0 - .9 }; #if defined(VOICE) #if defined(CPUARM) -#define PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u), id) + #define PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u), id) #else -#define PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u)) + #define PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u)) #endif PLAY_FUNCTION(pushUnitPrompt, int16_t number, uint8_t unitprompt) @@ -86,10 +86,10 @@ PLAY_FUNCTION(pushUnitPrompt, int16_t number, uint8_t unitprompt) PUSH_NUMBER_PROMPT(unitprompt+1); } -PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att) +I18N_PLAY_FUNCTION(en, playNumber, getvalue_t number, uint8_t unit, uint8_t att) { if (number < 0) { - PUSH_NUMBER_PROMPT(PROMPT_MINUS); + PUSH_NUMBER_PROMPT(EN_PROMPT_MINUS); number = -number; } @@ -110,7 +110,7 @@ PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att) div_t qr = div(number, 10); if (qr.rem) { PLAY_NUMBER(qr.quot, 0, 0); - PUSH_NUMBER_PROMPT(PROMPT_POINT_BASE + qr.rem); + PUSH_NUMBER_PROMPT(EN_PROMPT_POINT_BASE + qr.rem); number = -1; } else { @@ -122,30 +122,30 @@ PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att) if (number >= 1000) { PLAY_NUMBER(number / 1000, 0, 0); - PUSH_NUMBER_PROMPT(PROMPT_THOUSAND); + PUSH_NUMBER_PROMPT(EN_PROMPT_THOUSAND); number %= 1000; if (number == 0) number = -1; } if (number >= 100) { - PUSH_NUMBER_PROMPT(PROMPT_HUNDRED + (number/100)-1); + PUSH_NUMBER_PROMPT(EN_PROMPT_HUNDRED + (number/100)-1); number %= 100; if (number == 0) number = -1; } if (number >= 0) { - PUSH_NUMBER_PROMPT(PROMPT_ZERO + number); + PUSH_NUMBER_PROMPT(EN_PROMPT_ZERO + number); } if (unit) { - PUSH_UNIT_PROMPT(tmp, (PROMPT_UNITS_BASE+((unit-1)*2))); + PUSH_UNIT_PROMPT(tmp, (+((unit-1)*2))); } } -PLAY_FUNCTION(playDuration, int16_t seconds) +I18N_PLAY_FUNCTION(en, playDuration, int16_t seconds) { if (seconds < 0) { - PUSH_NUMBER_PROMPT(PROMPT_MINUS); + PUSH_NUMBER_PROMPT(EN_PROMPT_MINUS); seconds = -seconds; } @@ -160,7 +160,7 @@ PLAY_FUNCTION(playDuration, int16_t seconds) if (tmp > 0) { PLAY_NUMBER(tmp, UNIT_MINUTES+1 , 0); if (seconds > 0) - PUSH_NUMBER_PROMPT(PROMPT_AND); + PUSH_NUMBER_PROMPT(EN_PROMPT_AND); } if (seconds > 0) { @@ -168,4 +168,6 @@ PLAY_FUNCTION(playDuration, int16_t seconds) } } +LANGUAGE_PACK_DECLARE_DEFAULT(en, "english"); + #endif diff --git a/src/translations/tts_fr.cpp b/src/translations/tts_fr.cpp index 8d286a9d4..6e9648f1a 100644 --- a/src/translations/tts_fr.cpp +++ b/src/translations/tts_fr.cpp @@ -23,79 +23,79 @@ #include "../opentx.h" enum FrenchPrompts { - PROMPT_NUMBERS_BASE = 0, - PROMPT_ZERO = PROMPT_NUMBERS_BASE+0, - PROMPT_CENT = PROMPT_NUMBERS_BASE+100, - PROMPT_DEUX_CENT = PROMPT_CENT+1, - PROMPT_MILLE = PROMPT_CENT+9, + FR_PROMPT_NUMBERS_BASE = 0, + FR_PROMPT_ZERO = FR_PROMPT_NUMBERS_BASE+0, + FR_PROMPT_CENT = FR_PROMPT_NUMBERS_BASE+100, + FR_PROMPT_DEUX_CENT = FR_PROMPT_CENT+1, + FR_PROMPT_MILLE = FR_PROMPT_CENT+9, - PROMPT_UNE = 110, - PROMPT_ONZE, - PROMPT_VINGT_ET_UNE, - PROMPT_TRENTE_ET_UNE, - PROMPT_QUARANTE_ET_UNE, - PROMPT_CINQUANTE_ET_UNE, - PROMPT_SOIXANTE_ET_UNE, - PROMPT_SOIXANTE_ET_ONZE, - PROMPT_QUATRE_VINGT_UNE, + FR_PROMPT_UNE = 110, + FR_PROMPT_ONZE, + FR_PROMPT_VINGT_ET_UNE, + FR_PROMPT_TRENTE_ET_UNE, + FR_PROMPT_QUARANTE_ET_UNE, + FR_PROMPT_CINQUANTE_ET_UNE, + FR_PROMPT_SOIXANTE_ET_UNE, + FR_PROMPT_SOIXANTE_ET_ONZE, + FR_PROMPT_QUATRE_VINGT_UNE, - PROMPT_VIRGULE = 119, - PROMPT_ET = 120, - PROMPT_MOINS = 121, + FR_PROMPT_VIRGULE = 119, + FR_PROMPT_ET = 120, + FR_PROMPT_MOINS = 121, - PROMPT_UNITS_BASE = 125, - PROMPT_VOLTS = PROMPT_UNITS_BASE+UNIT_VOLTS, - PROMPT_AMPS = PROMPT_UNITS_BASE+UNIT_AMPS, - PROMPT_METERS_PER_SECOND = PROMPT_UNITS_BASE+UNIT_METERS_PER_SECOND, - PROMPT_SPARE1 = PROMPT_UNITS_BASE+UNIT_RAW, - PROMPT_KMH = PROMPT_UNITS_BASE+UNIT_KMH, - PROMPT_METERS = PROMPT_UNITS_BASE+UNIT_METERS, - PROMPT_DEGREES = PROMPT_UNITS_BASE+UNIT_DEGREES, - PROMPT_PERCENT = PROMPT_UNITS_BASE+UNIT_PERCENT, - PROMPT_MILLIAMPS = PROMPT_UNITS_BASE+UNIT_MILLIAMPS, - PROMPT_MAH = PROMPT_UNITS_BASE+UNIT_MAH, - PROMPT_WATTS = PROMPT_UNITS_BASE+UNIT_WATTS, - PROMPT_FEET = PROMPT_UNITS_BASE+UNIT_FEET, - PROMPT_KTS = PROMPT_UNITS_BASE+UNIT_KTS, - PROMPT_HEURE = PROMPT_UNITS_BASE+UNIT_HOURS, - PROMPT_MINUTE = PROMPT_UNITS_BASE+UNIT_MINUTES, - PROMPT_SECONDE = PROMPT_UNITS_BASE+UNIT_SECONDS, + FR_PROMPT_UNITS_BASE = 125, + FR_PROMPT_VOLTS = FR_PROMPT_UNITS_BASE+UNIT_VOLTS, + FR_PROMPT_AMPS = FR_PROMPT_UNITS_BASE+UNIT_AMPS, + FR_PROMPT_METERS_PER_SECOND = FR_PROMPT_UNITS_BASE+UNIT_METERS_PER_SECOND, + FR_PROMPT_SPARE1 = FR_PROMPT_UNITS_BASE+UNIT_RAW, + FR_PROMPT_KMH = FR_PROMPT_UNITS_BASE+UNIT_KMH, + FR_PROMPT_METERS = FR_PROMPT_UNITS_BASE+UNIT_METERS, + FR_PROMPT_DEGREES = FR_PROMPT_UNITS_BASE+UNIT_DEGREES, + FR_PROMPT_PERCENT = FR_PROMPT_UNITS_BASE+UNIT_PERCENT, + FR_PROMPT_MILLIAMPS = FR_PROMPT_UNITS_BASE+UNIT_MILLIAMPS, + FR_PROMPT_MAH = FR_PROMPT_UNITS_BASE+UNIT_MAH, + FR_PROMPT_WATTS = FR_PROMPT_UNITS_BASE+UNIT_WATTS, + FR_PROMPT_FEET = FR_PROMPT_UNITS_BASE+UNIT_FEET, + FR_PROMPT_KTS = FR_PROMPT_UNITS_BASE+UNIT_KTS, + FR_PROMPT_HEURE = FR_PROMPT_UNITS_BASE+UNIT_HOURS, + FR_PROMPT_MINUTE = FR_PROMPT_UNITS_BASE+UNIT_MINUTES, + FR_PROMPT_SECONDE = FR_PROMPT_UNITS_BASE+UNIT_SECONDS, - PROMPT_LABELS_BASE = 145, - PROMPT_TIMER1 = PROMPT_LABELS_BASE+TELEM_TM1, - PROMPT_TIMER2 = PROMPT_LABELS_BASE+TELEM_TM2, - PROMPT_RSSI_TX = PROMPT_LABELS_BASE+TELEM_RSSI_TX, - PROMPT_RSSI_RX = PROMPT_LABELS_BASE+TELEM_RSSI_RX, - PROMPT_A1 = PROMPT_LABELS_BASE+TELEM_A1, - PROMPT_A2 = PROMPT_LABELS_BASE+TELEM_A2, - PROMPT_ALTITUDE = PROMPT_LABELS_BASE+TELEM_ALT, - PROMPT_RPM = PROMPT_LABELS_BASE+TELEM_RPM, - PROMPT_ESSENCE = PROMPT_LABELS_BASE+TELEM_FUEL, - PROMPT_T1 = PROMPT_LABELS_BASE+TELEM_T1, - PROMPT_T2 = PROMPT_LABELS_BASE+TELEM_T2, - PROMPT_VITESSE = PROMPT_LABELS_BASE+TELEM_SPEED, - PROMPT_DISTANCE = PROMPT_LABELS_BASE+TELEM_DIST, - PROMPT_GPSALTITUDE = PROMPT_LABELS_BASE+TELEM_GPSALT, - PROMPT_ELEMENTS_LIPO = PROMPT_LABELS_BASE+TELEM_CELL, - PROMPT_TOTAL_LIPO = PROMPT_LABELS_BASE+TELEM_CELLS_SUM, - PROMPT_VFAS = PROMPT_LABELS_BASE+TELEM_VFAS, - PROMPT_COURANT = PROMPT_LABELS_BASE+TELEM_CURRENT, - PROMPT_CONSOMMATION = PROMPT_LABELS_BASE+TELEM_CONSUMPTION, - PROMPT_PUISSANCE = PROMPT_LABELS_BASE+TELEM_POWER, - PROMPT_ACCELx = PROMPT_LABELS_BASE+TELEM_ACCx, - PROMPT_ACCELy = PROMPT_LABELS_BASE+TELEM_ACCy, - PROMPT_ACCELz = PROMPT_LABELS_BASE+TELEM_ACCz, - PROMPT_HDG = PROMPT_LABELS_BASE+TELEM_HDG, - PROMPT_VARIO = PROMPT_LABELS_BASE+TELEM_VSPD, + FR_PROMPT_LABELS_BASE = 145, + FR_PROMPT_TIMER1 = FR_PROMPT_LABELS_BASE+TELEM_TM1, + FR_PROMPT_TIMER2 = FR_PROMPT_LABELS_BASE+TELEM_TM2, + FR_PROMPT_RSSI_TX = FR_PROMPT_LABELS_BASE+TELEM_RSSI_TX, + FR_PROMPT_RSSI_RX = FR_PROMPT_LABELS_BASE+TELEM_RSSI_RX, + FR_PROMPT_A1 = FR_PROMPT_LABELS_BASE+TELEM_A1, + FR_PROMPT_A2 = FR_PROMPT_LABELS_BASE+TELEM_A2, + FR_PROMPT_ALTITUDE = FR_PROMPT_LABELS_BASE+TELEM_ALT, + FR_PROMPT_RPM = FR_PROMPT_LABELS_BASE+TELEM_RPM, + FR_PROMPT_ESSENCE = FR_PROMPT_LABELS_BASE+TELEM_FUEL, + FR_PROMPT_T1 = FR_PROMPT_LABELS_BASE+TELEM_T1, + FR_PROMPT_T2 = FR_PROMPT_LABELS_BASE+TELEM_T2, + FR_PROMPT_VITESSE = FR_PROMPT_LABELS_BASE+TELEM_SPEED, + FR_PROMPT_DISTANCE = FR_PROMPT_LABELS_BASE+TELEM_DIST, + FR_PROMPT_GPSALTITUDE = FR_PROMPT_LABELS_BASE+TELEM_GPSALT, + FR_PROMPT_ELEMENTS_LIPO = FR_PROMPT_LABELS_BASE+TELEM_CELL, + FR_PROMPT_TOTAL_LIPO = FR_PROMPT_LABELS_BASE+TELEM_CELLS_SUM, + FR_PROMPT_VFAS = FR_PROMPT_LABELS_BASE+TELEM_VFAS, + FR_PROMPT_COURANT = FR_PROMPT_LABELS_BASE+TELEM_CURRENT, + FR_PROMPT_CONSOMMATION = FR_PROMPT_LABELS_BASE+TELEM_CONSUMPTION, + FR_PROMPT_PUISSANCE = FR_PROMPT_LABELS_BASE+TELEM_POWER, + FR_PROMPT_ACCELx = FR_PROMPT_LABELS_BASE+TELEM_ACCx, + FR_PROMPT_ACCELy = FR_PROMPT_LABELS_BASE+TELEM_ACCy, + FR_PROMPT_ACCELz = FR_PROMPT_LABELS_BASE+TELEM_ACCz, + FR_PROMPT_HDG = FR_PROMPT_LABELS_BASE+TELEM_HDG, + FR_PROMPT_VARIO = FR_PROMPT_LABELS_BASE+TELEM_VSPD, - PROMPT_VIRGULE_BASE = 180, //,0 - ,9 + FR_PROMPT_VIRGULE_BASE = 180, //,0 - ,9 }; #if defined(VOICE) #define FEMININ 0x80 -PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att) +I18N_PLAY_FUNCTION(fr, playNumber, getvalue_t number, uint8_t unit, uint8_t att) { /* if digit >= 1000000000: temp_digit, digit = divmod(digit, 1000000000) @@ -108,7 +108,7 @@ PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att) */ if (number < 0) { - PUSH_NUMBER_PROMPT(PROMPT_MOINS); + PUSH_NUMBER_PROMPT(FR_PROMPT_MOINS); number = -number; } @@ -129,7 +129,7 @@ PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att) div_t qr = div(number, 10); if (qr.rem) { PLAY_NUMBER(qr.quot, 0, 0); - PUSH_NUMBER_PROMPT(PROMPT_VIRGULE_BASE + qr.rem); + PUSH_NUMBER_PROMPT(FR_PROMPT_VIRGULE_BASE + qr.rem); number = -1; } else { @@ -140,35 +140,35 @@ PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att) if (number >= 1000) { if (number >= 2000) PLAY_NUMBER(number / 1000, 0, 0); - PUSH_NUMBER_PROMPT(PROMPT_MILLE); + PUSH_NUMBER_PROMPT(FR_PROMPT_MILLE); number %= 1000; if (number == 0) number = -1; } if (number >= 100) { if (number >= 200) - PUSH_NUMBER_PROMPT(PROMPT_ZERO + number/100); - PUSH_NUMBER_PROMPT(PROMPT_CENT); + PUSH_NUMBER_PROMPT(FR_PROMPT_ZERO + number/100); + PUSH_NUMBER_PROMPT(FR_PROMPT_CENT); number %= 100; if (number == 0) number = -1; } if (((number % 10) == 1) && number < 90 && (att & FEMININ)) { - PUSH_NUMBER_PROMPT(PROMPT_UNE+(number/10)); + PUSH_NUMBER_PROMPT(FR_PROMPT_UNE+(number/10)); } else if (number >= 0) { - PUSH_NUMBER_PROMPT(PROMPT_ZERO+number); + PUSH_NUMBER_PROMPT(FR_PROMPT_ZERO+number); } if (unit) { - PUSH_NUMBER_PROMPT(PROMPT_UNITS_BASE+unit-1); + PUSH_NUMBER_PROMPT(FR_PROMPT_UNITS_BASE+unit-1); } } -PLAY_FUNCTION(playDuration, int16_t seconds) +I18N_PLAY_FUNCTION(fr, playDuration, int16_t seconds) { if (seconds < 0) { - PUSH_NUMBER_PROMPT(PROMPT_MOINS); + PUSH_NUMBER_PROMPT(FR_PROMPT_MOINS); seconds = -seconds; } @@ -176,22 +176,24 @@ PLAY_FUNCTION(playDuration, int16_t seconds) seconds %= 3600; if (tmp > 0) { PLAY_NUMBER(tmp, 0, FEMININ); - PUSH_NUMBER_PROMPT(PROMPT_HEURE); + PUSH_NUMBER_PROMPT(FR_PROMPT_HEURE); } tmp = seconds / 60; seconds %= 60; if (tmp > 0) { PLAY_NUMBER(tmp, 0, FEMININ); - PUSH_NUMBER_PROMPT(PROMPT_MINUTE); + PUSH_NUMBER_PROMPT(FR_PROMPT_MINUTE); if (seconds > 0) - PUSH_NUMBER_PROMPT(PROMPT_ET); + PUSH_NUMBER_PROMPT(FR_PROMPT_ET); } if (seconds > 0) { PLAY_NUMBER(seconds, 0, FEMININ); - PUSH_NUMBER_PROMPT(PROMPT_SECONDE); + PUSH_NUMBER_PROMPT(FR_PROMPT_SECONDE); } } +LANGUAGE_PACK_DECLARE(fr, "french"); + #endif diff --git a/src/translations/tts_it.cpp b/src/translations/tts_it.cpp index dc7b4a0ae..b75d22c99 100644 --- a/src/translations/tts_it.cpp +++ b/src/translations/tts_it.cpp @@ -23,69 +23,69 @@ #include "../opentx.h" enum ItalianPrompts { - PROMPT_NUMBERS_BASE = 0, - PROMPT_ZERO = PROMPT_NUMBERS_BASE+0, - PROMPT_CENT = PROMPT_NUMBERS_BASE+100, - PROMPT_MILA = PROMPT_NUMBERS_BASE+101, - PROMPT_MILLE = PROMPT_NUMBERS_BASE+102, - PROMPT_VIRGOLA = 103, - PROMPT_UN, - PROMPT_E, - PROMPT_MENO, - PROMPT_ORA, - PROMPT_ORE, - PROMPT_MINUTO, - PROMPT_MINUTI, - PROMPT_SECONDO, - PROMPT_SECONDI, + IT_PROMPT_NUMBERS_BASE = 0, + IT_PROMPT_ZERO = IT_PROMPT_NUMBERS_BASE+0, + IT_PROMPT_CENT = IT_PROMPT_NUMBERS_BASE+100, + IT_PROMPT_MILA = IT_PROMPT_NUMBERS_BASE+101, + IT_PROMPT_MILLE = IT_PROMPT_NUMBERS_BASE+102, + IT_PROMPT_VIRGOLA = 103, + IT_PROMPT_UN, + IT_PROMPT_E, + IT_PROMPT_MENO, + IT_PROMPT_ORA, + IT_PROMPT_ORE, + IT_PROMPT_MINUTO, + IT_PROMPT_MINUTI, + IT_PROMPT_SECONDO, + IT_PROMPT_SECONDI, - PROMPT_UNITS_BASE = 113, - PROMPT_VOLTS = PROMPT_UNITS_BASE+UNIT_VOLTS, - PROMPT_AMPS = PROMPT_UNITS_BASE+UNIT_AMPS, - PROMPT_METERS_PER_SECOND = PROMPT_UNITS_BASE+UNIT_METERS_PER_SECOND, - PROMPT_SPARE1 = PROMPT_UNITS_BASE+UNIT_RAW, - PROMPT_KMH = PROMPT_UNITS_BASE+UNIT_KMH, - PROMPT_METERS = PROMPT_UNITS_BASE+UNIT_METERS, - PROMPT_DEGREES = PROMPT_UNITS_BASE+UNIT_DEGREES, - PROMPT_PERCENT = PROMPT_UNITS_BASE+UNIT_PERCENT, - PROMPT_MILLIAMPS = PROMPT_UNITS_BASE+UNIT_MILLIAMPS, - PROMPT_MAH = PROMPT_UNITS_BASE+UNIT_MAH, - PROMPT_WATTS = PROMPT_UNITS_BASE+UNIT_WATTS, - PROMPT_FEET = PROMPT_UNITS_BASE+UNIT_FEET, - PROMPT_KTS = PROMPT_UNITS_BASE+UNIT_KTS, + IT_PROMPT_UNITS_BASE = 113, + IT_PROMPT_VOLTS = IT_PROMPT_UNITS_BASE+UNIT_VOLTS, + IT_PROMPT_AMPS = IT_PROMPT_UNITS_BASE+UNIT_AMPS, + IT_PROMPT_METERS_PER_SECOND = IT_PROMPT_UNITS_BASE+UNIT_METERS_PER_SECOND, + IT_PROMPT_SPARE1 = IT_PROMPT_UNITS_BASE+UNIT_RAW, + IT_PROMPT_KMH = IT_PROMPT_UNITS_BASE+UNIT_KMH, + IT_PROMPT_METERS = IT_PROMPT_UNITS_BASE+UNIT_METERS, + IT_PROMPT_DEGREES = IT_PROMPT_UNITS_BASE+UNIT_DEGREES, + IT_PROMPT_PERCENT = IT_PROMPT_UNITS_BASE+UNIT_PERCENT, + IT_PROMPT_MILLIAMPS = IT_PROMPT_UNITS_BASE+UNIT_MILLIAMPS, + IT_PROMPT_MAH = IT_PROMPT_UNITS_BASE+UNIT_MAH, + IT_PROMPT_WATTS = IT_PROMPT_UNITS_BASE+UNIT_WATTS, + IT_PROMPT_FEET = IT_PROMPT_UNITS_BASE+UNIT_FEET, + IT_PROMPT_KTS = IT_PROMPT_UNITS_BASE+UNIT_KTS, - PROMPT_LABELS_BASE = 131, - PROMPT_TIMER1 = PROMPT_LABELS_BASE+TELEM_TM1, - PROMPT_TIMER2 = PROMPT_LABELS_BASE+TELEM_TM2, - PROMPT_RSSI_TX = PROMPT_LABELS_BASE+TELEM_RSSI_TX, - PROMPT_RSSI_RX = PROMPT_LABELS_BASE+TELEM_RSSI_RX, - PROMPT_A1 = PROMPT_LABELS_BASE+TELEM_A1, - PROMPT_A2 = PROMPT_LABELS_BASE+TELEM_A2, - PROMPT_ALTITUDE = PROMPT_LABELS_BASE+TELEM_ALT, - PROMPT_RPM = PROMPT_LABELS_BASE+TELEM_RPM, - PROMPT_ESSENCE = PROMPT_LABELS_BASE+TELEM_FUEL, - PROMPT_T1 = PROMPT_LABELS_BASE+TELEM_T1, - PROMPT_T2 = PROMPT_LABELS_BASE+TELEM_T2, - PROMPT_VITESSE = PROMPT_LABELS_BASE+TELEM_SPEED, - PROMPT_DISTANCE = PROMPT_LABELS_BASE+TELEM_DIST, - PROMPT_GPSALTITUDE = PROMPT_LABELS_BASE+TELEM_GPSALT, - PROMPT_ELEMENTS_LIPO = PROMPT_LABELS_BASE+TELEM_CELL, - PROMPT_TOTAL_LIPO = PROMPT_LABELS_BASE+TELEM_CELLS_SUM, - PROMPT_VFAS = PROMPT_LABELS_BASE+TELEM_VFAS, - PROMPT_COURANT = PROMPT_LABELS_BASE+TELEM_CURRENT, - PROMPT_CONSOMMATION = PROMPT_LABELS_BASE+TELEM_CONSUMPTION, - PROMPT_PUISSANCE = PROMPT_LABELS_BASE+TELEM_POWER, - PROMPT_ACCELx = PROMPT_LABELS_BASE+TELEM_ACCx, - PROMPT_ACCELy = PROMPT_LABELS_BASE+TELEM_ACCy, - PROMPT_ACCELz = PROMPT_LABELS_BASE+TELEM_ACCz, - PROMPT_HDG = PROMPT_LABELS_BASE+TELEM_HDG, - PROMPT_VARIO = PROMPT_LABELS_BASE+TELEM_VSPD, + IT_PROMPT_LABELS_BASE = 131, + IT_PROMPT_TIMER1 = IT_PROMPT_LABELS_BASE+TELEM_TM1, + IT_PROMPT_TIMER2 = IT_PROMPT_LABELS_BASE+TELEM_TM2, + IT_PROMPT_RSSI_TX = IT_PROMPT_LABELS_BASE+TELEM_RSSI_TX, + IT_PROMPT_RSSI_RX = IT_PROMPT_LABELS_BASE+TELEM_RSSI_RX, + IT_PROMPT_A1 = IT_PROMPT_LABELS_BASE+TELEM_A1, + IT_PROMPT_A2 = IT_PROMPT_LABELS_BASE+TELEM_A2, + IT_PROMPT_ALTITUDE = IT_PROMPT_LABELS_BASE+TELEM_ALT, + IT_PROMPT_RPM = IT_PROMPT_LABELS_BASE+TELEM_RPM, + IT_PROMPT_ESSENCE = IT_PROMPT_LABELS_BASE+TELEM_FUEL, + IT_PROMPT_T1 = IT_PROMPT_LABELS_BASE+TELEM_T1, + IT_PROMPT_T2 = IT_PROMPT_LABELS_BASE+TELEM_T2, + IT_PROMPT_VITESSE = IT_PROMPT_LABELS_BASE+TELEM_SPEED, + IT_PROMPT_DISTANCE = IT_PROMPT_LABELS_BASE+TELEM_DIST, + IT_PROMPT_GPSALTITUDE = IT_PROMPT_LABELS_BASE+TELEM_GPSALT, + IT_PROMPT_ELEMENTS_LIPO = IT_PROMPT_LABELS_BASE+TELEM_CELL, + IT_PROMPT_TOTAL_LIPO = IT_PROMPT_LABELS_BASE+TELEM_CELLS_SUM, + IT_PROMPT_VFAS = IT_PROMPT_LABELS_BASE+TELEM_VFAS, + IT_PROMPT_COURANT = IT_PROMPT_LABELS_BASE+TELEM_CURRENT, + IT_PROMPT_CONSOMMATION = IT_PROMPT_LABELS_BASE+TELEM_CONSUMPTION, + IT_PROMPT_PUISSANCE = IT_PROMPT_LABELS_BASE+TELEM_POWER, + IT_PROMPT_ACCELx = IT_PROMPT_LABELS_BASE+TELEM_ACCx, + IT_PROMPT_ACCELy = IT_PROMPT_LABELS_BASE+TELEM_ACCy, + IT_PROMPT_ACCELz = IT_PROMPT_LABELS_BASE+TELEM_ACCz, + IT_PROMPT_HDG = IT_PROMPT_LABELS_BASE+TELEM_HDG, + IT_PROMPT_VARIO = IT_PROMPT_LABELS_BASE+TELEM_VSPD, }; #if defined(VOICE) -PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att) +I18N_PLAY_FUNCTION(it, playNumber, getvalue_t number, uint8_t unit, uint8_t att) { /* if digit >= 1000000000: temp_digit, digit = divmod(digit, 1000000000) @@ -98,7 +98,7 @@ PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att) */ if (number < 0) { - PUSH_NUMBER_PROMPT(PROMPT_MENO); + PUSH_NUMBER_PROMPT(IT_PROMPT_MENO); number = -number; } @@ -118,9 +118,9 @@ PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att) div_t qr = div(number, (mode == 1 ? 10 : 100)); if (qr.rem > 0) { PLAY_NUMBER(qr.quot, 0, 0); - PUSH_NUMBER_PROMPT(PROMPT_VIRGOLA); + PUSH_NUMBER_PROMPT(IT_PROMPT_VIRGOLA); if (mode==2 && qr.rem < 10) - PUSH_NUMBER_PROMPT(PROMPT_ZERO); + PUSH_NUMBER_PROMPT(IT_PROMPT_ZERO); PLAY_NUMBER(qr.rem, unit, 0); } else { @@ -132,9 +132,9 @@ PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att) if (number >= 1000) { if (number >= 2000) { PLAY_NUMBER(number / 1000, 0, 0); - PUSH_NUMBER_PROMPT(PROMPT_MILA); + PUSH_NUMBER_PROMPT(IT_PROMPT_MILA); } else { - PUSH_NUMBER_PROMPT(PROMPT_MILLE); + PUSH_NUMBER_PROMPT(IT_PROMPT_MILLE); } number %= 1000; if (number == 0) @@ -142,23 +142,23 @@ PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att) } if (number >= 100) { if (number >= 200) - PUSH_NUMBER_PROMPT(PROMPT_ZERO + number/100); - PUSH_NUMBER_PROMPT(PROMPT_CENT); + PUSH_NUMBER_PROMPT(IT_PROMPT_ZERO + number/100); + PUSH_NUMBER_PROMPT(IT_PROMPT_CENT); number %= 100; if (number == 0) number = -1; } - PUSH_NUMBER_PROMPT(PROMPT_ZERO+number); + PUSH_NUMBER_PROMPT(IT_PROMPT_ZERO+number); if (unit) { - PUSH_NUMBER_PROMPT(PROMPT_UNITS_BASE+unit-1); + PUSH_NUMBER_PROMPT(IT_PROMPT_UNITS_BASE+unit-1); } } -PLAY_FUNCTION(playDuration, int16_t seconds) +I18N_PLAY_FUNCTION(it, playDuration, int16_t seconds) { if (seconds < 0) { - PUSH_NUMBER_PROMPT(PROMPT_MENO); + PUSH_NUMBER_PROMPT(IT_PROMPT_MENO); seconds = -seconds; } @@ -169,10 +169,10 @@ PLAY_FUNCTION(playDuration, int16_t seconds) ore=tmp; if (tmp > 1) { PLAY_NUMBER(tmp, 0, 0); - PUSH_NUMBER_PROMPT(PROMPT_ORE); + PUSH_NUMBER_PROMPT(IT_PROMPT_ORE); } else { - PUSH_NUMBER_PROMPT(PROMPT_UN); - PUSH_NUMBER_PROMPT(PROMPT_ORA); + PUSH_NUMBER_PROMPT(IT_PROMPT_UN); + PUSH_NUMBER_PROMPT(IT_PROMPT_ORA); } } @@ -181,21 +181,23 @@ PLAY_FUNCTION(playDuration, int16_t seconds) if (tmp > 0 || ore >0) { if (tmp != 1) { PLAY_NUMBER(tmp, 0, 0); - PUSH_NUMBER_PROMPT(PROMPT_MINUTI); + PUSH_NUMBER_PROMPT(IT_PROMPT_MINUTI); } else { - PUSH_NUMBER_PROMPT(PROMPT_UN); - PUSH_NUMBER_PROMPT(PROMPT_MINUTO); + PUSH_NUMBER_PROMPT(IT_PROMPT_UN); + PUSH_NUMBER_PROMPT(IT_PROMPT_MINUTO); } - PUSH_NUMBER_PROMPT(PROMPT_E); + PUSH_NUMBER_PROMPT(IT_PROMPT_E); } if (seconds != 1) { PLAY_NUMBER(seconds, 0, 0); - PUSH_NUMBER_PROMPT(PROMPT_SECONDI); + PUSH_NUMBER_PROMPT(IT_PROMPT_SECONDI); } else { - PUSH_NUMBER_PROMPT(PROMPT_UN); - PUSH_NUMBER_PROMPT(PROMPT_SECONDO); + PUSH_NUMBER_PROMPT(IT_PROMPT_UN); + PUSH_NUMBER_PROMPT(IT_PROMPT_SECONDO); } } +LANGUAGE_PACK_DECLARE(it, "italian"); + #endif