Compare commits
64 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f2ff5bccd3 | |||
| e064edc69b | |||
| 4d03134e9e | |||
| 541c5aa000 | |||
| ad82ce9c1b | |||
| 7c4bb27ebd | |||
| e484668033 | |||
| 5f9a24cddd | |||
| 5154ba238a | |||
| c4a8e121d3 | |||
| 6c068076e4 | |||
| 8b5165c271 | |||
| 61f430cb43 | |||
| 144f47b6cf | |||
| a493e022a7 | |||
| 517c5521be | |||
| aedb5211ab | |||
| 8833a3e451 | |||
| 79c0754af9 | |||
| 49cb4f97d6 | |||
| a5bf114f2b | |||
| 022caee996 | |||
| ca4d00ca4b | |||
| a1a18aae57 | |||
| bc078d5e3f | |||
| 8bab0aee9a | |||
| 900bc139b5 | |||
| 48c913a96a | |||
| 9092f52999 | |||
| 68f6d68138 | |||
| e2df5ef0ed | |||
| 3001a754c1 | |||
| 56c4db624a | |||
| 5126de7ed8 | |||
| 1a7bb8e966 | |||
| 9701ac54e8 | |||
| 311c05b256 | |||
| 1ddfb6b81e | |||
| 91abaa4f61 | |||
| e3327ce2c1 | |||
| 4b4c9728be | |||
| 3a93ae3558 | |||
| dc2c4efde5 | |||
| d2aaac6819 | |||
| 7d5543f5a7 | |||
| 0a49777e6d | |||
| 8f0a996c0a | |||
| 0b665f145a | |||
| c1a8026406 | |||
| 07dc3459a2 | |||
| 8132f530d9 | |||
| 6686c75206 | |||
| 692f8b1ef4 | |||
| 237fa71133 | |||
| c7491a8dee | |||
| 4d7f2c8579 | |||
| b4e2086506 | |||
| c0a509e3fa | |||
| 8b7ed2bdec | |||
| bf43703666 | |||
| 5845bb8d4a | |||
| 874281a081 | |||
| d3c967c6cd | |||
| e9531e3990 |
+42
-15
@@ -85,6 +85,10 @@ NAVIGATION = NO
|
||||
# Values = YES, NO
|
||||
AUTOSWITCH = NO
|
||||
|
||||
# Sources automatic selection
|
||||
# Values = YES, NO
|
||||
AUTOSOURCE = NO
|
||||
|
||||
# Double keys support (+/- means invert, +/up means max, -/dwn means min, up/down means reset to default)
|
||||
# Values = YES, NO
|
||||
DBLKEYS = NO
|
||||
@@ -126,9 +130,6 @@ GRAPHICS = YES
|
||||
BOLD = YES
|
||||
BATTGRAPH = NO
|
||||
|
||||
# THR trace (in STATS screen)
|
||||
THR_TRACE = YES
|
||||
|
||||
# PPM center adjustable
|
||||
# Values = YES, NO
|
||||
PPM_CENTER_ADJUSTABLE = NO
|
||||
@@ -235,6 +236,12 @@ ifneq ($(PCB), $(filter $(PCB), STD 9X 9XR STD128 9X128 9XR128 GRUVIN9X MEGA2560
|
||||
$(error Sorry, the PCB $(PCB) is not supported yet in openTx)
|
||||
endif
|
||||
|
||||
GVARS_VARIANT = +1
|
||||
FRSKY_VARIANT = +2
|
||||
3POS_VARIANT = +4
|
||||
M128_VARIANT = +32768
|
||||
EEPROM_VARIANT = 0
|
||||
|
||||
ifeq ($(PCB), $(filter $(PCB), STD 9X 9XR))
|
||||
# 9x/9xr radio
|
||||
ARCH = AVR
|
||||
@@ -243,6 +250,7 @@ ifeq ($(PCB), $(filter $(PCB), STD 9X 9XR))
|
||||
OPT = s
|
||||
XCURVES = NO
|
||||
SDCARD = NO
|
||||
THR_TRACE = NO
|
||||
EXTRAINCDIRS = stock
|
||||
CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBSTD -DCPUM64 -DEEPROM_VARIANT=$(shell echo ${EEPROM_VARIANT} | bc)
|
||||
BOARDSRC = stock/board_stock.cpp
|
||||
@@ -260,12 +268,13 @@ ifeq ($(PCB), $(filter $(PCB), STD 9X 9XR))
|
||||
CPPDEFS += -DAUDIO
|
||||
CPPSRC += audio_avr.cpp
|
||||
else
|
||||
CPPDEFS += -DBEEPER
|
||||
CPPSRC += beeper.cpp
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(VOICE), YES)
|
||||
CPPSRC += stock/voice.cpp
|
||||
CPPDEFS += -DVOICE
|
||||
CPPSRC += stock/voice.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(PWM_BACKLIGHT), YES)
|
||||
@@ -293,7 +302,9 @@ ifeq ($(PCB), $(filter $(PCB), STD128 9X128 9XR128))
|
||||
MCU = atmega128
|
||||
OPT = 2
|
||||
SDCARD = NO
|
||||
CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBSTD -DCPUM128 -DEEPROM_VARIANT=0x8000
|
||||
THR_TRACE = NO
|
||||
EEPROM_VARIANT += ${M128_VARIANT}
|
||||
CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBSTD -DCPUM128 -DEEPROM_VARIANT=$(shell echo ${EEPROM_VARIANT} | bc)
|
||||
EXTRAINCDIRS = stock
|
||||
BOARDSRC = stock/board_stock.cpp
|
||||
EXTRABOARDSRC = stock/lcd_driver.cpp
|
||||
@@ -310,12 +321,13 @@ ifeq ($(PCB), $(filter $(PCB), STD128 9X128 9XR128))
|
||||
CPPDEFS += -DAUDIO
|
||||
CPPSRC += audio_avr.cpp
|
||||
else
|
||||
CPPDEFS += -DBEEPER
|
||||
CPPSRC += beeper.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(VOICE), YES)
|
||||
CPPSRC += stock/voice.cpp
|
||||
CPPDEFS += -DVOICE
|
||||
CPPSRC += stock/voice.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(PWM_BACKLIGHT), YES)
|
||||
@@ -349,22 +361,29 @@ ifeq ($(PCB), GRUVIN9X)
|
||||
OPT = 2
|
||||
CPPDEFS += -DF_CPU=$(F_CPU)UL -DPCBGRUVIN9X -DEEPROM_VARIANT=0 -DAUDIO -DHAPTIC
|
||||
SDCARD = NO
|
||||
BEEPER = NO
|
||||
THR_TRACE = YES
|
||||
EXTRAINCDIRS = gruvin9x stock FatFs FatFs/option
|
||||
BOARDSRC = gruvin9x/board_gruvin9x.cpp
|
||||
EXTRABOARDSRC = stock/lcd_driver.cpp
|
||||
EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp
|
||||
PULSESSRC = pulses_avr.cpp
|
||||
CPPSRC += audio_avr.cpp haptic.cpp
|
||||
|
||||
|
||||
ifeq ($(SDCARD), YES)
|
||||
CPPDEFS += -DRTCLOCK
|
||||
CPPSRC += rtc.cpp gruvin9x/rtc_driver.cpp
|
||||
EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c gruvin9x/diskio.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(BEEPER), YES)
|
||||
CPPDEFS += -DBEEPER
|
||||
CPPSRC += beeper.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(VOICE), YES)
|
||||
CPPSRC += gruvin9x/somo14d.cpp
|
||||
CPPDEFS += -DVOICE
|
||||
CPPSRC += gruvin9x/somo14d.cpp
|
||||
endif
|
||||
|
||||
# Enable extra rotary encoders (Gruvin9x board only)
|
||||
@@ -381,6 +400,7 @@ ifeq ($(PCB), MEGA2560)
|
||||
OPT = 2
|
||||
CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBGRUVIN9X -DEEPROM_VARIANT=0 -DAUDIO -DHAPTIC
|
||||
SDCARD = NO
|
||||
THR_TRACE = YES
|
||||
EXTRAINCDIRS = gruvin9x stock FatFs FatFs/option
|
||||
BOARDSRC = mega2560/board_mega2560.cpp
|
||||
EXTRABOARDSRC = mega2560/lcd_driver_ST7565R.cpp
|
||||
@@ -423,6 +443,8 @@ ifeq ($(PCB), SKY9X)
|
||||
MCU = cortex-m3
|
||||
OPT = 2
|
||||
SDCARD = YES
|
||||
BEEPER = NO
|
||||
THR_TRACE = YES
|
||||
CPPDEFS += -DPCBSKY9X -DCPUARM -DEEPROM_VARIANT=0 -DAUDIO -DHAPTIC -DPXX -DDSM2 -DDSM2_PPM -DROTARY_ENCODERS=1
|
||||
EXTRAINCDIRS = sky9x CoOS/kernel CoOS/portable
|
||||
BOARDSRC = sky9x/board_sky9x.cpp
|
||||
@@ -439,11 +461,16 @@ ifeq ($(PCB), SKY9X)
|
||||
CPPSRC += sky9x/pwr_driver.cpp sky9x/adc_driver.cpp sky9x/coproc_driver.cpp sky9x/rotenc_driver.cpp sky9x/eeprom_driver.cpp sky9x/pulses_driver.cpp sky9x/keys_driver.cpp sky9x/audio_driver.cpp sky9x/buzzer_driver.cpp sky9x/haptic_driver.cpp sky9x/sdcard_driver.cpp sky9x/massstorage.cpp
|
||||
|
||||
ifeq ($(SDCARD), YES)
|
||||
CPPDEFS += -DVOICE
|
||||
EXTRAINCDIRS += FatFs FatFs/option
|
||||
EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c sky9x/diskio.cpp
|
||||
CPPDEFS += -DVOICE
|
||||
endif
|
||||
|
||||
ifeq ($(BEEPER), YES)
|
||||
CPPDEFS += -DBEEPER
|
||||
CPPSRC += beeper.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(RTCLOCK), YES)
|
||||
CPPDEFS += -DRTCLOCK
|
||||
CPPSRC += rtc.cpp sky9x/rtc_driver.cpp
|
||||
@@ -475,6 +502,7 @@ ifeq ($(PCB), TARANIS)
|
||||
OPT = 2
|
||||
CPPDEFS += -DHSE_VALUE=12000000
|
||||
SDCARD = YES
|
||||
THR_TRACE = YES
|
||||
EXT = FRSKY
|
||||
CPPDEFS += -DPCBTARANIS -DCPUARM -DEEPROM_VARIANT=0 -DAUDIO -DPXX
|
||||
EXTRAINCDIRS = taranis CoOS/kernel CoOS/portable
|
||||
@@ -574,11 +602,6 @@ CPPDEFS += -DTRANSLATIONS_$(TRANSLATIONS)
|
||||
# TTS language
|
||||
CPPDEFS += -DTTS_$(TTS)
|
||||
|
||||
GVARS_VARIANT = +1
|
||||
FRSKY_VARIANT = +2
|
||||
3POS_VARIANT = +4
|
||||
EEPROM_VARIANT = 0
|
||||
|
||||
ifeq ($(UNITS), IMPERIAL)
|
||||
CPPDEFS += -DIMPERIAL_UNITS
|
||||
endif
|
||||
@@ -604,6 +627,10 @@ ifeq ($(AUTOSWITCH), YES)
|
||||
CPPDEFS += -DAUTOSWITCH
|
||||
endif
|
||||
|
||||
ifeq ($(AUTOSOURCE), YES)
|
||||
CPPDEFS += -DAUTOSOURCE
|
||||
endif
|
||||
|
||||
ifeq ($(DBLKEYS), YES)
|
||||
ifeq ($(PCB), $(filter $(PCB), 9XR 9XR128))
|
||||
$(warning Sorry, DBLKEYS doesnt work on 9XR)
|
||||
|
||||
+25
-14
@@ -362,9 +362,14 @@ void AudioQueue::sdWakeup(AudioContext & context)
|
||||
dacStop();
|
||||
memset(&fragment, 0, sizeof(fragment));
|
||||
f_close(&context.wavFile);
|
||||
CoSetTmrCnt(audioTimer, (WAV_BUFFER_SIZE * 1000) / context.pcmFreq, 0);
|
||||
CoStartTmr(audioTimer);
|
||||
CoClearFlag(audioFlag);
|
||||
if (context.pcmFreq) {
|
||||
CoSetTmrCnt(audioTimer, (WAV_BUFFER_SIZE * 1000) / context.pcmFreq, 0);
|
||||
CoStartTmr(audioTimer);
|
||||
CoClearFlag(audioFlag);
|
||||
}
|
||||
else {
|
||||
CoSetFlag(audioFlag);
|
||||
}
|
||||
state = AUDIO_RESUMING;
|
||||
}
|
||||
else {
|
||||
@@ -705,9 +710,15 @@ void audioEvent(uint8_t e, uint8_t f)
|
||||
haptic.event(e); //do this before audio to help sync timings
|
||||
#endif
|
||||
|
||||
if (g_eeGeneral.flashBeep && (e <= AU_ERROR || e >= AU_WARNING1)) {
|
||||
if (lightOffCounter < FLASH_DURATION)
|
||||
lightOffCounter = FLASH_DURATION;
|
||||
if (e <= AU_ERROR || e >= AU_WARNING1) {
|
||||
#if defined(BEEPER)
|
||||
beep();
|
||||
#endif
|
||||
|
||||
if (g_eeGeneral.alarmsFlash) {
|
||||
if (lightOffCounter < FLASH_DURATION)
|
||||
lightOffCounter = FLASH_DURATION;
|
||||
}
|
||||
}
|
||||
|
||||
if (g_eeGeneral.beeperMode>0 || (g_eeGeneral.beeperMode==0 && e>=AU_TRIM_MOVE) || (g_eeGeneral.beeperMode>=-1 && e<=AU_ERROR)) {
|
||||
@@ -794,23 +805,23 @@ void audioEvent(uint8_t e, uint8_t f)
|
||||
break;
|
||||
// mix warning 1
|
||||
case AU_MIX_WARNING_1:
|
||||
audioQueue.play(BEEP_DEFAULT_FREQ+100, 12, 0, PLAY_NOW);
|
||||
audioQueue.play(BEEP_DEFAULT_FREQ+96, 12, 0);
|
||||
break;
|
||||
// mix warning 2
|
||||
case AU_MIX_WARNING_2:
|
||||
audioQueue.play(BEEP_DEFAULT_FREQ+104, 12, 0, PLAY_NOW);
|
||||
audioQueue.play(BEEP_DEFAULT_FREQ+104, 12, 8, PLAY_REPEAT(1));
|
||||
break;
|
||||
// mix warning 3
|
||||
case AU_MIX_WARNING_3:
|
||||
audioQueue.play(BEEP_DEFAULT_FREQ+108, 12, 0, PLAY_NOW);
|
||||
audioQueue.play(BEEP_DEFAULT_FREQ+112, 12, 8, PLAY_REPEAT(2));
|
||||
break;
|
||||
// time 30 seconds left
|
||||
case AU_TIMER_30:
|
||||
audioQueue.play(BEEP_DEFAULT_FREQ, 30, 6, 2|PLAY_NOW);
|
||||
audioQueue.play(BEEP_DEFAULT_FREQ, 30, 6, PLAY_REPEAT(2)|PLAY_NOW);
|
||||
break;
|
||||
// time 20 seconds left
|
||||
case AU_TIMER_20:
|
||||
audioQueue.play(BEEP_DEFAULT_FREQ, 30, 6, 1|PLAY_NOW);
|
||||
audioQueue.play(BEEP_DEFAULT_FREQ, 30, 6, PLAY_REPEAT(1)|PLAY_NOW);
|
||||
break;
|
||||
// time 10 seconds left
|
||||
case AU_TIMER_10:
|
||||
@@ -821,15 +832,15 @@ void audioEvent(uint8_t e, uint8_t f)
|
||||
audioQueue.play(BEEP_DEFAULT_FREQ+10, 30, 6, PLAY_NOW);
|
||||
break;
|
||||
case AU_FRSKY_BEEP1:
|
||||
audioQueue.play(BEEP_DEFAULT_FREQ, 15, 2, 0);
|
||||
audioQueue.play(BEEP_DEFAULT_FREQ, 15, 2);
|
||||
audioQueue.pause(200);
|
||||
break;
|
||||
case AU_FRSKY_BEEP2:
|
||||
audioQueue.play(BEEP_DEFAULT_FREQ, 30, 2, 0);
|
||||
audioQueue.play(BEEP_DEFAULT_FREQ, 30, 2);
|
||||
audioQueue.pause(200);
|
||||
break;
|
||||
case AU_FRSKY_BEEP3:
|
||||
audioQueue.play(BEEP_DEFAULT_FREQ, 50, 2, 0);
|
||||
audioQueue.play(BEEP_DEFAULT_FREQ, 50, 2);
|
||||
audioQueue.pause(200);
|
||||
break;
|
||||
case AU_FRSKY_WARN1:
|
||||
|
||||
+2
-4
@@ -175,9 +175,7 @@ void audioStart();
|
||||
#define AUDIO_TIMER_10() audioEvent(AU_TIMER_10)
|
||||
#define AUDIO_TIMER_LT3(x) audioEvent(AU_TIMER_LT3)
|
||||
#define AUDIO_INACTIVITY() audioEvent(AU_INACTIVITY)
|
||||
#define AUDIO_MIX_WARNING_1() audioEvent(AU_MIX_WARNING_1)
|
||||
#define AUDIO_MIX_WARNING_2() audioEvent(AU_MIX_WARNING_2)
|
||||
#define AUDIO_MIX_WARNING_3() audioEvent(AU_MIX_WARNING_3)
|
||||
#define AUDIO_MIX_WARNING(x) audioEvent(AU_MIX_WARNING_1+x-1)
|
||||
#define AUDIO_POT_STICK_MIDDLE() audioEvent(AU_POT_STICK_MIDDLE)
|
||||
#define AUDIO_VARIO_UP() audioEvent(AU_KEYPAD_UP)
|
||||
#define AUDIO_VARIO_DOWN() audioEvent(AU_KEYPAD_DOWN)
|
||||
@@ -201,7 +199,7 @@ void audioStart();
|
||||
extern void pushPrompt(uint16_t prompt, uint8_t id=0);
|
||||
|
||||
#define PLAY_FUNCTION(x, ...) void x(__VA_ARGS__, uint8_t id)
|
||||
#define PUSH_PROMPT(p) pushPrompt((p), id)
|
||||
#define PUSH_NUMBER_PROMPT(p) pushPrompt((p), id)
|
||||
#define PLAY_NUMBER(n, u, a) playNumber((n), (u), (a), id)
|
||||
#define PLAY_DURATION(d) playDuration((d), id)
|
||||
#define IS_PLAYING(id) audioQueue.isPlaying((id))
|
||||
|
||||
+54
-49
@@ -40,6 +40,7 @@ audioQueue::audioQueue()
|
||||
{
|
||||
toneTimeLeft = 0;
|
||||
tonePause = 0;
|
||||
tone2TimeLeft = 0;
|
||||
|
||||
t_queueRidx = 0;
|
||||
t_queueWidx = 0;
|
||||
@@ -66,7 +67,6 @@ void audioQueue::heartbeat()
|
||||
}
|
||||
#endif
|
||||
toneFreq += toneFreqIncr;
|
||||
// TODO tone2TimeLeft = 0?
|
||||
}
|
||||
toneTimeLeft--; //time gets counted down
|
||||
}
|
||||
@@ -98,9 +98,6 @@ void audioQueue::heartbeat()
|
||||
}
|
||||
else {
|
||||
SPEAKER_OFF;
|
||||
if (tone2Pause > 0) {
|
||||
tone2Pause--; //time gets counted down
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,15 +121,16 @@ void audioQueue::pause(uint8_t tLen)
|
||||
play(0, tLen, 5); // a pause
|
||||
}
|
||||
|
||||
void audioQueue::play(uint8_t tFreq, uint8_t tLen, uint8_t tPause,
|
||||
uint8_t tFlags, int8_t tFreqIncr)
|
||||
void audioQueue::play(uint8_t tFreq, uint8_t tLen, uint8_t tPause, uint8_t tFlags)
|
||||
{
|
||||
if (tFlags & PLAY_BACKGROUND) {
|
||||
tone2Freq = tFreq;
|
||||
tone2TimeLeft = tLen;
|
||||
tone2Pause = tPause;
|
||||
}
|
||||
else {
|
||||
int8_t tFreqIncr = (tFlags >> 6);
|
||||
if (tFreqIncr == 3) tFreqIncr = -1;
|
||||
|
||||
if (tFreq > 0) { //we dont add pitch if zero as this is a pause only event
|
||||
tFreq += g_eeGeneral.speakerPitch + BEEP_OFFSET; // add pitch compensator
|
||||
}
|
||||
@@ -165,27 +163,34 @@ void audioQueue::play(uint8_t tFreq, uint8_t tLen, uint8_t tPause,
|
||||
|
||||
void audioQueue::event(uint8_t e, uint8_t f)
|
||||
{
|
||||
#ifdef HAPTIC
|
||||
#if defined(HAPTIC)
|
||||
haptic.event(e); //do this before audio to help sync timings
|
||||
#endif
|
||||
|
||||
if (g_eeGeneral.flashBeep && (e <= AU_ERROR || e >= AU_WARNING1)) {
|
||||
if (lightOffCounter < FLASH_DURATION)
|
||||
lightOffCounter = FLASH_DURATION;
|
||||
if (e <= AU_ERROR || e >= AU_WARNING1) {
|
||||
#if defined(BEEPER)
|
||||
beep();
|
||||
#endif
|
||||
|
||||
if (g_eeGeneral.alarmsFlash) {
|
||||
if (lightOffCounter < FLASH_DURATION)
|
||||
lightOffCounter = FLASH_DURATION;
|
||||
}
|
||||
}
|
||||
|
||||
if (g_eeGeneral.beeperMode>0 || (g_eeGeneral.beeperMode==0 && e>=AU_TRIM_MOVE) || (g_eeGeneral.beeperMode>=-1 && e<=AU_ERROR)) {
|
||||
if (e < AU_FRSKY_FIRST || empty()) {
|
||||
// TODO when VOICE enable some cases here are not needed!
|
||||
switch (e) {
|
||||
// inactivity timer alert
|
||||
case AU_INACTIVITY:
|
||||
play(70, 10, 2, 2|PLAY_NOW);
|
||||
play(70, 10, 2, PLAY_REPEAT(2)|PLAY_NOW);
|
||||
break;
|
||||
// low battery in tx
|
||||
case AU_TX_BATTERY_LOW:
|
||||
if (empty()) {
|
||||
play(60, 20, 3, 2, 1);
|
||||
play(80, 20, 3, 2, -1);
|
||||
play(60, 20, 3, PLAY_REPEAT(2)|PLAY_INCREMENT(1));
|
||||
play(80, 20, 3, PLAY_REPEAT(2)|PLAY_INCREMENT(-1));
|
||||
}
|
||||
break;
|
||||
// error
|
||||
@@ -230,23 +235,23 @@ void audioQueue::event(uint8_t e, uint8_t f)
|
||||
break;
|
||||
// mix warning 1
|
||||
case AU_MIX_WARNING_1:
|
||||
play(BEEP_DEFAULT_FREQ + 50, 6, 0, PLAY_NOW);
|
||||
play(BEEP_DEFAULT_FREQ + 50, 6, 0);
|
||||
break;
|
||||
// mix warning 2
|
||||
case AU_MIX_WARNING_2:
|
||||
play(BEEP_DEFAULT_FREQ + 52, 6, 0, PLAY_NOW);
|
||||
play(BEEP_DEFAULT_FREQ + 52, 6, 3, PLAY_REPEAT(1));
|
||||
break;
|
||||
// mix warning 3
|
||||
case AU_MIX_WARNING_3:
|
||||
play(BEEP_DEFAULT_FREQ + 54, 6, 0, PLAY_NOW);
|
||||
play(BEEP_DEFAULT_FREQ + 54, 6, 3, PLAY_REPEAT(2));
|
||||
break;
|
||||
// time 30 seconds left
|
||||
case AU_TIMER_30:
|
||||
play(BEEP_DEFAULT_FREQ + 50, 15, 3, 2|PLAY_NOW);
|
||||
play(BEEP_DEFAULT_FREQ + 50, 15, 3, PLAY_REPEAT(2)|PLAY_NOW);
|
||||
break;
|
||||
// time 20 seconds left
|
||||
case AU_TIMER_20:
|
||||
play(BEEP_DEFAULT_FREQ + 50, 15, 3, 1|PLAY_NOW);
|
||||
play(BEEP_DEFAULT_FREQ + 50, 15, 3, PLAY_REPEAT(1)|PLAY_NOW);
|
||||
break;
|
||||
// time 10 seconds left
|
||||
case AU_TIMER_10:
|
||||
@@ -255,81 +260,81 @@ void audioQueue::event(uint8_t e, uint8_t f)
|
||||
play(BEEP_DEFAULT_FREQ + 50, 15, 3, PLAY_NOW);
|
||||
break;
|
||||
case AU_FRSKY_BEEP1:
|
||||
play(BEEP_DEFAULT_FREQ,10,1,0);
|
||||
play(BEEP_DEFAULT_FREQ, 10, 1);
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_BEEP2:
|
||||
play(BEEP_DEFAULT_FREQ,20,1,0);
|
||||
play(BEEP_DEFAULT_FREQ, 20, 1);
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_BEEP3:
|
||||
play(BEEP_DEFAULT_FREQ,30,1,0);
|
||||
play(BEEP_DEFAULT_FREQ, 30, 1);
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_WARN1:
|
||||
play(BEEP_DEFAULT_FREQ+20,15,5,2);
|
||||
play(BEEP_DEFAULT_FREQ+20, 15, 5, PLAY_REPEAT(2));
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_WARN2:
|
||||
play(BEEP_DEFAULT_FREQ+30,15,5,2);
|
||||
play(BEEP_DEFAULT_FREQ+30, 15, 5, PLAY_REPEAT(2));
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_CHEEP:
|
||||
play(BEEP_DEFAULT_FREQ+30,10,2,2,2);
|
||||
play(BEEP_DEFAULT_FREQ+30, 10, 2, PLAY_REPEAT(2)|PLAY_INCREMENT(2));
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_RING:
|
||||
play(BEEP_DEFAULT_FREQ+25,5,2,10);
|
||||
play(BEEP_DEFAULT_FREQ+25,5,10,1);
|
||||
play(BEEP_DEFAULT_FREQ+25,5,2,10);
|
||||
play(BEEP_DEFAULT_FREQ+25, 5, 2, PLAY_REPEAT(10));
|
||||
play(BEEP_DEFAULT_FREQ+25, 5, 10, PLAY_REPEAT(1));
|
||||
play(BEEP_DEFAULT_FREQ+25, 5, 2, PLAY_REPEAT(10));
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_SCIFI:
|
||||
play(80,10,3,2,-1);
|
||||
play(60,10,3,2,1);
|
||||
play(70,10,1,0);
|
||||
play(80, 10, 3, PLAY_REPEAT(2)|PLAY_INCREMENT(-1));
|
||||
play(60, 10, 3, PLAY_REPEAT(2)|PLAY_INCREMENT(1));
|
||||
play(70, 10, 1);
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_ROBOT:
|
||||
play(70,5,1,1);
|
||||
play(50,15,2,1);
|
||||
play(80,15,2,1);
|
||||
play(70, 5, 1, PLAY_REPEAT(1));
|
||||
play(50, 15, 2, PLAY_REPEAT(1));
|
||||
play(80, 15, 2, PLAY_REPEAT(1));
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_CHIRP:
|
||||
play(BEEP_DEFAULT_FREQ+40,5,1,2);
|
||||
play(BEEP_DEFAULT_FREQ+54,5,1,3);
|
||||
play(BEEP_DEFAULT_FREQ+40, 5, 1, PLAY_REPEAT(2));
|
||||
play(BEEP_DEFAULT_FREQ+54, 5, 1, PLAY_REPEAT(3));
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_TADA:
|
||||
play(50,5,5);
|
||||
play(90,5,5);
|
||||
play(110,3,4,2);
|
||||
play(50, 5, 5);
|
||||
play(90, 5, 5);
|
||||
play(110, 3, 4, PLAY_REPEAT(2));
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_CRICKET:
|
||||
play(80,5,10,3);
|
||||
play(80,5,20,1);
|
||||
play(80,5,10,3);
|
||||
play(80, 5, 10, PLAY_REPEAT(3));
|
||||
play(80, 5, 20, PLAY_REPEAT(1));
|
||||
play(80, 5, 10, PLAY_REPEAT(3));
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_SIREN:
|
||||
play(10,20,5,2,1);
|
||||
play(10, 20, 5, PLAY_REPEAT(2)|PLAY_INCREMENT(1));
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_ALARMC:
|
||||
play(50,4,10,2);
|
||||
play(70,8,20,1);
|
||||
play(50,8,10,2);
|
||||
play(70,4,20,1);
|
||||
play(50, 4, 10, PLAY_REPEAT(2));
|
||||
play(70, 8, 20, PLAY_REPEAT(1));
|
||||
play(50, 8, 10, PLAY_REPEAT(2));
|
||||
play(70, 4, 20, PLAY_REPEAT(1));
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_RATATA:
|
||||
play(BEEP_DEFAULT_FREQ+50,5,10,10);
|
||||
play(BEEP_DEFAULT_FREQ+50, 5, 10, PLAY_REPEAT(10));
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_TICK:
|
||||
play(BEEP_DEFAULT_FREQ+50,5,50,2);
|
||||
play(BEEP_DEFAULT_FREQ+50, 5, 50, PLAY_REPEAT(2));
|
||||
pause(200);
|
||||
break;
|
||||
default:
|
||||
|
||||
+20
-23
@@ -55,7 +55,7 @@ class audioQueue
|
||||
|
||||
audioQueue();
|
||||
|
||||
void play(uint8_t tFreq, uint8_t tLen, uint8_t tPause, uint8_t tFlags=0, int8_t tFreqIncr=0);
|
||||
void play(uint8_t tFreq, uint8_t tLen, uint8_t tPause, uint8_t tFlags=0);
|
||||
void pause(uint8_t tLen);
|
||||
|
||||
inline bool busy() { return (toneTimeLeft > 0); }
|
||||
@@ -95,7 +95,6 @@ class audioQueue
|
||||
// vario has less priority
|
||||
uint8_t tone2Freq;
|
||||
uint8_t tone2TimeLeft;
|
||||
uint8_t tone2Pause;
|
||||
|
||||
// queue arrays
|
||||
uint8_t queueToneFreq[AUDIO_QUEUE_LENGTH];
|
||||
@@ -121,15 +120,15 @@ void audioDefevent(uint8_t e);
|
||||
#define AUDIO_ERROR() audioDefevent(AU_ERROR)
|
||||
|
||||
#if defined(VOICE)
|
||||
#define AUDIO_TADA() pushPrompt(PROMPT_SYSTEM_BASE+AU_TADA)
|
||||
#define AUDIO_TX_BATTERY_LOW() pushPrompt(PROMPT_SYSTEM_BASE+AU_TX_BATTERY_LOW)
|
||||
#define AUDIO_INACTIVITY() pushPrompt(PROMPT_SYSTEM_BASE+AU_INACTIVITY)
|
||||
#define AUDIO_ERROR_MESSAGE(e) pushPrompt(PROMPT_SYSTEM_BASE+(e))
|
||||
#define AUDIO_TADA() PUSH_SYSTEM_PROMPT(AU_TADA)
|
||||
#define AUDIO_TX_BATTERY_LOW() PUSH_SYSTEM_PROMPT(AU_TX_BATTERY_LOW)
|
||||
#define AUDIO_INACTIVITY() PUSH_SYSTEM_PROMPT(AU_INACTIVITY)
|
||||
#define AUDIO_ERROR_MESSAGE(e) PUSH_SYSTEM_PROMPT((e))
|
||||
#define AUDIO_TIMER_MINUTE(t) playDuration(t)
|
||||
#define AUDIO_TIMER_30() pushPrompt(PROMPT_SYSTEM_BASE+AU_TIMER_30)
|
||||
#define AUDIO_TIMER_20() pushPrompt(PROMPT_SYSTEM_BASE+AU_TIMER_20)
|
||||
#define AUDIO_TIMER_10() pushPrompt(PROMPT_SYSTEM_BASE+AU_TIMER_10)
|
||||
#define AUDIO_TIMER_LT3(x) pushPrompt(PROMPT_SYSTEM_BASE+AU_TIMER_LT3)
|
||||
#define AUDIO_TIMER_30() PUSH_SYSTEM_PROMPT(AU_TIMER_30)
|
||||
#define AUDIO_TIMER_20() PUSH_SYSTEM_PROMPT(AU_TIMER_20)
|
||||
#define AUDIO_TIMER_10() PUSH_SYSTEM_PROMPT(AU_TIMER_10)
|
||||
#define AUDIO_TIMER_LT3(x) PUSH_SYSTEM_PROMPT(AU_TIMER_LT3)
|
||||
#else
|
||||
#define AUDIO_TADA()
|
||||
#define AUDIO_TX_BATTERY_LOW() audioDefevent(AU_TX_BATTERY_LOW)
|
||||
@@ -142,21 +141,19 @@ void audioDefevent(uint8_t e);
|
||||
#define AUDIO_TIMER_LT3(x) audioDefevent(AU_TIMER_LT3)
|
||||
#endif
|
||||
|
||||
#define AUDIO_MIX_WARNING_1() audioDefevent(AU_MIX_WARNING_1)
|
||||
#define AUDIO_MIX_WARNING_2() audioDefevent(AU_MIX_WARNING_2)
|
||||
#define AUDIO_MIX_WARNING_3() audioDefevent(AU_MIX_WARNING_3)
|
||||
#define AUDIO_MIX_WARNING(x) audioDefevent(AU_MIX_WARNING_1+x-1)
|
||||
#define AUDIO_POT_STICK_MIDDLE() audioDefevent(AU_POT_STICK_MIDDLE)
|
||||
#define AUDIO_VARIO_UP() audioDefevent(AU_KEYPAD_UP)
|
||||
#define AUDIO_VARIO_DOWN() audioDefevent(AU_KEYPAD_DOWN)
|
||||
#define AUDIO_TRIM_MIDDLE(f) audio.event(AU_TRIM_MIDDLE, f)
|
||||
#define AUDIO_TRIM_END(f) AUDIO_TRIM_MIDDLE(f)
|
||||
#define AUDIO_TRIM(event, f) audio.event(AU_TRIM_MOVE, f)
|
||||
#define AUDIO_PLAY(p) audio.event(p)
|
||||
#define AUDIO_VARIO(f, t) audio.play(f, t, 0, PLAY_BACKGROUND)
|
||||
#define AUDIO_VARIO_UP() audioDefevent(AU_KEYPAD_UP)
|
||||
#define AUDIO_VARIO_DOWN() audioDefevent(AU_KEYPAD_DOWN)
|
||||
#define AUDIO_TRIM_MIDDLE(f) audio.event(AU_TRIM_MIDDLE, f)
|
||||
#define AUDIO_TRIM_END(f) AUDIO_TRIM_MIDDLE(f)
|
||||
#define AUDIO_TRIM(event, f) audio.event(AU_TRIM_MOVE, f)
|
||||
#define AUDIO_PLAY(p) audio.event(p)
|
||||
#define AUDIO_VARIO(f, t) audio.play(f, t, 0, PLAY_BACKGROUND)
|
||||
|
||||
#define AUDIO_DRIVER() audio.driver()
|
||||
#define AUDIO_HEARTBEAT() audio.heartbeat()
|
||||
#define IS_AUDIO_BUSY() audio.busy()
|
||||
#define AUDIO_DRIVER() audio.driver()
|
||||
#define AUDIO_HEARTBEAT() audio.heartbeat()
|
||||
#define IS_AUDIO_BUSY() audio.busy()
|
||||
#define AUDIO_RESET()
|
||||
|
||||
#define PLAY_PHASE_OFF(phase)
|
||||
|
||||
+11
-1
@@ -43,6 +43,15 @@ uint8_t beepOn = false;
|
||||
bool warble = false;
|
||||
bool warbleC;
|
||||
|
||||
#if defined(AUDIO)
|
||||
static const pm_uint8_t beepTab[] PROGMEM = {
|
||||
60, 80, 100, 120, 150,
|
||||
};
|
||||
void beep()
|
||||
{
|
||||
_beep(pgm_read_byte(beepTab+(2+g_eeGeneral.beeperLength)));
|
||||
}
|
||||
#else
|
||||
// The various "beep" tone lengths
|
||||
static const pm_uint8_t beepTab[] PROGMEM = {
|
||||
// key, trim, warn2, warn1, error
|
||||
@@ -59,9 +68,10 @@ void beep(uint8_t val)
|
||||
haptic.event(val==0 ? AU_KEYPAD_UP : (val==4 ? AU_ERROR : AU_TIMER_10+beepAgain));
|
||||
#endif
|
||||
|
||||
if (g_eeGeneral.flashBeep && val>1 && lightOffCounter<FLASH_DURATION) lightOffCounter = FLASH_DURATION;
|
||||
if (g_eeGeneral.alarmsFlash && val>1 && lightOffCounter<FLASH_DURATION) lightOffCounter = FLASH_DURATION;
|
||||
|
||||
if (g_eeGeneral.beeperMode>0 || (g_eeGeneral.beeperMode==0 && val!=0) || (g_eeGeneral.beeperMode==-1 && val>=3)) {
|
||||
_beep(pgm_read_byte(beepTab+5*(2+g_eeGeneral.beeperLength)+val));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
+48
-31
@@ -59,42 +59,59 @@ inline void _beep(uint8_t b)
|
||||
}
|
||||
#endif
|
||||
|
||||
extern void beep(uint8_t val);
|
||||
#if defined(AUDIO)
|
||||
void beep();
|
||||
#else
|
||||
void beep(uint8_t val);
|
||||
#endif
|
||||
|
||||
#define AUDIO_TADA()
|
||||
#define AUDIO_KEYPAD_UP() beep(0)
|
||||
#define AUDIO_KEYPAD_DOWN() beep(0)
|
||||
#define AUDIO_MENUS() beep(0)
|
||||
#define AUDIO_WARNING2() beep(2)
|
||||
#define AUDIO_WARNING1() beep(3)
|
||||
#define AUDIO_TX_BATTERY_LOW() beep(4)
|
||||
#define AUDIO_ERROR() beep(4)
|
||||
#define AUDIO_ERROR_MESSAGE(e) beep(4)
|
||||
#define AUDIO_TIMER_MINUTE(t) beep(2)
|
||||
#define AUDIO_TIMER_30() { beepAgain=2; beep(2); }
|
||||
#define AUDIO_TIMER_20() { beepAgain=1; beep(2); }
|
||||
#define AUDIO_TIMER_10() beep(2)
|
||||
#define AUDIO_TIMER_LT3(x) beep(2)
|
||||
#define AUDIO_INACTIVITY() beep(3)
|
||||
#define AUDIO_MIX_WARNING_1() beep(1)
|
||||
#define AUDIO_MIX_WARNING_2() beep(1)
|
||||
#define AUDIO_MIX_WARNING_3() beep(1)
|
||||
#define AUDIO_POT_STICK_MIDDLE() beep(2)
|
||||
#define AUDIO_VARIO_UP() _beep(1)
|
||||
#define AUDIO_VARIO_DOWN() _beep(1)
|
||||
#define AUDIO_TRIM(event, f) { if (!IS_KEY_FIRST(event)) warble = true; beep(1); }
|
||||
#define AUDIO_TRIM_MIDDLE(f) beep(2)
|
||||
#define AUDIO_TRIM_END(f) beep(2)
|
||||
#define AUDIO_PLAY(p) beep(3)
|
||||
#if !defined(AUDIO)
|
||||
#if defined(VOICE)
|
||||
#define AUDIO_TADA() PUSH_SYSTEM_PROMPT(AU_TADA)
|
||||
#define AUDIO_TX_BATTERY_LOW() PUSH_SYSTEM_PROMPT(AU_TX_BATTERY_LOW)
|
||||
#define AUDIO_INACTIVITY() PUSH_SYSTEM_PROMPT(AU_INACTIVITY)
|
||||
#define AUDIO_ERROR_MESSAGE(e) PUSH_SYSTEM_PROMPT((e))
|
||||
#define AUDIO_TIMER_MINUTE(t) playDuration(t)
|
||||
#define AUDIO_TIMER_30() PUSH_SYSTEM_PROMPT(AU_TIMER_30)
|
||||
#define AUDIO_TIMER_20() PUSH_SYSTEM_PROMPT(AU_TIMER_20)
|
||||
#define AUDIO_TIMER_10() PUSH_SYSTEM_PROMPT(AU_TIMER_10)
|
||||
#define AUDIO_TIMER_LT3(x) PUSH_SYSTEM_PROMPT(AU_TIMER_LT3)
|
||||
#else
|
||||
#define AUDIO_TADA()
|
||||
#define AUDIO_TX_BATTERY_LOW() beep(4)
|
||||
#define AUDIO_INACTIVITY() beep(3)
|
||||
#define AUDIO_ERROR_MESSAGE(e) beep(4)
|
||||
#define AUDIO_TIMER_MINUTE(t) beep(2)
|
||||
#define AUDIO_TIMER_30() { beepAgain=2; beep(2); }
|
||||
#define AUDIO_TIMER_20() { beepAgain=1; beep(2); }
|
||||
#define AUDIO_TIMER_10() beep(2)
|
||||
#define AUDIO_TIMER_LT3(x) beep(2)
|
||||
#endif
|
||||
|
||||
#define IS_AUDIO_BUSY() (g_beepCnt || beepAgain || beepOn)
|
||||
#define AUDIO_RESET()
|
||||
#define AUDIO_KEYPAD_UP() beep(0)
|
||||
#define AUDIO_KEYPAD_DOWN() beep(0)
|
||||
#define AUDIO_MENUS() beep(0)
|
||||
#define AUDIO_WARNING2() beep(2)
|
||||
#define AUDIO_WARNING1() beep(3)
|
||||
#define AUDIO_ERROR() beep(4)
|
||||
#define AUDIO_MIX_WARNING(x) beep(1)
|
||||
#define AUDIO_POT_STICK_MIDDLE() beep(2)
|
||||
#define AUDIO_VARIO_UP() _beep(1)
|
||||
#define AUDIO_VARIO_DOWN() _beep(1)
|
||||
#define AUDIO_TRIM(event, f) { if (!IS_KEY_FIRST(event)) warble = true; beep(1); }
|
||||
#define AUDIO_TRIM_MIDDLE(f) beep(2)
|
||||
#define AUDIO_TRIM_END(f) beep(2)
|
||||
#define AUDIO_PLAY(p) beep(3)
|
||||
|
||||
#define PLAY_PHASE_OFF(phase)
|
||||
#define PLAY_PHASE_ON(phase)
|
||||
#define IS_AUDIO_BUSY() (g_beepCnt || beepAgain || beepOn)
|
||||
#define AUDIO_RESET()
|
||||
|
||||
#define PLAY_PHASE_OFF(phase)
|
||||
#define PLAY_PHASE_ON(phase)
|
||||
#endif
|
||||
|
||||
#if !defined(CPUARM)
|
||||
inline void AUDIO_HEARTBEAT()
|
||||
inline void BUZZER_HEARTBEAT()
|
||||
{
|
||||
if(g_beepCnt) {
|
||||
if(!beepAgainOrig) {
|
||||
|
||||
+3
-1
@@ -410,11 +410,13 @@ void eeLoadModel(uint8_t id)
|
||||
frskySendAlarms();
|
||||
#endif
|
||||
|
||||
#if defined(SDCARD)
|
||||
#if defined(CPUARM) && defined(SDCARD)
|
||||
refreshModelAudioFiles();
|
||||
#endif
|
||||
|
||||
LOAD_MODEL_BITMAP();
|
||||
|
||||
SEND_FAILSAFE_1S();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-1
@@ -162,7 +162,11 @@ static void EeFsFlush()
|
||||
|
||||
uint16_t EeFsGetFree()
|
||||
{
|
||||
#if defined(CPUARM)
|
||||
int32_t ret = 0;
|
||||
#else
|
||||
int16_t ret = 0;
|
||||
#endif
|
||||
blkid_t i = eeFs.freeList;
|
||||
while (i) {
|
||||
ret += BS-1;
|
||||
@@ -809,7 +813,7 @@ bool eeLoadGeneral()
|
||||
if (theFile.readRlc((uint8_t*)&g_eeGeneral, 1) == 1 && g_eeGeneral.version == EEPROM_VER) {
|
||||
theFile.openRlc(FILE_GENERAL);
|
||||
if (theFile.readRlc((uint8_t*)&g_eeGeneral, sizeof(g_eeGeneral)) <= sizeof(EEGeneral)) {
|
||||
#if defined(CPUM64)
|
||||
#if defined(PCBSTD)
|
||||
if (g_eeGeneral.variant == EEPROM_VARIANT && g_eeGeneral.chkSum == evalChkSum()) {
|
||||
return true;
|
||||
}
|
||||
@@ -914,6 +918,8 @@ void eeLoadModel(uint8_t id)
|
||||
#endif
|
||||
|
||||
LOAD_MODEL_BITMAP();
|
||||
|
||||
SEND_FAILSAFE_1S();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -955,6 +961,10 @@ void eeReadAll()
|
||||
|
||||
void eeCheck(bool immediately)
|
||||
{
|
||||
if (EEPROM_MASSSTORAGE()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (immediately) {
|
||||
eeFlush();
|
||||
}
|
||||
|
||||
+20
-16
@@ -39,24 +39,28 @@
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define blkid_t uint16_t
|
||||
#define EESIZE (32*1024)
|
||||
#define EEFS_VERS 5
|
||||
#define MAXFILES 62
|
||||
#define BS 64
|
||||
#if defined(PCBTARANIS)
|
||||
#define blkid_t uint16_t
|
||||
#if defined(REV3)
|
||||
#define EESIZE (32*1024)
|
||||
#else
|
||||
#define EESIZE (64*1024)
|
||||
#endif
|
||||
#define EEFS_VERS 5
|
||||
#define MAXFILES 62
|
||||
#define BS 64
|
||||
#elif defined(PCBGRUVIN9X) || defined(CPUM128)
|
||||
#define blkid_t uint8_t
|
||||
#define EESIZE 4096
|
||||
#define EEFS_VERS 5
|
||||
#define MAXFILES 36
|
||||
#define BS 16
|
||||
#define blkid_t uint8_t
|
||||
#define EESIZE 4096
|
||||
#define EEFS_VERS 5
|
||||
#define MAXFILES 36
|
||||
#define BS 16
|
||||
#else
|
||||
#define blkid_t uint8_t
|
||||
#define EESIZE 2048
|
||||
#define EEFS_VERS 4
|
||||
#define MAXFILES 20
|
||||
#define BS 16
|
||||
#define blkid_t uint8_t
|
||||
#define EESIZE 2048
|
||||
#define EEFS_VERS 4
|
||||
#define MAXFILES 20
|
||||
#define BS 16
|
||||
#endif
|
||||
|
||||
PACK(struct DirEnt{
|
||||
|
||||
@@ -178,6 +178,9 @@ void sdPoll10ms();
|
||||
|
||||
// Power driver
|
||||
uint8_t pwrCheck();
|
||||
void pwrOff();
|
||||
#define UNEXPECTED_SHUTDOWN() ((mcusr & (1 << WDRF)) || g_eeGeneral.unexpectedShutdown)
|
||||
|
||||
#define EEPROM_MASSSTORAGE() (0)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -34,15 +34,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define PROMPT_SYSTEM_BASE 230
|
||||
#define PROMPT_CUSTOM_BASE 256
|
||||
#define PROMPT_CUSTOM_BASE 0
|
||||
#define PROMPT_I18N_BASE 256
|
||||
#define PROMPT_SYSTEM_BASE 480
|
||||
|
||||
extern void pushPrompt(uint16_t prompt);
|
||||
extern bool isPlaying();
|
||||
|
||||
#define PLAY_FUNCTION(x, ...) void x(__VA_ARGS__)
|
||||
#define PUSH_PROMPT(p) pushPrompt((p))
|
||||
#define PUSH_CUSTOM_PROMPT(p, id) pushPrompt(PROMPT_CUSTOM_BASE+(p))
|
||||
#define PUSH_NUMBER_PROMPT(p) pushPrompt(PROMPT_I18N_BASE+(p))
|
||||
#define PUSH_SYSTEM_PROMPT(p) pushPrompt(PROMPT_SYSTEM_BASE+(p))
|
||||
#define PLAY_NUMBER(n, u, a) playNumber((n), (u), (a))
|
||||
#define PLAY_DURATION(d) playDuration((d))
|
||||
#define IS_PLAYING(id) isPlaying()
|
||||
|
||||
+24
-38
@@ -302,7 +302,7 @@ TEST(getSwitch, nullSW)
|
||||
TEST(Phases, nullFadeOut_posFadeIn)
|
||||
{
|
||||
MODEL_RESET();
|
||||
g_model.phaseData[1].swtch = SWSRC_ID1);
|
||||
g_model.phaseData[1].swtch = SWSRC_ID1;
|
||||
g_model.phaseData[1].fadeIn = 15;
|
||||
perMain();
|
||||
simuSetSwitch(3, 0);
|
||||
@@ -320,13 +320,13 @@ TEST(Mixer, Cascaded3Channels)
|
||||
g_model.mixData[1].srcRaw = MIXSRC_CH3;
|
||||
g_model.mixData[1].weight = 100;
|
||||
g_model.mixData[2].destCh = 2;
|
||||
g_model.mixData[2].srcRaw = MIXSRC_ID1;
|
||||
g_model.mixData[2].srcRaw = MIXSRC_THR;
|
||||
g_model.mixData[2].weight = 100;
|
||||
simuSetSwitch(3, 0);
|
||||
simuSetSwitch(0, 1);
|
||||
perOut(e_perout_mode_normal, 0);
|
||||
EXPECT_EQ(chans[0], 102400);
|
||||
EXPECT_EQ(chans[1], 102400);
|
||||
EXPECT_EQ(chans[2], 102400);
|
||||
EXPECT_EQ(chans[0], 1024*256);
|
||||
EXPECT_EQ(chans[1], 1024*256);
|
||||
EXPECT_EQ(chans[2], 1024*256);
|
||||
}
|
||||
|
||||
TEST(Mixer, CascadedOrderedChannels)
|
||||
@@ -334,15 +334,15 @@ TEST(Mixer, CascadedOrderedChannels)
|
||||
MODEL_RESET();
|
||||
MIXER_RESET();
|
||||
g_model.mixData[0].destCh = 0;
|
||||
g_model.mixData[0].srcRaw = MIXSRC_ID1;
|
||||
g_model.mixData[0].srcRaw = MIXSRC_THR;
|
||||
g_model.mixData[0].weight = 100;
|
||||
g_model.mixData[1].destCh = 1;
|
||||
g_model.mixData[1].srcRaw = MIXSRC_CH1;
|
||||
g_model.mixData[1].weight = 100;
|
||||
simuSetSwitch(3, 0);
|
||||
simuSetSwitch(0, 1);
|
||||
perOut(e_perout_mode_normal, 0);
|
||||
EXPECT_EQ(chans[0], 102400);
|
||||
EXPECT_EQ(chans[1], 102400);
|
||||
EXPECT_EQ(chans[0], 1024*256);
|
||||
EXPECT_EQ(chans[1], 1024*256);
|
||||
}
|
||||
|
||||
TEST(Mixer, Cascaded5Channels)
|
||||
@@ -362,23 +362,23 @@ TEST(Mixer, Cascaded5Channels)
|
||||
g_model.mixData[3].srcRaw = MIXSRC_CH5;
|
||||
g_model.mixData[3].weight = 100;
|
||||
g_model.mixData[4].destCh = 4;
|
||||
g_model.mixData[4].srcRaw = MIXSRC_ID1;
|
||||
g_model.mixData[4].srcRaw = MIXSRC_THR;
|
||||
g_model.mixData[4].weight = 100;
|
||||
for (uint8_t i=0; i<10; i++) {
|
||||
simuSetSwitch(3, 0);
|
||||
simuSetSwitch(0, 1);
|
||||
doMixerCalculations();
|
||||
EXPECT_EQ(chans[0], 102400);
|
||||
EXPECT_EQ(chans[1], 102400);
|
||||
EXPECT_EQ(chans[2], 102400);
|
||||
EXPECT_EQ(chans[3], 102400);
|
||||
EXPECT_EQ(chans[4], 102400);
|
||||
simuSetSwitch(3, -1);
|
||||
EXPECT_EQ(chans[0], 1024*256);
|
||||
EXPECT_EQ(chans[1], 1024*256);
|
||||
EXPECT_EQ(chans[2], 1024*256);
|
||||
EXPECT_EQ(chans[3], 1024*256);
|
||||
EXPECT_EQ(chans[4], 1024*256);
|
||||
simuSetSwitch(0, 0);
|
||||
doMixerCalculations();
|
||||
EXPECT_EQ(chans[0], -102400);
|
||||
EXPECT_EQ(chans[1], -102400);
|
||||
EXPECT_EQ(chans[2], -102400);
|
||||
EXPECT_EQ(chans[3], -102400);
|
||||
EXPECT_EQ(chans[4], -102400);
|
||||
EXPECT_EQ(chans[0], -1024*256);
|
||||
EXPECT_EQ(chans[1], -1024*256);
|
||||
EXPECT_EQ(chans[2], -1024*256);
|
||||
EXPECT_EQ(chans[3], -1024*256);
|
||||
EXPECT_EQ(chans[4], -1024*256);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -428,24 +428,10 @@ TEST(Mixer, RecursiveAddChannel)
|
||||
g_model.mixData[2].srcRaw = MIXSRC_Rud;
|
||||
g_model.mixData[2].weight = 100;
|
||||
perOut(e_perout_mode_normal, 0);
|
||||
EXPECT_EQ(chans[0], 102400/2);
|
||||
EXPECT_EQ(chans[0], 1024*256/2);
|
||||
EXPECT_EQ(chans[1], 0);
|
||||
}
|
||||
|
||||
TEST(Expo, AllValues)
|
||||
{
|
||||
// TODO whole range
|
||||
for (uint16_t x=0; x<20; x++) {
|
||||
for (uint16_t k=0; k<20; k++) {
|
||||
// TODO compare with the correct function instead of this one
|
||||
// uint16_t ref = ((unsigned long)x*x*x/0x10000*k/(RESXul*RESXul/0x10000) + (RESKul-k)*x+RESKul/2)/RESKul;
|
||||
double ref = exp(log((float)x)*(float)k/10);
|
||||
printf("x=%d k=%d ref=%f res=%d\n", x, k, ref, expou(x, k));
|
||||
// EXPECT_EQ(expou(x, k), ref);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
StartEepromThread(NULL);
|
||||
|
||||
+28
-30
@@ -730,11 +730,12 @@ void putsTime(xcoord_t x, uint8_t y, putstime_t tme, LcdFlags att, LcdFlags att2
|
||||
|
||||
qr = div(tme, 60);
|
||||
|
||||
#if defined(CPUARM)
|
||||
#if defined(PCBTARANIS)
|
||||
if (att & MIDSIZE) {
|
||||
div_t qr2 = div(qr.quot, 60);
|
||||
LCD_2DOTS(x+2*8-6, y, att);
|
||||
lcd_outdezNAtt(x, y, qr2.quot, att|LEADING0|LEFT, 2);
|
||||
qr.quot = qr2.rem;
|
||||
x += 2*8+1;
|
||||
}
|
||||
#define separator ':'
|
||||
@@ -742,7 +743,7 @@ void putsTime(xcoord_t x, uint8_t y, putstime_t tme, LcdFlags att, LcdFlags att2
|
||||
char separator = ':';
|
||||
if (tme >= 3600 && (~att & DBLSIZE)) {
|
||||
qr = div(qr.quot, 60);
|
||||
separator = 'h';
|
||||
separator = CHR_HOUR;
|
||||
}
|
||||
#else
|
||||
#define separator ':'
|
||||
@@ -812,7 +813,7 @@ void putsMixerSource(xcoord_t x, uint8_t y, uint8_t idx, LcdFlags att)
|
||||
putsStrIdx(x, y, STR_PPM, idx-MIXSRC_PPM1+1, att);
|
||||
else if (idx <= MIXSRC_LAST_CH)
|
||||
putsStrIdx(x, y, STR_CH, idx-MIXSRC_CH1+1, att);
|
||||
#if defined(GVARS)
|
||||
#if defined(GVARS) || !defined(PCBSTD)
|
||||
else if (idx <= MIXSRC_LAST_GVAR)
|
||||
putsStrIdx(x, y, STR_GV, idx-MIXSRC_GVAR1+1, att);
|
||||
#endif
|
||||
@@ -851,38 +852,35 @@ void putsSwitches(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att)
|
||||
}
|
||||
|
||||
#if ROTARY_ENCODERS > 0
|
||||
if (idx >= SWSRC_FIRST_ROTENC_SWITCH) {
|
||||
if (idx <= SWSRC_LAST_ROTENC_SWITCH) {
|
||||
idx -= SWSRC_FIRST_ROTENC_SWITCH;
|
||||
char suffix;
|
||||
if (idx < ROTARY_ENCODERS) {
|
||||
suffix = 's';
|
||||
}
|
||||
else {
|
||||
idx -= ROTARY_ENCODERS;
|
||||
suffix = 'l';
|
||||
}
|
||||
lcd_putcAtt(x+3*FW, y, suffix, att);
|
||||
return lcd_putsiAtt(x, y, STR_VRENCODERS, idx, att);
|
||||
else if (idx >= SWSRC_FIRST_ROTENC_SWITCH) {
|
||||
idx -= SWSRC_FIRST_ROTENC_SWITCH;
|
||||
char suffix = (idx & 1) ? CHR_LONG : CHR_SHORT;
|
||||
lcd_putcAtt(x+3*FW, y, suffix, att);
|
||||
return lcd_putsiAtt(x, y, STR_VRENCODERS, idx/2, att);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(PCBSTD)
|
||||
else if (idx >= SWSRC_TRAINER_SHORT) {
|
||||
idx -= SWSRC_TRAINER_SHORT;
|
||||
lcd_putcAtt(x+3*FW, y, (idx & 1) ? CHR_LONG : CHR_SHORT, att);
|
||||
#if ROTARY_ENCODERS > 0
|
||||
if (idx >= 2) {
|
||||
idx -= 2;
|
||||
return lcd_putsiAtt(x, y, STR_VRENCODERS, idx/2, att);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
return lcd_putsiAtt(x, y, STR_VSWITCHES, SWSRC_TRAINER-1, att);
|
||||
}
|
||||
idx -= 2*ROTARY_ENCODERS;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (idx > SWSRC_ON) {
|
||||
idx -= SWSRC_ON;
|
||||
char suffix = 'm';
|
||||
#if defined(CPUARM)
|
||||
if (idx > SWSRC_ON) {
|
||||
suffix = 's';
|
||||
idx -= SWSRC_ON;
|
||||
if (idx > MAX_PSWITCH) {
|
||||
suffix = 'l';
|
||||
idx -= MAX_PSWITCH;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (~att & SWCONDENSED) lcd_putcAtt(x+3*FW, y, suffix, att);
|
||||
char suffix = CHR_TOGGLE;
|
||||
if (idx != SWSRC_ON && (~att & SWCONDENSED)) lcd_putcAtt(x+3*FW, y, suffix, att);
|
||||
}
|
||||
lcd_putsiAtt(x, y, STR_VSWITCHES, idx-1, att);
|
||||
}
|
||||
@@ -942,7 +940,7 @@ void putsTrimMode(xcoord_t x, uint8_t y, uint8_t phase, uint8_t idx, LcdFlags at
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(ROTARY_ENCODERS)
|
||||
#if ROTARY_ENCODERS > 0
|
||||
void putsRotaryEncoderMode(xcoord_t x, uint8_t y, uint8_t phase, uint8_t idx, LcdFlags att)
|
||||
{
|
||||
#if ROTARY_ENCODERS > 2
|
||||
|
||||
+4
-4
@@ -104,12 +104,12 @@ const pm_char * openLogs()
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY_HUB)
|
||||
if (g_model.frsky.usrProto == USR_PROTO_FRSKY)
|
||||
if (IS_USR_PROTO_FRSKY_HUB())
|
||||
f_puts("GPS Date,GPS Time,Long,Lat,Course,GPS Speed,GPS Alt,Baro Alt,Temp1,Temp2,RPM,Fuel,Volts,AccelX,AccelY,AccelZ,", &g_oLogFile);
|
||||
#endif
|
||||
|
||||
#if defined(WS_HOW_HIGH)
|
||||
if (g_model.frsky.usrProto == USR_PROTO_WS_HOW_HIGH)
|
||||
if (IS_USR_PROTO_WS_HOW_HIGH())
|
||||
f_puts("WSHH Alt,", &g_oLogFile);
|
||||
#endif
|
||||
|
||||
@@ -173,7 +173,7 @@ void writeLogs()
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY_HUB)
|
||||
if (g_model.frsky.usrProto == USR_PROTO_FRSKY) {
|
||||
if (IS_USR_PROTO_FRSKY_HUB()) {
|
||||
f_printf(&g_oLogFile, "%4d-%02d-%02d,", frskyData.hub.year+2000, frskyData.hub.month, frskyData.hub.day);
|
||||
f_printf(&g_oLogFile, "%02d:%02d:%02d,", frskyData.hub.hour, frskyData.hub.min, frskyData.hub.sec);
|
||||
f_printf(&g_oLogFile, "%03d.%04d%c,", frskyData.hub.gpsLongitude_bp, frskyData.hub.gpsLongitude_ap,
|
||||
@@ -193,7 +193,7 @@ void writeLogs()
|
||||
#endif
|
||||
|
||||
#if defined(WS_HOW_HIGH)
|
||||
if (g_model.frsky.usrProto == USR_PROTO_WS_HOW_HIGH) {
|
||||
if (IS_USR_PROTO_WS_HOW_HIGH()) {
|
||||
f_printf(&g_oLogFile, "%d,", TELEMETRY_GPS_ALT_BP);
|
||||
}
|
||||
#endif
|
||||
|
||||
+30
-42
@@ -48,33 +48,6 @@ lcdint_t applyChannelRatio(uint8_t channel, lcdint_t val)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
|
||||
void checkMinMaxAltitude()
|
||||
{
|
||||
if (TELEMETRY_ALT_BP > frskyData.hub.maxAltitude)
|
||||
frskyData.hub.maxAltitude = TELEMETRY_ALT_BP;
|
||||
if (TELEMETRY_ALT_BP < frskyData.hub.minAltitude)
|
||||
frskyData.hub.minAltitude = TELEMETRY_ALT_BP;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(VARIO) && (defined(FRSKY_HUB) || defined(WS_HOW_HIGH))
|
||||
void evalVario(int16_t altitude_bp, uint16_t altitude_ap)
|
||||
{
|
||||
int32_t varioAltitude_cm = (int32_t)altitude_bp * 100 + (altitude_bp > 0 ? altitude_ap : -altitude_ap);
|
||||
uint8_t varioAltitudeQueuePointer = frskyData.hub.varioAltitudeQueuePointer + 1;
|
||||
if (varioAltitudeQueuePointer == VARIO_QUEUE_LENGTH)
|
||||
varioAltitudeQueuePointer = 0;
|
||||
frskyData.hub.varioAltitudeQueuePointer = varioAltitudeQueuePointer;
|
||||
frskyData.hub.varioSpeed -= frskyData.hub.varioAltitudeQueue[varioAltitudeQueuePointer] ;
|
||||
frskyData.hub.varioAltitudeQueue[varioAltitudeQueuePointer] = varioAltitude_cm - frskyData.hub.varioAltitude_cm;
|
||||
frskyData.hub.varioAltitude_cm = varioAltitude_cm;
|
||||
frskyData.hub.varioSpeed += frskyData.hub.varioAltitudeQueue[varioAltitudeQueuePointer] ;
|
||||
}
|
||||
#else
|
||||
#define evalVario(...)
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY_HUB)
|
||||
void extractLatitudeLongitude(uint32_t * latitude, uint32_t * longitude)
|
||||
{
|
||||
@@ -121,24 +94,29 @@ void getGpsDistance()
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY) && defined(VARIO)
|
||||
void varioPoll10ms()
|
||||
void varioWakeup()
|
||||
{
|
||||
static uint16_t s_varioTmr = 0;
|
||||
static tmr10ms_t s_varioTmr;
|
||||
tmr10ms_t tmr10ms = get_tmr10ms();
|
||||
|
||||
if (isFunctionActive(FUNC_VARIO)) {
|
||||
#if defined(AUDIO)
|
||||
// conversion in cm/s
|
||||
int16_t verticalSpeed;
|
||||
cli();
|
||||
int16_t verticalSpeed = frskyData.hub.varioSpeed;
|
||||
sei();
|
||||
|
||||
int16_t varioCenterMax = (int16_t)g_model.frsky.varioCenterMax * 10 + 50;
|
||||
if (frskyData.hub.varioSpeed >= varioCenterMax) {
|
||||
verticalSpeed = frskyData.hub.varioSpeed - varioCenterMax;
|
||||
if (verticalSpeed >= varioCenterMax) {
|
||||
verticalSpeed = verticalSpeed - varioCenterMax;
|
||||
int16_t varioMax = (10+(int16_t)g_model.frsky.varioMax) * 100;
|
||||
if (verticalSpeed > varioMax) verticalSpeed = varioMax;
|
||||
verticalSpeed = (verticalSpeed * 10) / ((varioMax-varioCenterMax) / 100);
|
||||
}
|
||||
else {
|
||||
int16_t varioCenterMin = (int16_t)g_model.frsky.varioCenterMin * 10 - 50;
|
||||
if (frskyData.hub.varioSpeed <= varioCenterMin) {
|
||||
verticalSpeed = frskyData.hub.varioSpeed - varioCenterMin;
|
||||
if (verticalSpeed <= varioCenterMin) {
|
||||
verticalSpeed = verticalSpeed - varioCenterMin;
|
||||
int16_t varioMin = (-10+(int16_t)g_model.frsky.varioMin) * 100;
|
||||
if (verticalSpeed < varioMin) verticalSpeed = varioMin;
|
||||
verticalSpeed = (verticalSpeed * 10) / ((varioCenterMin-varioMin) / 100);
|
||||
@@ -148,17 +126,24 @@ void varioPoll10ms()
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t tmr10ms = g_tmr10ms;
|
||||
if (verticalSpeed < 0 || tmr10ms > s_varioTmr) {
|
||||
uint8_t SoundVarioBeepTime = (1600 - verticalSpeed) / 100;
|
||||
#if defined(PCBSTD)
|
||||
uint8_t SoundVarioBeepFreq = max(40, (verticalSpeed * 10 + 20000) >> 8);
|
||||
#elif defined(CPUARM)
|
||||
uint8_t SoundVarioBeepFreq = (verticalSpeed * 10 + 16000) >> 7;
|
||||
if (verticalSpeed < 0 || (int16_t)(s_varioTmr-tmr10ms) < 0) {
|
||||
#if defined(CPUARM)
|
||||
uint8_t SoundVarioBeepTime;
|
||||
uint8_t SoundVarioBeepFreq;
|
||||
if (verticalSpeed > 0) {
|
||||
SoundVarioBeepTime = (8000 - verticalSpeed * 5) / 100;
|
||||
SoundVarioBeepFreq = (verticalSpeed * 4 + 8000) >> 7;
|
||||
}
|
||||
else {
|
||||
SoundVarioBeepTime = 20;
|
||||
SoundVarioBeepFreq = (verticalSpeed * 3 + 8000) >> 7;
|
||||
}
|
||||
s_varioTmr = tmr10ms + (SoundVarioBeepTime/2);
|
||||
#else
|
||||
uint8_t SoundVarioBeepTime = (1600 - verticalSpeed) / 100;
|
||||
uint8_t SoundVarioBeepFreq = (verticalSpeed * 10 + 16000) >> 8;
|
||||
#endif
|
||||
s_varioTmr = tmr10ms + (SoundVarioBeepTime*2);
|
||||
#endif
|
||||
AUDIO_VARIO(SoundVarioBeepFreq, SoundVarioBeepTime);
|
||||
}
|
||||
|
||||
@@ -186,5 +171,8 @@ void varioPoll10ms()
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
s_varioTmr = tmr10ms;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -47,4 +47,6 @@ void sdPoll10ms();
|
||||
uint8_t pwrCheck();
|
||||
#define UNEXPECTED_SHUTDOWN() ((mcusr & (1 << WDRF)) || g_eeGeneral.unexpectedShutdown)
|
||||
|
||||
#endif
|
||||
#define EEPROM_MASSSTORAGE() (0)
|
||||
|
||||
#endif
|
||||
|
||||
+94
-73
@@ -116,7 +116,8 @@ enum menuGeneralSetupItems {
|
||||
IF_RTCLOCK(ITEM_SETUP_TIME)
|
||||
IF_BATTGRAPH(ITEM_SETUP_BATT_RANGE)
|
||||
ITEM_SETUP_SOUND_LABEL,
|
||||
ITEM_SETUP_BEEPER_MODE,
|
||||
IF_AUDIO(ITEM_SETUP_AUDIO_MODE)
|
||||
IF_BEEPER(ITEM_SETUP_BEEPER_MODE)
|
||||
ITEM_SETUP_BEEPER_LENGTH,
|
||||
IF_AUDIO(ITEM_SETUP_SPEAKER_PITCH)
|
||||
IF_VOICE(ITEM_SETUP_SPEAKER_VOLUME)
|
||||
@@ -147,6 +148,7 @@ enum menuGeneralSetupItems {
|
||||
IF_FRSKY(ITEM_SETUP_TIMEZONE)
|
||||
IF_FRSKY(ITEM_SETUP_GPSFORMAT)
|
||||
IF_PXX(ITEM_SETUP_COUNTRYCODE)
|
||||
IF_CPUARM(ITEM_SETUP_IMPERIAL)
|
||||
ITEM_SETUP_RX_CHANNEL_ORD,
|
||||
ITEM_SETUP_STICK_MODE_LABELS,
|
||||
ITEM_SETUP_STICK_MODE,
|
||||
@@ -165,7 +167,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), 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) 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) 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_BEEPER(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) 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*/});
|
||||
|
||||
uint8_t sub = m_posVert - 1;
|
||||
|
||||
@@ -260,13 +262,31 @@ void menuGeneralSetup(uint8_t event)
|
||||
lcd_putsLeft(y, STR_SOUND_LABEL);
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_BEEPER_MODE:
|
||||
g_eeGeneral.beeperMode = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_MODE, STR_VBEEPMODE, g_eeGeneral.beeperMode, -2, 1, attr, event);
|
||||
#if defined(AUDIO)
|
||||
case ITEM_SETUP_AUDIO_MODE:
|
||||
g_eeGeneral.beeperMode = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_SPEAKER, STR_VBEEPMODE, g_eeGeneral.beeperMode, -2, 1, attr, event);
|
||||
#if defined(FRSKY)
|
||||
if (attr && checkIncDec_Ret) frskySendAlarms();
|
||||
#endif
|
||||
break;
|
||||
|
||||
#if defined(BEEPER)
|
||||
case ITEM_SETUP_BEEPER_MODE:
|
||||
g_eeGeneral.alarmsBeep = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_BEEPER, STR_VBEEPMODE, g_eeGeneral.alarmsBeep, 0, 1, attr, event);
|
||||
#if defined(FRSKY)
|
||||
if (attr && checkIncDec_Ret) frskySendAlarms();
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
#else
|
||||
case ITEM_SETUP_BEEPER_MODE:
|
||||
g_eeGeneral.beeperMode = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_SPEAKER, STR_VBEEPMODE, g_eeGeneral.beeperMode, -2, 1, attr, event);
|
||||
#if defined(FRSKY)
|
||||
if (attr && checkIncDec_Ret) frskySendAlarms();
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
|
||||
case ITEM_SETUP_BEEPER_LENGTH:
|
||||
SLIDER_5POS(y, g_eeGeneral.beeperLength, STR_LENGTH, event, attr);
|
||||
break;
|
||||
@@ -336,8 +356,8 @@ void menuGeneralSetup(uint8_t event)
|
||||
|
||||
#if !defined(PCBTARANIS) && !defined(PCBACT)
|
||||
case ITEM_SETUP_CONTRAST:
|
||||
lcd_putsLeft( y, STR_CONTRAST);
|
||||
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN,y,g_eeGeneral.contrast, attr|LEFT);
|
||||
lcd_putsLeft(y, STR_CONTRAST);
|
||||
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.contrast, attr|LEFT);
|
||||
if(attr) {
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.contrast, 10, 45);
|
||||
lcdSetContrast();
|
||||
@@ -358,14 +378,14 @@ void menuGeneralSetup(uint8_t event)
|
||||
case ITEM_SETUP_MEMORY_WARNING:
|
||||
{
|
||||
uint8_t b = 1-g_eeGeneral.disableMemoryWarning;
|
||||
g_eeGeneral.disableMemoryWarning = 1 - onoffMenuItem( b, RADIO_SETUP_2ND_COLUMN, y, STR_MEMORYWARNING, attr, event ) ;
|
||||
g_eeGeneral.disableMemoryWarning = 1 - onoffMenuItem(b, RADIO_SETUP_2ND_COLUMN, y, STR_MEMORYWARNING, attr, event);
|
||||
break;
|
||||
}
|
||||
|
||||
case ITEM_SETUP_ALARM_WARNING:
|
||||
{
|
||||
uint8_t b = 1-g_eeGeneral.disableAlarmWarning;
|
||||
g_eeGeneral.disableAlarmWarning = 1 - onoffMenuItem( b, RADIO_SETUP_2ND_COLUMN, y, STR_ALARMWARNING, attr, event ) ;
|
||||
g_eeGeneral.disableAlarmWarning = 1 - onoffMenuItem(b, RADIO_SETUP_2ND_COLUMN, y, STR_ALARMWARNING, attr, event);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -414,7 +434,7 @@ void menuGeneralSetup(uint8_t event)
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_FLASH_BEEP:
|
||||
g_eeGeneral.flashBeep = onoffMenuItem(g_eeGeneral.flashBeep, RADIO_SETUP_2ND_COLUMN, y, STR_ALARM, attr, event ) ;
|
||||
g_eeGeneral.alarmsFlash = onoffMenuItem(g_eeGeneral.alarmsFlash, RADIO_SETUP_2ND_COLUMN, y, STR_ALARM, attr, event ) ;
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_BACKLIGHT_DELAY:
|
||||
@@ -465,6 +485,12 @@ void menuGeneralSetup(uint8_t event)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
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;
|
||||
#endif
|
||||
|
||||
case ITEM_SETUP_RX_CHANNEL_ORD:
|
||||
lcd_putsLeft(y, STR_RXCHANNELORD); // RAET->AETR
|
||||
for (uint8_t i=1; i<=4; i++)
|
||||
@@ -531,6 +557,58 @@ inline bool isFilenameLower(bool isfile, const char * fn, const char * line)
|
||||
return (!isfile && line[SD_SCREEN_FILE_LENGTH+1]) || (isfile==(bool)line[SD_SCREEN_FILE_LENGTH+1] && strcmp(fn, line) < 0);
|
||||
}
|
||||
|
||||
void onSdManagerMenu(const char *result)
|
||||
{
|
||||
char lfn[SD_SCREEN_FILE_LENGTH];
|
||||
|
||||
uint8_t index = m_posVert-1-s_pgOfs;
|
||||
if (result == STR_SD_INFO) {
|
||||
pushMenu(menuGeneralSdManagerInfo);
|
||||
}
|
||||
else if (result == STR_SD_FORMAT) {
|
||||
displayPopup(STR_FORMATTING);
|
||||
closeLogs();
|
||||
#if defined(PCBSKY9X)
|
||||
Card_state = SD_ST_DATA;
|
||||
#endif
|
||||
#if defined(CPUARM)
|
||||
audioQueue.stopSD();
|
||||
#endif
|
||||
if (f_mkfs(0, 1, 0) == FR_OK) {
|
||||
f_chdir("/");
|
||||
reusableBuffer.sd.offset = -1;
|
||||
}
|
||||
else {
|
||||
s_warning = STR_SDCARD_ERROR;
|
||||
}
|
||||
}
|
||||
else if (result == STR_DELETE_FILE) {
|
||||
f_getcwd(lfn, SD_SCREEN_FILE_LENGTH);
|
||||
strcat_P(lfn, PSTR("/"));
|
||||
strcat(lfn, reusableBuffer.sd.lines[index]);
|
||||
f_unlink(lfn);
|
||||
strncpy(statusLineMsg, reusableBuffer.sd.lines[index], 13);
|
||||
strcpy_P(statusLineMsg+min((uint8_t)strlen(statusLineMsg), (uint8_t)13), STR_REMOVED);
|
||||
showStatusLine();
|
||||
if ((uint16_t)m_posVert == reusableBuffer.sd.count) m_posVert--;
|
||||
reusableBuffer.sd.offset = s_pgOfs-1;
|
||||
}
|
||||
#if defined(CPUARM)
|
||||
/* TODO else if (result == STR_LOAD_FILE) {
|
||||
f_getcwd(lfn, SD_SCREEN_FILE_LENGTH);
|
||||
strcat(lfn, "/");
|
||||
strcat(lfn, reusableBuffer.sd.lines[index]);
|
||||
s_warning = eeLoadModelSD(lfn);
|
||||
} */
|
||||
else if (result == STR_PLAY_FILE) {
|
||||
f_getcwd(lfn, SD_SCREEN_FILE_LENGTH);
|
||||
strcat(lfn, "/");
|
||||
strcat(lfn, reusableBuffer.sd.lines[index]);
|
||||
audioQueue.playFile(lfn, PLAY_NOW);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void menuGeneralSdManager(uint8_t event)
|
||||
{
|
||||
FILINFO fno;
|
||||
@@ -544,11 +622,6 @@ void menuGeneralSdManager(uint8_t event)
|
||||
char lfn[SD_SCREEN_FILE_LENGTH];
|
||||
#endif
|
||||
|
||||
uint8_t _event = event;
|
||||
if (s_menu_count) {
|
||||
event = 0;
|
||||
}
|
||||
|
||||
SIMPLE_MENU(SD_IS_HC() ? STR_SDHC_CARD : STR_SD_CARD, menuTabDiag, e_Sd, 1+reusableBuffer.sd.count);
|
||||
|
||||
if (s_editMode > 0)
|
||||
@@ -585,10 +658,9 @@ void menuGeneralSdManager(uint8_t event)
|
||||
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
killEvents(event);
|
||||
_event = 0;
|
||||
if (m_posVert == 0) {
|
||||
s_menu[s_menu_count++] = STR_SD_INFO;
|
||||
s_menu[s_menu_count++] = STR_SD_FORMAT;
|
||||
MENU_ADD_ITEM(STR_SD_INFO);
|
||||
MENU_ADD_ITEM(STR_SD_FORMAT);
|
||||
}
|
||||
else {
|
||||
#if defined(CPUARM)
|
||||
@@ -599,13 +671,14 @@ void menuGeneralSdManager(uint8_t event)
|
||||
s_menu[s_menu_count++] = STR_LOAD_FILE;
|
||||
}
|
||||
else */ if (!strcmp(ext, SOUNDS_EXT)) {
|
||||
s_menu[s_menu_count++] = STR_PLAY_FILE;
|
||||
MENU_ADD_ITEM(STR_PLAY_FILE);
|
||||
}
|
||||
#endif
|
||||
s_menu[s_menu_count++] = STR_DELETE_FILE;
|
||||
s_menu[s_menu_count++] = STR_RENAME_FILE;
|
||||
s_menu[s_menu_count++] = STR_COPY_FILE;
|
||||
MENU_ADD_ITEM(STR_DELETE_FILE);
|
||||
MENU_ADD_ITEM(STR_RENAME_FILE);
|
||||
MENU_ADD_ITEM(STR_COPY_FILE);
|
||||
}
|
||||
menuHandler = onSdManagerMenu;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -701,58 +774,6 @@ void menuGeneralSdManager(uint8_t event)
|
||||
if (!reusableBuffer.sd.lines[i][SD_SCREEN_FILE_LENGTH+1]) { lcd_putcAtt(lcdLastPos, y, ']', attr); }
|
||||
}
|
||||
}
|
||||
|
||||
if (s_menu_count) {
|
||||
const char * result = displayMenu(_event);
|
||||
if (result) {
|
||||
uint8_t index = m_posVert-1-s_pgOfs;
|
||||
if (result == STR_SD_INFO) {
|
||||
pushMenu(menuGeneralSdManagerInfo);
|
||||
}
|
||||
else if (result == STR_SD_FORMAT) {
|
||||
displayPopup(STR_FORMATTING);
|
||||
closeLogs();
|
||||
#if defined(PCBSKY9X)
|
||||
Card_state = SD_ST_DATA;
|
||||
#endif
|
||||
#if defined(CPUARM)
|
||||
audioQueue.stopSD();
|
||||
#endif
|
||||
if (f_mkfs(0, 1, 0) == FR_OK) {
|
||||
f_chdir("/");
|
||||
reusableBuffer.sd.offset = -1;
|
||||
}
|
||||
else {
|
||||
s_warning = STR_SDCARD_ERROR;
|
||||
}
|
||||
}
|
||||
else if (result == STR_DELETE_FILE) {
|
||||
f_getcwd(lfn, SD_SCREEN_FILE_LENGTH);
|
||||
strcat_P(lfn, PSTR("/"));
|
||||
strcat(lfn, reusableBuffer.sd.lines[index]);
|
||||
f_unlink(lfn);
|
||||
strncpy(statusLineMsg, reusableBuffer.sd.lines[index], 13);
|
||||
strcpy_P(statusLineMsg+min((uint8_t)strlen(statusLineMsg), (uint8_t)13), STR_REMOVED);
|
||||
showStatusLine();
|
||||
if ((uint16_t)m_posVert == reusableBuffer.sd.count) m_posVert--;
|
||||
reusableBuffer.sd.offset = s_pgOfs-1;
|
||||
}
|
||||
#if defined(CPUARM)
|
||||
/* TODO else if (result == STR_LOAD_FILE) {
|
||||
f_getcwd(lfn, SD_SCREEN_FILE_LENGTH);
|
||||
strcat(lfn, "/");
|
||||
strcat(lfn, reusableBuffer.sd.lines[index]);
|
||||
s_warning = eeLoadModelSD(lfn);
|
||||
}
|
||||
else */ if (result == STR_PLAY_FILE) {
|
||||
f_getcwd(lfn, SD_SCREEN_FILE_LENGTH);
|
||||
strcat(lfn, "/");
|
||||
strcat(lfn, reusableBuffer.sd.lines[index]);
|
||||
audioQueue.playFile(lfn, PLAY_NOW);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+212
-186
@@ -58,12 +58,6 @@ enum EnumTabModel {
|
||||
IF_TEMPLATES(e_Templates)
|
||||
};
|
||||
|
||||
#if LCD_W >= 212
|
||||
const char * STR_PHASES_HEADERS[] = { " Name ", " Switch ", " Trims ", " Fade In ", " Fade Out " };
|
||||
const char * STR_LIMITS_HEADERS[] = { " Name ", " Offset ", " Min ", " Max ", " Direction ", " PPM Center ", " Symetrical " };
|
||||
const char * STR_CSW_HEADERS[] = { " Function ", " V1 ", " V2 ", " AND Switch ", " Duration ", " Delay " };
|
||||
#endif
|
||||
|
||||
void menuModelSelect(uint8_t event);
|
||||
void menuModelSetup(uint8_t event);
|
||||
void menuModelHeli(uint8_t event);
|
||||
@@ -89,7 +83,7 @@ const MenuFuncP_PROGMEM menuTabModel[] PROGMEM = {
|
||||
menuModelMixAll,
|
||||
menuModelLimits,
|
||||
IF_CURVES(menuModelCurvesAll)
|
||||
#if LCD_W >= 212
|
||||
#if LCD_W >= 212 && defined(GVARS) && defined(FLIGHT_PHASES)
|
||||
IF_GVARS(menuModelGVars)
|
||||
#endif
|
||||
menuModelCustomSwitches,
|
||||
@@ -129,9 +123,10 @@ bool listSdFiles(const char *path, const char *extension, const uint8_t maxlen,
|
||||
#endif
|
||||
|
||||
static uint16_t s_last_menu_offset = 0;
|
||||
static uint8_t s_last_flags;
|
||||
|
||||
#if defined(CPUARM)
|
||||
static uint8_t s_last_flags;
|
||||
|
||||
if (selection) {
|
||||
s_last_flags = flags;
|
||||
memset(reusableBuffer.models.menu_bss, 0, sizeof(reusableBuffer.models.menu_bss));
|
||||
@@ -180,6 +175,7 @@ bool listSdFiles(const char *path, const char *extension, const uint8_t maxlen,
|
||||
char *line = reusableBuffer.models.menu_bss[0];
|
||||
memset(line, 0, MENU_LINE_LENGTH);
|
||||
strcpy(line, "---");
|
||||
s_menu[0] = line;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,18 +237,70 @@ bool listSdFiles(const char *path, const char *extension, const uint8_t maxlen,
|
||||
}
|
||||
#endif
|
||||
|
||||
void menuModelSelect(uint8_t event)
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
void onModelSelectMenu(const char *result)
|
||||
{
|
||||
#if defined(PCBSKY9X)
|
||||
#define REFRESH(x)
|
||||
#elif defined(PCBGRUVIN9X) && defined(SDCARD)
|
||||
static bool refresh = true;
|
||||
#define REFRESH(x) refresh = (x)
|
||||
int8_t sub = m_posVert;
|
||||
|
||||
if (result == STR_SELECT_MODEL || result == STR_CREATE_MODEL) {
|
||||
displayPopup(STR_LOADINGMODEL);
|
||||
saveTimers();
|
||||
eeCheck(true); // force writing of current model data before this is changed
|
||||
if (g_eeGeneral.currModel != sub) {
|
||||
g_eeGeneral.currModel = sub;
|
||||
STORE_GENERALVARS;
|
||||
eeLoadModel(sub);
|
||||
}
|
||||
}
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
else if (result == STR_COPY_MODEL) {
|
||||
s_copyMode = COPY_MODE;
|
||||
s_copyTgtOfs = 0;
|
||||
s_copySrcRow = -1;
|
||||
}
|
||||
else if (result == STR_MOVE_MODEL) {
|
||||
s_copyMode = MOVE_MODE;
|
||||
s_copyTgtOfs = 0;
|
||||
s_copySrcRow = -1;
|
||||
}
|
||||
#endif
|
||||
#if defined(SDCARD)
|
||||
else if (result == STR_BACKUP_MODEL) {
|
||||
eeCheck(true); // force writing of current model data before this is changed
|
||||
s_warning = eeBackupModel(sub);
|
||||
}
|
||||
else if (result == STR_RESTORE_MODEL || result == STR_UPDATE_LIST) {
|
||||
if (!listSdFiles(MODELS_PATH, MODELS_EXT, sizeof(g_model.name), NULL)) {
|
||||
s_warning = STR_NO_MODELS_ON_SD;
|
||||
s_menu_flags = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else if (result == STR_DELETE_MODEL) {
|
||||
s_warning = STR_DELETEMODEL;
|
||||
s_warning_type = WARNING_TYPE_CONFIRM;
|
||||
#if defined(CPUARM)
|
||||
s_warning_info = modelNames[sub];
|
||||
#else
|
||||
#define refresh event
|
||||
#define REFRESH(x)
|
||||
char * name = reusableBuffer.models.mainname;
|
||||
eeLoadModelName(sub, name);
|
||||
s_warning_info = name;
|
||||
#endif
|
||||
s_warning_info_len = sizeof(g_model.name);
|
||||
}
|
||||
#if defined(SDCARD)
|
||||
else {
|
||||
// The user choosed a file on SD to restore
|
||||
s_warning = eeRestoreModel(sub, (char *)result);
|
||||
if (!s_warning && g_eeGeneral.currModel == sub)
|
||||
eeLoadModel(sub);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void menuModelSelect(uint8_t event)
|
||||
{
|
||||
if (s_warning_result) {
|
||||
eeDeleteModel(m_posVert); // delete file
|
||||
s_warning_result = 0;
|
||||
@@ -260,13 +308,6 @@ void menuModelSelect(uint8_t event)
|
||||
event = EVT_ENTRY_UP;
|
||||
}
|
||||
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
uint8_t _event = event;
|
||||
if (s_menu_count) {
|
||||
event = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t _event_ = (IS_ROTARY_BREAK(event) || IS_ROTARY_LONG(event) ? 0 : event);
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
@@ -286,9 +327,6 @@ void menuModelSelect(uint8_t event)
|
||||
#if !defined(CPUARM)
|
||||
if (event) {
|
||||
eeFlush(); // flush eeprom write
|
||||
#if defined(SDCARD)
|
||||
REFRESH(true);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -399,19 +437,18 @@ void menuModelSelect(uint8_t event)
|
||||
s_copyMode = 0;
|
||||
killEvents(event);
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
_event = 0;
|
||||
if (g_eeGeneral.currModel != sub) {
|
||||
if (eeModelExists(sub)) {
|
||||
s_menu[s_menu_count++] = STR_SELECT_MODEL;
|
||||
MENU_ADD_ITEM(STR_SELECT_MODEL);
|
||||
MENU_ADD_SD_ITEM(STR_BACKUP_MODEL);
|
||||
MENU_ADD_NAVIGATION_ITEM(STR_COPY_MODEL);
|
||||
MENU_ADD_NAVIGATION_ITEM(STR_MOVE_MODEL);
|
||||
s_menu[s_menu_count++] = STR_DELETE_MODEL;
|
||||
MENU_ADD_ITEM(STR_DELETE_MODEL);
|
||||
}
|
||||
else {
|
||||
#if defined(SDCARD)
|
||||
s_menu[s_menu_count++] = STR_CREATE_MODEL;
|
||||
MENU_ADD_SD_ITEM(STR_RESTORE_MODEL);
|
||||
MENU_ADD_ITEM(STR_CREATE_MODEL);
|
||||
MENU_ADD_ITEM(STR_RESTORE_MODEL);
|
||||
#else
|
||||
// TODO duplicated *3 code
|
||||
displayPopup(STR_LOADINGMODEL);
|
||||
@@ -430,6 +467,7 @@ void menuModelSelect(uint8_t event)
|
||||
MENU_ADD_NAVIGATION_ITEM(STR_COPY_MODEL);
|
||||
MENU_ADD_NAVIGATION_ITEM(STR_MOVE_MODEL);
|
||||
}
|
||||
menuHandler = onModelSelectMenu;
|
||||
#else
|
||||
if (g_eeGeneral.currModel != sub) {
|
||||
displayPopup(STR_LOADINGMODEL);
|
||||
@@ -506,12 +544,12 @@ void menuModelSelect(uint8_t event)
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
lcd_puts(27*FW-(LEN_FREE-4)*FW, 0, STR_FREE);
|
||||
if (refresh) reusableBuffer.models.eepromfree = EeFsGetFree();
|
||||
if (event) reusableBuffer.models.eepromfree = EeFsGetFree();
|
||||
lcd_outdezAtt(20*FW, 0, reusableBuffer.models.eepromfree, 0);
|
||||
lcd_puts(21*FW, 0, "bytes"); // TODO translations
|
||||
lcd_puts(21*FW, 0, STR_BYTES);
|
||||
#elif !defined(PCBSKY9X)
|
||||
lcd_puts(9*FW-(LEN_FREE-4)*FW, 0, STR_FREE);
|
||||
if (refresh) reusableBuffer.models.eepromfree = EeFsGetFree();
|
||||
if (event) reusableBuffer.models.eepromfree = EeFsGetFree();
|
||||
lcd_outdezAtt(17*FW, 0, reusableBuffer.models.eepromfree, 0);
|
||||
#endif
|
||||
|
||||
@@ -557,83 +595,18 @@ void menuModelSelect(uint8_t event)
|
||||
lcd_outdezAtt(20*FW, y, eeModelSize(k), 0);
|
||||
#else
|
||||
char * name = reusableBuffer.models.listnames[i];
|
||||
if (refresh) eeLoadModelName(k, name);
|
||||
if (event) eeLoadModelName(k, name);
|
||||
putsModelName(4*FW, y, name, k, 0);
|
||||
lcd_outdezAtt(20*FW, y, eeModelSize(k), 0);
|
||||
#endif
|
||||
if (k==g_eeGeneral.currModel && (s_copyMode!=COPY_MODE || s_copySrcRow<0 || i+s_pgOfs!=(pgofs_t)sub)) lcd_putc(1, y, '*');
|
||||
if (k==g_eeGeneral.currModel && (s_copyMode!=COPY_MODE || s_copySrcRow<0 || i+s_pgOfs!=(vertpos_t)sub)) lcd_putc(1, y, '*');
|
||||
}
|
||||
|
||||
if (s_copyMode && (pgofs_t)sub==i+s_pgOfs) {
|
||||
if (s_copyMode && (vertpos_t)sub==i+s_pgOfs) {
|
||||
lcd_filled_rect(9, y, LCD_W-1-9, 7);
|
||||
lcd_rect(8, y-1, LCD_W-1-7, 9, s_copyMode == COPY_MODE ? SOLID : DOTTED);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
REFRESH(false);
|
||||
|
||||
if (s_menu_count) {
|
||||
const char * result = displayMenu(_event);
|
||||
if (result) {
|
||||
REFRESH(true);
|
||||
if (result == STR_SELECT_MODEL || result == STR_CREATE_MODEL) {
|
||||
displayPopup(STR_LOADINGMODEL);
|
||||
saveTimers();
|
||||
eeCheck(true); // force writing of current model data before this is changed
|
||||
if (g_eeGeneral.currModel != sub) {
|
||||
g_eeGeneral.currModel = sub;
|
||||
STORE_GENERALVARS;
|
||||
eeLoadModel(sub);
|
||||
}
|
||||
}
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
else if (result == STR_COPY_MODEL) {
|
||||
s_copyMode = COPY_MODE;
|
||||
s_copyTgtOfs = 0;
|
||||
s_copySrcRow = -1;
|
||||
}
|
||||
else if (result == STR_MOVE_MODEL) {
|
||||
s_copyMode = MOVE_MODE;
|
||||
s_copyTgtOfs = 0;
|
||||
s_copySrcRow = -1;
|
||||
}
|
||||
#endif
|
||||
#if defined(SDCARD)
|
||||
else if (result == STR_BACKUP_MODEL) {
|
||||
eeCheck(true); // force writing of current model data before this is changed
|
||||
s_warning = eeBackupModel(sub);
|
||||
}
|
||||
else if (result == STR_RESTORE_MODEL || result == STR_UPDATE_LIST) {
|
||||
if (!listSdFiles(MODELS_PATH, MODELS_EXT, sizeof(g_model.name), NULL)) {
|
||||
s_warning = STR_NO_MODELS_ON_SD;
|
||||
s_menu_flags = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else if (result == STR_DELETE_MODEL) {
|
||||
s_warning = STR_DELETEMODEL;
|
||||
s_warning_type = WARNING_TYPE_CONFIRM;
|
||||
#if defined(CPUARM)
|
||||
s_warning_info = modelNames[sub];
|
||||
#else
|
||||
char * name = reusableBuffer.models.mainname;
|
||||
eeLoadModelName(sub, name);
|
||||
s_warning_info = name;
|
||||
#endif
|
||||
s_warning_info_len = sizeof(g_model.name);
|
||||
}
|
||||
#if defined(SDCARD)
|
||||
else {
|
||||
// The user choosed a file on SD to restore
|
||||
s_warning = eeRestoreModel(sub, (char *)result);
|
||||
if (!s_warning && g_eeGeneral.currModel == sub)
|
||||
eeLoadModel(sub);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void editName(uint8_t x, uint8_t y, char *name, uint8_t size, uint8_t event, uint8_t active)
|
||||
@@ -773,15 +746,26 @@ enum menuModelSetupItems {
|
||||
#define MODEL_SETUP_2ND_COLUMN (LCD_W-11*FW-MENUS_SCROLLBAR_WIDTH)
|
||||
#endif
|
||||
|
||||
void menuModelSetup(uint8_t event)
|
||||
{
|
||||
#if defined(PCBTARANIS) && defined(SDCARD)
|
||||
uint8_t _event = event;
|
||||
if (s_menu_count) {
|
||||
event = 0;
|
||||
void onModelSetupMenu(const char *result)
|
||||
{
|
||||
if (result == STR_UPDATE_LIST) {
|
||||
if (!listSdFiles(BITMAPS_PATH, BITMAPS_EXT, sizeof(g_model.bitmap), NULL)) {
|
||||
s_warning = STR_NO_BITMAPS_ON_SD;
|
||||
s_menu_flags = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// The user choosed a bmp file in the list
|
||||
memcpy(g_model.bitmap, result, sizeof(g_model.bitmap));
|
||||
LOAD_MODEL_BITMAP();
|
||||
eeDirty(EE_MODEL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void menuModelSetup(uint8_t event)
|
||||
{
|
||||
// TODO this is quick & dirty, should be done in place of the return which is hidden inside MENU(...)
|
||||
#if defined(DSM2)
|
||||
if (event == EVT_KEY_LONG(KEY_EXIT)) {
|
||||
@@ -830,13 +814,14 @@ void menuModelSetup(uint8_t event)
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, STR_VCSWFUNC, 0, attr);
|
||||
if (attr && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = 0;
|
||||
_event = 0;
|
||||
if (!listSdFiles(BITMAPS_PATH, BITMAPS_EXT, sizeof(g_model.bitmap), g_model.bitmap, LIST_NONE_SD_FILE)) {
|
||||
if (listSdFiles(BITMAPS_PATH, BITMAPS_EXT, sizeof(g_model.bitmap), g_model.bitmap, LIST_NONE_SD_FILE)) {
|
||||
menuHandler = onModelSetupMenu;
|
||||
}
|
||||
else {
|
||||
s_warning = STR_NO_BITMAPS_ON_SD;
|
||||
s_menu_flags = 0;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -996,7 +981,7 @@ void menuModelSetup(uint8_t event)
|
||||
break;
|
||||
|
||||
case ITEM_MODE_INTERNAL_MODULE_MODE:
|
||||
lcd_putsLeft(y, PSTR("\001Mode"));
|
||||
lcd_putsLeft(y, STR_MODE);
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, PSTR("\004""OFF\0""X16\0""D8\0 ""LR12"), 1+g_model.rfProtocol, m_posHorz==0 ? attr : 0);
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+5*FW+3, y, STR_CH, m_posHorz==1 ? attr : 0);
|
||||
lcd_outdezAtt(lcdLastPos, y, g_model.ppmSCH+1, LEFT | (m_posHorz==1 ? attr : 0));
|
||||
@@ -1034,8 +1019,8 @@ void menuModelSetup(uint8_t event)
|
||||
checkModelIdUnique(g_eeGeneral.currModel);
|
||||
}
|
||||
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+3*FW, y, PSTR("[Bind]"), m_posHorz==1 ? attr : 0);
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+10*FW, y, PSTR("[Range]"), m_posHorz==2 ? attr : 0);
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+3*FW, y, STR_MODULE_BIND, m_posHorz==1 ? attr : 0);
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+10*FW, y, STR_MODULE_RANGE, m_posHorz==2 ? attr : 0);
|
||||
{
|
||||
uint8_t newFlag = 0;
|
||||
if (attr && m_posHorz>0 && s_editMode>0) {
|
||||
@@ -1053,8 +1038,8 @@ void menuModelSetup(uint8_t event)
|
||||
|
||||
case ITEM_MODE_INTERNAL_MODULE_FAILSAFE:
|
||||
lcd_putsLeft(y, TR_FAILSAFE);
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, PSTR("\011""Hold\0 ""Custom\0 ""No pulses"), g_model.failsafeMode, m_posHorz==0 ? attr : 0);
|
||||
if (g_model.failsafeMode == FAILSAFE_CUSTOM) lcd_putsAtt(MODEL_SETUP_2ND_COLUMN + 10*FW, y, PSTR("[Set]"), m_posHorz==1 ? attr : 0);
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, STR_VFAILSAFE, g_model.failsafeMode, m_posHorz==0 ? attr : 0);
|
||||
if (g_model.failsafeMode == FAILSAFE_CUSTOM) lcd_putsAtt(MODEL_SETUP_2ND_COLUMN + 10*FW, y, STR_SET, m_posHorz==1 ? attr : 0);
|
||||
if (attr) {
|
||||
if (g_model.failsafeMode != FAILSAFE_CUSTOM)
|
||||
m_posHorz = 0;
|
||||
@@ -1222,31 +1207,11 @@ void menuModelSetup(uint8_t event)
|
||||
#endif // defined(PCBTARANIS)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(PCBTARANIS) && defined(SDCARD)
|
||||
if (s_menu_count) {
|
||||
const char * result = displayMenu(_event);
|
||||
if (result) {
|
||||
if (result == STR_UPDATE_LIST) {
|
||||
if (!listSdFiles(BITMAPS_PATH, BITMAPS_EXT, sizeof(g_model.bitmap), NULL)) {
|
||||
s_warning = STR_NO_BITMAPS_ON_SD;
|
||||
s_menu_flags = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// The user choosed a bmp file in the list
|
||||
memcpy(g_model.bitmap, result, sizeof(g_model.bitmap));
|
||||
LOAD_MODEL_BITMAP();
|
||||
eeDirty(EE_MODEL);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static uint8_t s_currIdx;
|
||||
|
||||
#if defined(TRANSLATIONS_FR) || defined(TRANSLATIONS_CZ) || defined(TRANSLATIONS_SE) || defined(TRANSLATIONS_DE)
|
||||
#if MENU_COLUMNS < 2
|
||||
#if LCD_W >= 212
|
||||
#define MIXES_2ND_COLUMN (18*FW)
|
||||
#else
|
||||
@@ -1482,7 +1447,7 @@ enum menuModelPhaseItems {
|
||||
IF_ROTARY_ENCODERS(ITEM_MODEL_PHASE_ROTARY_ENCODERS)
|
||||
ITEM_MODEL_PHASE_FADE_IN,
|
||||
ITEM_MODEL_PHASE_FADE_OUT,
|
||||
#if defined(GVARS) && !defined(CPUM64)
|
||||
#if defined(GVARS) && !defined(PCBSTD)
|
||||
ITEM_MODEL_PHASE_GVARS_LABEL,
|
||||
ITEM_MODEL_PHASE_GV1,
|
||||
ITEM_MODEL_PHASE_GV2,
|
||||
@@ -1498,7 +1463,7 @@ void menuModelPhaseOne(uint8_t event)
|
||||
PhaseData *phase = phaseaddress(s_currIdx);
|
||||
putsFlightPhase(13*FW, 0, s_currIdx+1, (getFlightPhase()==s_currIdx ? BOLD : 0));
|
||||
|
||||
#if defined(GVARS) && !defined(CPUM64)
|
||||
#if defined(GVARS) && !defined(PCBSTD)
|
||||
static const pm_uint8_t mstate_tab_phase1[] PROGMEM = {0, 0, 0, (uint8_t)-1, 2, 2, 2, 2, 2};
|
||||
static const pm_uint8_t mstate_tab_others[] PROGMEM = {0, 0, 3, IF_ROTARY_ENCODERS(NUM_ROTARY_ENCODERS-1) 0, 0, (uint8_t)-1, 2, 2, 2, 2, 2};
|
||||
|
||||
@@ -1515,7 +1480,7 @@ void menuModelPhaseOne(uint8_t event)
|
||||
int8_t sub = m_posVert;
|
||||
int8_t editMode = s_editMode;
|
||||
|
||||
#if defined(GVARS) && !defined(CPUM64)
|
||||
#if defined(GVARS) && !defined(PCBSTD)
|
||||
if (s_currIdx == 0 && sub>=ITEM_MODEL_PHASE_SWITCH) sub += ITEM_MODEL_PHASE_FADE_IN-ITEM_MODEL_PHASE_SWITCH;
|
||||
|
||||
for (uint8_t k=0; k<LCD_LINES-1; k++) {
|
||||
@@ -1592,7 +1557,7 @@ void menuModelPhaseOne(uint8_t event)
|
||||
phase->fadeOut = EDIT_DELAY(0, y, event, attr, STR_FADEOUT, phase->fadeOut);
|
||||
break;
|
||||
|
||||
#if defined(GVARS) && !defined(CPUM64)
|
||||
#if defined(GVARS) && !defined(PCBSTD)
|
||||
case ITEM_MODEL_PHASE_GVARS_LABEL:
|
||||
lcd_putsLeft(y, STR_GLOBAL_VARS);
|
||||
break;
|
||||
@@ -1752,8 +1717,7 @@ void menuModelHeli(uint8_t event)
|
||||
|
||||
for (uint8_t i=0; i<6; i++) {
|
||||
uint8_t y = 1 + 1*FH + i*FH;
|
||||
uint8_t attr = (sub == i ? INVERS : 0);
|
||||
|
||||
uint8_t attr = (sub == i ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
||||
switch(i) {
|
||||
case ITEM_HELI_SWASHTYPE:
|
||||
g_model.swashR.type = selectMenuItem(HELI_PARAM_OFS, y, STR_SWASHTYPE, STR_VSWASHTYPE, g_model.swashR.type, 0, SWASH_TYPE_NUM, attr, event);
|
||||
@@ -2312,7 +2276,7 @@ void menuModelMixOne(uint8_t event)
|
||||
|
||||
TITLE(s_currCh ? STR_INSERTMIX : STR_EDITMIX);
|
||||
MixData *md2 = mixaddress(s_currIdx) ;
|
||||
putsChn(lcdLastPos+1*FW,0,md2->destCh+1,0);
|
||||
putsChn(lcdLastPos+1*FW, 0, md2->destCh+1,0);
|
||||
|
||||
#if defined(ROTARY_ENCODERS)
|
||||
#if defined(CURVES)
|
||||
@@ -2363,7 +2327,7 @@ void menuModelMixOne(uint8_t event)
|
||||
case MIX_FIELD_SOURCE:
|
||||
lcd_putsColumnLeft(COLUMN_X, y, NO_INDENT(STR_SOURCE));
|
||||
putsMixerSource(COLUMN_X+MIXES_2ND_COLUMN, y, md2->srcRaw, attr);
|
||||
if(attr) CHECK_INCDEC_MODELVAR(event, md2->srcRaw, 1, MIXSRC_LAST_CH);
|
||||
if (attr) CHECK_INCDEC_MODELSOURCE(event, md2->srcRaw, 1, MIXSRC_LAST_CH);
|
||||
break;
|
||||
case MIX_FIELD_WEIGHT:
|
||||
lcd_putsColumnLeft(COLUMN_X, y, STR_WEIGHT);
|
||||
@@ -2496,6 +2460,35 @@ static uint8_t s_copySrcCh;
|
||||
#define EXPO_LINE_SELECT_POS 18
|
||||
#endif
|
||||
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
void onExpoMixMenu(const char *result)
|
||||
{
|
||||
bool expo = (g_menuStack[g_menuStackPtr] == menuModelExposAll);
|
||||
uint8_t chn = (expo ? expoaddress(s_currIdx)->chn+1 : mixaddress(s_currIdx)->destCh+1);
|
||||
|
||||
if (result == STR_EDIT) {
|
||||
pushMenu(expo ? menuModelExpoOne : menuModelMixOne);
|
||||
}
|
||||
else if (result == STR_INSERT_BEFORE || result == STR_INSERT_AFTER) {
|
||||
if (!reachExpoMixCountLimit(expo)) {
|
||||
s_currCh = chn;
|
||||
if (result == STR_INSERT_AFTER) { s_currIdx++; m_posVert++; }
|
||||
insertExpoMix(expo, s_currIdx);
|
||||
pushMenu(expo ? menuModelExpoOne : menuModelMixOne);
|
||||
}
|
||||
}
|
||||
else if (result == STR_COPY || result == STR_MOVE) {
|
||||
s_copyMode = (result == STR_COPY ? COPY_MODE : MOVE_MODE);
|
||||
s_copySrcIdx = s_currIdx;
|
||||
s_copySrcCh = chn;
|
||||
s_copySrcRow = m_posVert;
|
||||
}
|
||||
else if (result == STR_DELETE) {
|
||||
deleteExpoMix(expo, s_currIdx);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||
{
|
||||
uint8_t sub = m_posVert;
|
||||
@@ -2505,7 +2498,7 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||
|
||||
uint8_t chn = (expo ? expoaddress(s_currIdx)->chn+1 : mixaddress(s_currIdx)->destCh+1);
|
||||
|
||||
switch(event)
|
||||
switch (event)
|
||||
{
|
||||
case EVT_ENTRY:
|
||||
case EVT_ENTRY_UP:
|
||||
@@ -2519,6 +2512,12 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||
event = 0;
|
||||
}
|
||||
// no break
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
case EVT_ROTARY_LONG:
|
||||
if (s_copyMode) {
|
||||
killEvents(event);
|
||||
}
|
||||
#endif
|
||||
case EVT_KEY_BREAK(KEY_EXIT):
|
||||
if (s_copyMode) {
|
||||
if (s_copyTgtOfs) {
|
||||
@@ -2559,6 +2558,26 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||
}
|
||||
else if (sub != 0) {
|
||||
if (s_copyMode) s_currCh = 0;
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
if (s_currCh) {
|
||||
if (reachExpoMixCountLimit(expo)) break;
|
||||
insertExpoMix(expo, s_currIdx);
|
||||
pushMenu(expo ? menuModelExpoOne : menuModelMixOne);
|
||||
s_copyMode = 0;
|
||||
return;
|
||||
}
|
||||
else {
|
||||
event = 0;
|
||||
s_copyMode = 0;
|
||||
MENU_ADD_ITEM(STR_EDIT);
|
||||
MENU_ADD_ITEM(STR_INSERT_BEFORE);
|
||||
MENU_ADD_ITEM(STR_INSERT_AFTER);
|
||||
MENU_ADD_ITEM(STR_COPY);
|
||||
MENU_ADD_ITEM(STR_MOVE);
|
||||
MENU_ADD_ITEM(STR_DELETE);
|
||||
menuHandler = onExpoMixMenu;
|
||||
}
|
||||
#else
|
||||
if (s_currCh) {
|
||||
if (reachExpoMixCountLimit(expo)) break;
|
||||
insertExpoMix(expo, s_currIdx);
|
||||
@@ -2566,6 +2585,7 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||
pushMenu(expo ? menuModelExpoOne : menuModelMixOne);
|
||||
s_copyMode = 0;
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case EVT_KEY_LONG(KEY_LEFT):
|
||||
@@ -2573,7 +2593,7 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||
if (s_copyMode && !s_copyTgtOfs) {
|
||||
if (reachExpoMixCountLimit(expo)) break;
|
||||
s_currCh = chn;
|
||||
if (event == EVT_KEY_LONG(KEY_RIGHT)) s_currIdx++;
|
||||
if (event == EVT_KEY_LONG(KEY_RIGHT)) { s_currIdx++; m_posVert++; }
|
||||
insertExpoMix(expo, s_currIdx);
|
||||
pushMenu(expo ? menuModelExpoOne : menuModelMixOne);
|
||||
s_copyMode = 0;
|
||||
@@ -2581,29 +2601,33 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||
return;
|
||||
}
|
||||
break;
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
case EVT_ROTARY_LEFT:
|
||||
case EVT_ROTARY_RIGHT:
|
||||
#endif
|
||||
case EVT_KEY_FIRST(KEY_MOVE_UP):
|
||||
case EVT_KEY_REPT(KEY_MOVE_UP):
|
||||
case EVT_KEY_FIRST(KEY_MOVE_DOWN):
|
||||
case EVT_KEY_REPT(KEY_MOVE_DOWN):
|
||||
if (s_copyMode) {
|
||||
uint8_t key = (event & 0x1f);
|
||||
uint8_t next_ofs = (key == KEY_MOVE_UP ? s_copyTgtOfs - 1 : s_copyTgtOfs + 1);
|
||||
uint8_t next_ofs = ((IS_ROTARY_UP(event) || key==KEY_MOVE_UP) ? s_copyTgtOfs - 1 : s_copyTgtOfs + 1);
|
||||
|
||||
if (s_copyTgtOfs==0 && s_copyMode==COPY_MODE) {
|
||||
// insert a mix on the same channel (just above / just below)
|
||||
if (reachExpoMixCountLimit(expo)) break;
|
||||
copyExpoMix(expo, s_currIdx);
|
||||
if (key==KEY_MOVE_DOWN) s_currIdx++;
|
||||
if (IS_ROTARY_DOWN(event) || key==KEY_MOVE_DOWN) s_currIdx++;
|
||||
else if (sub-s_pgOfs >= 6) s_pgOfs++;
|
||||
}
|
||||
else if (next_ofs==0 && s_copyMode==COPY_MODE) {
|
||||
// delete the mix
|
||||
deleteExpoMix(expo, s_currIdx);
|
||||
if (key==KEY_MOVE_UP) s_currIdx--;
|
||||
if (IS_ROTARY_UP(event) || key==KEY_MOVE_UP) s_currIdx--;
|
||||
}
|
||||
else {
|
||||
// only swap the mix with its neighbor
|
||||
if (!swapExpoMix(expo, s_currIdx, key==KEY_MOVE_UP)) break;
|
||||
if (!swapExpoMix(expo, s_currIdx, IS_ROTARY_UP(event) || key==KEY_MOVE_UP)) break;
|
||||
STORE_MODELVARS;
|
||||
}
|
||||
|
||||
@@ -3026,7 +3050,7 @@ void menuModelLimits(uint8_t event)
|
||||
|
||||
void menuModelCurvesAll(uint8_t event)
|
||||
{
|
||||
#if defined(GVARS) && defined(CPUM64)
|
||||
#if defined(GVARS) && defined(PCBSTD)
|
||||
SIMPLE_MENU(STR_MENUCURVES, menuTabModel, e_CurvesAll, 1+MAX_CURVES+MAX_GVARS);
|
||||
#else
|
||||
SIMPLE_MENU(STR_MENUCURVES, menuTabModel, e_CurvesAll, 1+MAX_CURVES);
|
||||
@@ -3053,7 +3077,7 @@ void menuModelCurvesAll(uint8_t event)
|
||||
uint8_t y = 1 + FH + i*FH;
|
||||
uint8_t k = i + s_pgOfs;
|
||||
uint8_t attr = (sub == k ? INVERS : 0);
|
||||
#if defined(GVARS) && defined(CPUM64)
|
||||
#if defined(GVARS) && defined(PCBSTD)
|
||||
if (k < MAX_CURVES) {
|
||||
putsStrIdx(0, y, STR_CV, k+1, attr);
|
||||
}
|
||||
@@ -3077,7 +3101,7 @@ void menuModelCurvesAll(uint8_t event)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LCD_W >= 212 && defined(GVARS)
|
||||
#if LCD_W >= 212 && defined(GVARS) && defined(FLIGHT_PHASES)
|
||||
void menuModelGVars(uint8_t event)
|
||||
{
|
||||
MENU(PSTR("GLOBAL VARIABLES"), menuTabModel, e_GVars, 1+MAX_GVARS, {0, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES});
|
||||
@@ -3145,9 +3169,9 @@ enum CustomSwitchFields {
|
||||
|
||||
#if LCD_W >= 212
|
||||
#define CSW_1ST_COLUMN (4*FW-3)
|
||||
#define CSW_2ND_COLUMN (10*FW+1)
|
||||
#define CSW_3RD_COLUMN (18*FW+2)
|
||||
#define CSW_4TH_COLUMN (20*FW+1)
|
||||
#define CSW_2ND_COLUMN (8*FW+1)
|
||||
#define CSW_3RD_COLUMN (16*FW+2)
|
||||
#define CSW_4TH_COLUMN (21*FW+1)
|
||||
#define CSW_5TH_COLUMN (26*FW+1)
|
||||
#define CSW_6TH_COLUMN (31*FW+1)
|
||||
#else
|
||||
@@ -3480,15 +3504,27 @@ void menuModelCustomSwitches(uint8_t event)
|
||||
#define MODEL_CUSTOM_FUNC_4TH_COLUMN (18*FW+2)
|
||||
#endif
|
||||
|
||||
void menuModelCustomFunctions(uint8_t event)
|
||||
{
|
||||
#if defined(CPUARM) && defined(SDCARD)
|
||||
uint8_t _event = event;
|
||||
if (s_menu_count) {
|
||||
event = 0;
|
||||
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)) {
|
||||
s_warning = STR_NO_SOUNDS_ON_SD;
|
||||
s_menu_flags = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// The user choosed a wav file in the list
|
||||
memcpy(g_model.funcSw[sub].param.name, result, sizeof(g_model.funcSw[sub].param.name));
|
||||
eeDirty(EE_MODEL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void menuModelCustomFunctions(uint8_t event)
|
||||
{
|
||||
MENU(STR_MENUCUSTOMFUNC, menuTabModel, e_CustomFunctions, NUM_CFN+1, {0, NAVIGATION_LINE_BY_LINE|3/*repeated*/});
|
||||
|
||||
uint8_t y;
|
||||
@@ -3598,8 +3634,10 @@ void menuModelCustomFunctions(uint8_t event)
|
||||
lcd_putsiAtt(x, y, STR_VCSWFUNC, 0, attr);
|
||||
if (active && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = 0;
|
||||
_event = 0;
|
||||
if (!listSdFiles(SOUNDS_PATH, SOUNDS_EXT, sizeof(sd->param.name), sd->param.name)) {
|
||||
if (listSdFiles(SOUNDS_PATH, SOUNDS_EXT, sizeof(sd->param.name), sd->param.name)) {
|
||||
menuHandler = onCustomFunctionsMenu;
|
||||
}
|
||||
else {
|
||||
s_warning = STR_NO_SOUNDS_ON_SD;
|
||||
s_menu_flags = 0;
|
||||
}
|
||||
@@ -3657,7 +3695,7 @@ void menuModelCustomFunctions(uint8_t event)
|
||||
}
|
||||
#endif
|
||||
else if (CFN_FUNC(sd) == FUNC_RESET) {
|
||||
val_max = 3;
|
||||
val_max = FUNC_RESET_PARAM_LAST;
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_VFSWRESET, CFN_PARAM(sd), attr);
|
||||
}
|
||||
else if (CFN_FUNC(sd) < FUNC_TRAINER) {
|
||||
@@ -3751,25 +3789,6 @@ void menuModelCustomFunctions(uint8_t event)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(CPUARM) && defined(SDCARD)
|
||||
if (s_menu_count) {
|
||||
const char * result = displayMenu(_event);
|
||||
if (result) {
|
||||
if (result == STR_UPDATE_LIST) {
|
||||
if (!listSdFiles(SOUNDS_PATH, SOUNDS_EXT, sizeof(g_model.funcSw[sub].param), NULL)) {
|
||||
s_warning = STR_NO_SOUNDS_ON_SD;
|
||||
s_menu_flags = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// The user choosed a wav file in the list
|
||||
memcpy(g_model.funcSw[sub].param.name, result, sizeof(g_model.funcSw[sub].param.name));
|
||||
eeDirty(EE_MODEL);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
enum menuModelTelemetryItems {
|
||||
@@ -3788,7 +3807,9 @@ enum menuModelTelemetryItems {
|
||||
ITEM_TELEMETRY_RSSI_ALARM2,
|
||||
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
|
||||
ITEM_TELEMETRY_USR_LABEL,
|
||||
#if !defined(PCBTARANIS)
|
||||
ITEM_TELEMETRY_USR_PROTO,
|
||||
#endif
|
||||
ITEM_TELEMETRY_USR_BLADES,
|
||||
#endif
|
||||
ITEM_TELEMETRY_USR_VOLTAGE_SOURCE,
|
||||
@@ -3816,10 +3837,12 @@ enum menuModelTelemetryItems {
|
||||
ITEM_TELEMETRY_MAX
|
||||
};
|
||||
|
||||
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
|
||||
#define USRDATA_LINES (uint8_t)-1, 0, 0,
|
||||
#if defined(PCBTARANIS)
|
||||
#define USRDATA_LINES (uint8_t)-1, 0,
|
||||
#elif defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
|
||||
#define USRDATA_LINES (uint8_t)-1, 0, 0,
|
||||
#else
|
||||
#define USRDATA_LINES
|
||||
#define USRDATA_LINES
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY)
|
||||
@@ -3970,11 +3993,13 @@ void menuModelTelemetry(uint8_t event)
|
||||
lcd_putsLeft(y, STR_USRDATA);
|
||||
break;
|
||||
|
||||
#if !defined(PCBTARANIS)
|
||||
case ITEM_TELEMETRY_USR_PROTO:
|
||||
lcd_putsLeft(y, STR_PROTO);
|
||||
lcd_putsiAtt(TELEM_COL2, y, STR_VTELPROTO, g_model.frsky.usrProto, attr);
|
||||
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, g_model.frsky.usrProto, USR_PROTO_LAST);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case ITEM_TELEMETRY_USR_BLADES:
|
||||
lcd_putsLeft(y, STR_BLADES);
|
||||
@@ -4229,6 +4254,7 @@ void menuModelFailsafe(uint8_t event)
|
||||
eeDirty(EE_MODEL);
|
||||
s_editMode = 0;
|
||||
AUDIO_WARNING1();
|
||||
SEND_FAILSAFE_NOW();
|
||||
killEvents(event);
|
||||
}
|
||||
|
||||
|
||||
+43
-3
@@ -36,7 +36,7 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
pgofs_t s_pgOfs;
|
||||
vertpos_t s_pgOfs;
|
||||
int8_t s_editMode;
|
||||
uint8_t s_noHi;
|
||||
uint8_t s_noScroll;
|
||||
@@ -179,6 +179,37 @@ int16_t checkIncDec(uint8_t event, int16_t val, int16_t i_min, int16_t i_max, ui
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(AUTOSOURCE)
|
||||
if (i_flags & INCDEC_SOURCE) {
|
||||
if (s_editMode>0) {
|
||||
int8_t source = getMovedSource();
|
||||
if (source) {
|
||||
newval = MIXSRC_Rud - 1 + source;
|
||||
}
|
||||
#if defined(AUTOSWITCH)
|
||||
source = abs(getMovedSwitch());
|
||||
if (source) {
|
||||
#if defined(PCBTARANIS)
|
||||
if (source <= 5*3)
|
||||
newval = MIXSRC_FIRST_SWITCH + (source-1) / 3;
|
||||
else if (source <= 17)
|
||||
newval = MIXSRC_SF;
|
||||
else if (source <= 20)
|
||||
newval = MIXSRC_SG;
|
||||
else
|
||||
newval = MIXSRC_SH;
|
||||
#else
|
||||
if (source <= 3)
|
||||
newval = MIXSRC_3POS;
|
||||
else
|
||||
newval = MIXSRC_FIRST_SWITCH - 3 + source;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (newval > i_max || newval < i_min) {
|
||||
newval = (newval > i_max ? i_max : i_min);
|
||||
killEvents(event);
|
||||
@@ -644,10 +675,18 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
||||
|
||||
uint8_t max = menuTab ? LCD_LINES-1 : LCD_LINES-2;
|
||||
if (l_posVert<1) s_pgOfs=0;
|
||||
else if (l_posVert-s_pgOfs>max) s_pgOfs = l_posVert-max;
|
||||
else if (l_posVert-s_pgOfs<1) s_pgOfs = l_posVert-1;
|
||||
else if (l_posVert>max+s_pgOfs) s_pgOfs = l_posVert-max;
|
||||
else if (l_posVert<1+s_pgOfs) s_pgOfs = l_posVert-1;
|
||||
m_posVert = l_posVert;
|
||||
m_posHorz = l_posHorz;
|
||||
#if !defined(CPUM64)
|
||||
// cosmetics on 9x
|
||||
if (s_pgOfs > 0) {
|
||||
l_posVert--;
|
||||
if (l_posVert == s_pgOfs && MAXCOL(l_posVert) == (uint8_t)-1)
|
||||
s_pgOfs = l_posVert-1;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -846,6 +885,7 @@ uint8_t s_menu_item = 0;
|
||||
uint16_t s_menu_count = 0;
|
||||
uint8_t s_menu_flags = 0;
|
||||
uint16_t s_menu_offset = 0;
|
||||
void (*menuHandler)(const char *result);
|
||||
const char * displayMenu(uint8_t event)
|
||||
{
|
||||
const char * result = NULL;
|
||||
|
||||
+25
-26
@@ -73,13 +73,24 @@ inline void displayColumnHeader(const char **headers, uint8_t index)
|
||||
#define lcd_putsColumnLeft(x, y, str) lcd_putsLeft(y, str)
|
||||
#endif
|
||||
|
||||
// Menus related stuff ...
|
||||
#if defined(SDCARD)
|
||||
typedef uint16_t pgofs_t;
|
||||
typedef uint16_t vertpos_t;
|
||||
#else
|
||||
typedef uint8_t pgofs_t;
|
||||
typedef uint8_t vertpos_t;
|
||||
#endif
|
||||
|
||||
extern pgofs_t s_pgOfs;
|
||||
#if defined(PCBTARANIS)
|
||||
typedef uint8_t & check_event_t;
|
||||
#define horzpos_t int8_t
|
||||
#else
|
||||
typedef uint8_t check_event_t;
|
||||
#define horzpos_t uint8_t
|
||||
#endif
|
||||
|
||||
extern vertpos_t m_posVert;
|
||||
extern horzpos_t m_posHorz;
|
||||
extern vertpos_t s_pgOfs;
|
||||
extern uint8_t s_noHi;
|
||||
extern uint8_t s_noScroll;
|
||||
|
||||
@@ -102,6 +113,7 @@ inline MenuFuncP lastPopMenu()
|
||||
|
||||
void drawPotsBars();
|
||||
void doMainScreenGraphics();
|
||||
void onMainViewMenu(const char *result);
|
||||
void menuMainView(uint8_t event);
|
||||
void menuGeneralDiagAna(uint8_t event);
|
||||
#if defined(FRSKY)
|
||||
@@ -134,6 +146,7 @@ extern int8_t s_editMode; // global editmode
|
||||
#define EE_MODEL 0x02
|
||||
#define NO_INCDEC_MARKS 0x04
|
||||
#define INCDEC_SWITCH 0x08
|
||||
#define INCDEC_SOURCE 0x10
|
||||
int16_t checkIncDec(uint8_t event, int16_t i_pval, int16_t i_min, int16_t i_max, uint8_t i_flags);
|
||||
|
||||
#if defined(CPUM64)
|
||||
@@ -161,27 +174,16 @@ int8_t checkIncDecGen(uint8_t event, int8_t i_val, int8_t i_min, int8_t i_max);
|
||||
#define CHECK_INCDEC_MODELSWITCH CHECK_INCDEC_MODELVAR
|
||||
#endif
|
||||
|
||||
#if defined(AUTOSOURCE)
|
||||
#define CHECK_INCDEC_MODELSOURCE(event, var, min, max) \
|
||||
var = checkIncDec(event,var,min,max,EE_MODEL|INCDEC_SOURCE)
|
||||
#else
|
||||
#define CHECK_INCDEC_MODELSOURCE CHECK_INCDEC_MODELVAR
|
||||
#endif
|
||||
|
||||
#define CHECK_INCDEC_GENVAR(event, var, min, max) \
|
||||
var = checkIncDecGen(event,var,min,max)
|
||||
|
||||
// Menus related stuff ...
|
||||
#if defined(SDCARD)
|
||||
#define vertpos_t uint16_t
|
||||
#else
|
||||
#define vertpos_t uint8_t
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
typedef uint8_t & check_event_t;
|
||||
#define horzpos_t int8_t
|
||||
#else
|
||||
typedef uint8_t check_event_t;
|
||||
#define horzpos_t uint8_t
|
||||
#endif
|
||||
|
||||
extern vertpos_t m_posVert;
|
||||
extern horzpos_t m_posHorz;
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#define NAVIGATION_LINE_BY_LINE 0x40
|
||||
#else
|
||||
@@ -261,11 +263,7 @@ void displayWarning(uint8_t event);
|
||||
#if defined(SDCARD) || (defined(ROTARY_ENCODER_NAVIGATION) && !defined(CPUM64))
|
||||
#define NAVIGATION_MENUS
|
||||
#define MENU_ADD_ITEM(s) s_menu[s_menu_count++] = s
|
||||
#if defined(SDCARD) && defined(ROTARY_ENCODER_NAVIGATION)
|
||||
#define MENU_MAX_LINES 6
|
||||
#else
|
||||
#define MENU_MAX_LINES 4
|
||||
#endif
|
||||
#define MENU_MAX_LINES 6
|
||||
#if defined(SDCARD)
|
||||
#define MENU_ADD_SD_ITEM(s) MENU_ADD_ITEM(s)
|
||||
#else
|
||||
@@ -282,6 +280,7 @@ void displayWarning(uint8_t event);
|
||||
extern uint8_t s_menu_flags;
|
||||
extern uint16_t s_menu_offset;
|
||||
const char * displayMenu(uint8_t event);
|
||||
extern void (*menuHandler)(const char *result);
|
||||
#else
|
||||
#define s_menu_count 0
|
||||
#endif
|
||||
|
||||
+50
-38
@@ -52,47 +52,44 @@
|
||||
#define BEEP_VAL ( (g_eeGeneral.warnOpts & WARN_BVAL_BIT) >>3 )
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#define EEPROM_VER 214
|
||||
#define EEPROM_VER 214
|
||||
#elif defined(PCBSKY9X)
|
||||
#define EEPROM_VER 214
|
||||
#elif defined(PCBGRUVIN9X) || defined(CPUM128)
|
||||
#define EEPROM_VER 214
|
||||
#define EEPROM_VER 214
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
#define EEPROM_VER 214
|
||||
#elif defined(CPUM128)
|
||||
#define EEPROM_VER 215
|
||||
#else
|
||||
#define EEPROM_VER 213
|
||||
#define EEPROM_VER 213
|
||||
#endif
|
||||
|
||||
#ifndef PACK
|
||||
#define PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__))
|
||||
#endif
|
||||
|
||||
|
||||
typedef int16_t gvar_t;
|
||||
|
||||
#if !defined(CPUM64)
|
||||
#if !defined(PCBSTD)
|
||||
typedef char gvar_name_t[6];
|
||||
#define GVAR_MAX 1024
|
||||
#endif
|
||||
|
||||
#define RESERVE_RANGE_FOR_GVARS 10
|
||||
// even we do not spend space in EEPROM for 10 GVARS, we reserve the space inside the range of values, like offset, weight, etc.
|
||||
#if defined(CPUM64) && defined(GVARS)
|
||||
#if defined(PCBSTD) && defined(GVARS)
|
||||
#define MAX_GVARS 5
|
||||
#define MODEL_GVARS_DATA gvar_t gvars[MAX_GVARS];
|
||||
#define PHASE_GVARS_DATA
|
||||
#define GVAR_VALUE(x, p) g_model.gvars[x]
|
||||
#elif defined(CPUM64)
|
||||
#elif defined(PCBSTD)
|
||||
#define MAX_GVARS 0
|
||||
#define MODEL_GVARS_DATA
|
||||
#define PHASE_GVARS_DATA
|
||||
#elif defined(GVARS)
|
||||
#else
|
||||
#define MAX_GVARS 5
|
||||
#define MODEL_GVARS_DATA gvar_name_t gvarsNames[MAX_GVARS];
|
||||
#define PHASE_GVARS_DATA gvar_t gvars[MAX_GVARS]
|
||||
#define GVAR_VALUE(x, p) g_model.phaseData[p].gvars[x]
|
||||
#else
|
||||
#define MAX_GVARS 0
|
||||
#define MODEL_GVARS_DATA gvar_name_t gvarsNames[5];
|
||||
#define PHASE_GVARS_DATA gvar_t gvars[5]
|
||||
#endif
|
||||
|
||||
PACK(typedef struct t_TrainerMix {
|
||||
@@ -148,7 +145,8 @@ enum BeeperMode {
|
||||
uint8_t optrexDisplay; \
|
||||
uint8_t sticksGain; \
|
||||
uint8_t rotarySteps; \
|
||||
uint8_t countryCode;
|
||||
uint8_t countryCode; \
|
||||
uint8_t imperial;
|
||||
#elif defined(PXX)
|
||||
#define EXTRA_GENERAL_FIELDS uint8_t countryCode;
|
||||
#else
|
||||
@@ -198,17 +196,17 @@ PACK(typedef struct t_EEGeneral {
|
||||
int8_t backlightMode;
|
||||
TrainerData trainer;
|
||||
uint8_t view; //index of subview in main scrren
|
||||
int8_t spare1:3;
|
||||
uint8_t spare1:3;
|
||||
int8_t beeperMode:2;
|
||||
uint8_t flashBeep:1;
|
||||
uint8_t alarmsFlash:1;
|
||||
uint8_t disableMemoryWarning:1;
|
||||
uint8_t disableAlarmWarning:1;
|
||||
uint8_t stickMode:2;
|
||||
int8_t timezone:5;
|
||||
uint8_t spare2:1;
|
||||
uint8_t alarmsBeep:1;
|
||||
uint8_t inactivityTimer;
|
||||
uint8_t throttleReversed:1;
|
||||
uint8_t spare3:2;
|
||||
uint8_t spare2:2;
|
||||
SPLASH_MODE; /* 3bits */
|
||||
int8_t hapticMode:2; // -2=quiet, -1=only alarms, 0=no keys, 1=all
|
||||
uint8_t blOffBright:4;
|
||||
@@ -255,7 +253,7 @@ PACK(typedef struct t_ExpoData {
|
||||
char name[LEN_EXPOMIX_NAME];
|
||||
int8_t curveParam;
|
||||
}) ExpoData;
|
||||
#elif defined(CPUM64)
|
||||
#elif defined(PCBSTD)
|
||||
PACK(typedef struct t_ExpoData {
|
||||
uint8_t mode:2; // 0=end, 1=pos, 2=neg, 3=both
|
||||
int8_t swtch:6;
|
||||
@@ -357,7 +355,7 @@ PACK( union u_int8int16_t {
|
||||
#define DELAY_MAX 15 /* 7.5 seconds */
|
||||
#define SLOW_MAX 15 /* 7.5 seconds */
|
||||
|
||||
#if defined(CPUM64)
|
||||
#if defined(PCBSTD)
|
||||
PACK(typedef struct t_MixData {
|
||||
uint8_t destCh:4; // 0, 1..NUM_CHNOUT
|
||||
uint8_t curveMode:1; // O=curve, 1=differential
|
||||
@@ -475,7 +473,9 @@ enum Functions {
|
||||
FUNC_TRAINER_AIL,
|
||||
FUNC_INSTANT_TRIM,
|
||||
FUNC_PLAY_SOUND,
|
||||
#if !defined(PCBTARANIS)
|
||||
FUNC_HAPTIC,
|
||||
#endif
|
||||
FUNC_RESET,
|
||||
FUNC_VARIO,
|
||||
FUNC_PLAY_TRACK,
|
||||
@@ -517,7 +517,8 @@ enum ResetFunctionParam {
|
||||
#if ROTARY_ENCODERS > 1
|
||||
FUNC_RESET_ROTENC2,
|
||||
#endif
|
||||
FUNC_RESET_PARAMS_COUNT
|
||||
FUNC_RESET_PARAMS_COUNT,
|
||||
FUNC_RESET_PARAM_LAST = FUNC_RESET_PARAMS_COUNT-1
|
||||
};
|
||||
|
||||
#if defined(CPUARM)
|
||||
@@ -532,7 +533,9 @@ PACK(typedef struct t_CustomFnData { // Function Switches data
|
||||
PACK(union {
|
||||
char name[LEN_CFN_NAME];
|
||||
struct {
|
||||
uint32_t val;
|
||||
int16_t val;
|
||||
int16_t ext1;
|
||||
int16_t ext2;
|
||||
} composite;
|
||||
}) param;
|
||||
uint8_t mode:2;
|
||||
@@ -821,7 +824,7 @@ PACK(typedef struct t_SwashRingData { // Swash Ring data
|
||||
#define ROTARY_ENCODER_ARRAY_EXTRA
|
||||
#endif
|
||||
|
||||
#if defined(CPUM64)
|
||||
#if defined(PCBSTD)
|
||||
#define TRIM_ARRAY int8_t trim[4]; int8_t trim_ext:8
|
||||
#else
|
||||
#define TRIM_ARRAY int16_t trim[4]
|
||||
@@ -857,7 +860,7 @@ PACK(typedef struct t_PhaseData {
|
||||
#define MAX_EXPOS 32
|
||||
#define NUM_CSW 32 // number of custom switches
|
||||
#define NUM_CFN 32 // number of functions assigned to switches
|
||||
#elif defined(PCBGRUVIN9X) || defined(CPUM128)
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
#define MAX_MODELS 30
|
||||
#define NUM_CHNOUT 16 // number of real output channels CH1-CH16
|
||||
#define MAX_PHASES 6
|
||||
@@ -865,6 +868,14 @@ PACK(typedef struct t_PhaseData {
|
||||
#define MAX_EXPOS 16
|
||||
#define NUM_CSW 15 // number of custom switches
|
||||
#define NUM_CFN 24 // number of functions assigned to switches
|
||||
#elif defined(CPUM128)
|
||||
#define MAX_MODELS 30
|
||||
#define NUM_CHNOUT 16 // number of real output channels CH1-CH16
|
||||
#define MAX_PHASES 5
|
||||
#define MAX_MIXERS 32
|
||||
#define MAX_EXPOS 14
|
||||
#define NUM_CSW 15 // number of custom switches
|
||||
#define NUM_CFN 24 // number of functions assigned to switches
|
||||
#else
|
||||
#define MAX_MODELS 16
|
||||
#define NUM_CHNOUT 16 // number of real output channels CH1-CH16
|
||||
@@ -950,23 +961,22 @@ enum SwitchSources {
|
||||
SWSRC_FIRST_MOMENT_SWITCH,
|
||||
SWSRC_LAST_MOMENT_SWITCH = SWSRC_FIRST_MOMENT_SWITCH+SWSRC_ON-1,
|
||||
|
||||
#if !defined(PCBSTD)
|
||||
SWSRC_TRAINER_SHORT,
|
||||
SWSRC_TRAINER_LONG,
|
||||
#endif
|
||||
|
||||
#if ROTARY_ENCODERS > 0
|
||||
SWSRC_FIRST_ROTENC_SWITCH,
|
||||
SWSRC_LAST_ROTENC_SWITCH = SWSRC_FIRST_ROTENC_SWITCH+(2*ROTARY_ENCODERS)-1,
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
SWSRC_FIRST_SHORT_SWITCH,
|
||||
SWSRC_LAST_SHORT_SWITCH = SWSRC_FIRST_SHORT_SWITCH + MAX_PSWITCH - 1,
|
||||
SWSRC_FIRST_LONG_SWITCH,
|
||||
SWSRC_LAST_LONG_SWITCH = SWSRC_FIRST_LONG_SWITCH + MAX_PSWITCH - 1,
|
||||
#endif
|
||||
|
||||
SWSRC_COUNT,
|
||||
SWSRC_FIRST = -SWSRC_LAST_MOMENT_SWITCH,
|
||||
SWSRC_LAST = SWSRC_COUNT-1,
|
||||
|
||||
SWSRC_OFF = -SWSRC_ON
|
||||
SWSRC_OFF = -SWSRC_ON,
|
||||
SWSRC_TRAINER = SWSRC_SW1-1,
|
||||
};
|
||||
|
||||
enum MixSources {
|
||||
@@ -1012,8 +1022,10 @@ enum MixSources {
|
||||
MIXSRC_TrimThr,
|
||||
MIXSRC_TrimAil,
|
||||
|
||||
MIXSRC_FIRST_SWITCH,
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
MIXSRC_SA,
|
||||
MIXSRC_SA = MIXSRC_FIRST_SWITCH,
|
||||
MIXSRC_SB,
|
||||
MIXSRC_SC,
|
||||
MIXSRC_SD,
|
||||
@@ -1022,7 +1034,7 @@ enum MixSources {
|
||||
MIXSRC_SG,
|
||||
MIXSRC_SH,
|
||||
#else
|
||||
MIXSRC_3POS,
|
||||
MIXSRC_3POS = MIXSRC_FIRST_SWITCH,
|
||||
#if defined(EXTRA_3POS)
|
||||
MIXSRC_3POS2,
|
||||
#endif
|
||||
@@ -1139,7 +1151,7 @@ enum FailsafeModes {
|
||||
|
||||
#if defined(MAVLINK)
|
||||
#define TELEMETRY_DATA MavlinkData mavlink;
|
||||
#elif defined(FRSKY) || !defined(CPUM64)
|
||||
#elif defined(FRSKY)
|
||||
#define TELEMETRY_DATA FrSkyData frsky;
|
||||
#else
|
||||
#define TELEMETRY_DATA
|
||||
@@ -1165,7 +1177,7 @@ PACK(typedef struct t_ModelData {
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare1:1;
|
||||
int8_t ppmDelay;
|
||||
BeepANACenter beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
BeepANACenter beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
MixData mixData[MAX_MIXERS];
|
||||
LimitData limitData[NUM_CHNOUT];
|
||||
ExpoData expoData[MAX_EXPOS];
|
||||
@@ -1174,7 +1186,7 @@ PACK(typedef struct t_ModelData {
|
||||
int8_t points[NUM_POINTS];
|
||||
|
||||
CustomSwData customSw[NUM_CSW];
|
||||
CustomFnData funcSw[NUM_CFN];
|
||||
CustomFnData funcSw[NUM_CFN];
|
||||
SwashRingData swashR;
|
||||
PhaseData phaseData[MAX_PHASES];
|
||||
|
||||
|
||||
+196
-113
@@ -236,11 +236,6 @@ void per10ms()
|
||||
if (lightOffCounter) lightOffCounter--;
|
||||
if (s_noHi) s_noHi--;
|
||||
if (trimsCheckTimer) trimsCheckTimer --;
|
||||
if ((g_blinkTmr10ms & 0x1F) == 0) {
|
||||
inacCounter++;
|
||||
if ((((uint8_t)inacCounter)&0x0F)==0x01 && g_eeGeneral.inactivityTimer && g_vbat100mV>50 && inacCounter > ((uint16_t)g_eeGeneral.inactivityTimer*187))
|
||||
AUDIO_INACTIVITY();
|
||||
}
|
||||
|
||||
#if defined(RTCLOCK)
|
||||
/* Update global Date/Time every 100 per10ms cycles */
|
||||
@@ -282,20 +277,22 @@ void per10ms()
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined(FRSKY) || defined(MAVLINK) || defined(JETI)) && !defined(CPUARM)
|
||||
#if defined(FRSKY)
|
||||
if (!IS_DSM2_SERIAL_PROTOCOL(s_current_protocol))
|
||||
telemetryPoll10ms();
|
||||
telemetryInterrupt10ms();
|
||||
#endif
|
||||
|
||||
// These moved here from perOut() to improve beep trigger reliability.
|
||||
#if defined(PWM_BACKLIGHT)
|
||||
if ((g_tmr10ms&0x03) == 0x00)
|
||||
fadeBacklight(); // increment or decrement brightness until target brightness is reached
|
||||
backlightFade(); // increment or decrement brightness until target brightness is reached
|
||||
#endif
|
||||
|
||||
if(mixWarning & 1) if(((g_tmr10ms&0xFF)== 0)) AUDIO_MIX_WARNING_1();
|
||||
if(mixWarning & 2) if(((g_tmr10ms&0xFF)== 64) || ((g_tmr10ms&0xFF)== 72)) AUDIO_MIX_WARNING_2();
|
||||
if(mixWarning & 4) if(((g_tmr10ms&0xFF)==128) || ((g_tmr10ms&0xFF)==136) || ((g_tmr10ms&0xFF)==144)) AUDIO_MIX_WARNING_3();
|
||||
#if !defined(AUDIO)
|
||||
if (mixWarning & 1) if(((g_tmr10ms&0xFF)== 0)) AUDIO_MIX_WARNING(1);
|
||||
if (mixWarning & 2) if(((g_tmr10ms&0xFF)== 64) || ((g_tmr10ms&0xFF)== 72)) AUDIO_MIX_WARNING(2);
|
||||
if (mixWarning & 4) if(((g_tmr10ms&0xFF)==128) || ((g_tmr10ms&0xFF)==136) || ((g_tmr10ms&0xFF)==144)) AUDIO_MIX_WARNING(3);
|
||||
#endif
|
||||
|
||||
#if defined(SDCARD)
|
||||
sdPoll10ms();
|
||||
@@ -364,7 +361,14 @@ void generalDefault()
|
||||
g_eeGeneral.version = EEPROM_VER;
|
||||
g_eeGeneral.variant = EEPROM_VARIANT;
|
||||
g_eeGeneral.contrast = 25;
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
g_eeGeneral.vBatWarn = 65;
|
||||
g_eeGeneral.vBatMin = -30;
|
||||
g_eeGeneral.vBatMax = -40;
|
||||
#else
|
||||
g_eeGeneral.vBatWarn = 90;
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < NUM_STICKS+NUM_POTS; ++i) {
|
||||
g_eeGeneral.calibMid[i] = 0x200;
|
||||
@@ -417,6 +421,10 @@ void modelDefault(uint8_t id)
|
||||
modelIds[id] = g_model.modelId = id+1;
|
||||
checkModelIdUnique(id);
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
g_model.frsky.channels[0].ratio = 132;
|
||||
#endif
|
||||
}
|
||||
|
||||
int16_t intpol(int16_t x, uint8_t idx) // -100, -75, -50, -25, 0, 25 ,50, 75, 100
|
||||
@@ -662,14 +670,13 @@ void applyExpos(int16_t *anas)
|
||||
else
|
||||
v = expo(v, GET_GVAR(curveParam, -100, 100, s_perout_flight_phase));
|
||||
}
|
||||
int16_t weight=GET_GVAR(ed.weight, 0, 100, s_perout_flight_phase);
|
||||
weight=calc100to256(weight);
|
||||
int16_t weight = GET_GVAR(ed.weight, 0, 100, s_perout_flight_phase);
|
||||
weight = calc100to256(weight);
|
||||
v = ((int32_t)v * weight) >> 8;
|
||||
// v = ((int32_t)v * GET_GVAR(ed.weight, 0, 100, s_perout_flight_phase)) / 100;
|
||||
anas[cur_chn] = v;
|
||||
} //endif
|
||||
} //endif getSwitch
|
||||
} //endfor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(CPUARM)
|
||||
@@ -886,7 +893,7 @@ getvalue_t getValue(uint8_t i)
|
||||
else if (i<MIXSRC_FIRST_TELEM-1+TELEM_RSSI_TX) return frskyData.rssi[1].value;
|
||||
else if (i<MIXSRC_FIRST_TELEM-1+TELEM_RSSI_RX) return frskyData.rssi[0].value;
|
||||
else if (i<MIXSRC_FIRST_TELEM-1+TELEM_A2) return frskyData.analog[i+1-MIXSRC_FIRST_TELEM+1-TELEM_A1].value;
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(FRSKY_SPORT)
|
||||
else if (i<MIXSRC_FIRST_TELEM-1+TELEM_ALT) return frskyData.hub.baroAltitude;
|
||||
#elif defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
|
||||
else if (i<MIXSRC_FIRST_TELEM-1+TELEM_ALT) return TELEMETRY_ALT_BP;
|
||||
@@ -988,8 +995,8 @@ bool __getSwitch(int8_t swtch)
|
||||
}
|
||||
}
|
||||
else {
|
||||
int16_t x = getValue(cs->v1-1);
|
||||
int16_t y;
|
||||
getvalue_t x = getValue(cs->v1-1);
|
||||
getvalue_t y;
|
||||
if (s == CS_VCOMP) {
|
||||
y = getValue(cs->v2-1);
|
||||
|
||||
@@ -1124,8 +1131,7 @@ bool getSwitch(int8_t swtch, bool nc)
|
||||
swstate_t switches_states = 0;
|
||||
int8_t getMovedSwitch()
|
||||
{
|
||||
static tmr10ms_t s_last_time = 0;
|
||||
|
||||
static tmr10ms_t s_move_last_time = 0;
|
||||
int8_t result = 0;
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
@@ -1169,14 +1175,42 @@ int8_t getMovedSwitch()
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((tmr10ms_t)(get_tmr10ms() - s_last_time) > 10)
|
||||
if ((tmr10ms_t)(get_tmr10ms() - s_move_last_time) > 10)
|
||||
result = 0;
|
||||
|
||||
s_last_time = get_tmr10ms();
|
||||
|
||||
s_move_last_time = get_tmr10ms();
|
||||
return result;
|
||||
}
|
||||
|
||||
#if defined(AUTOSOURCE)
|
||||
int8_t getMovedSource()
|
||||
{
|
||||
static tmr10ms_t s_move_last_time = 0;
|
||||
static int16_t sourcesStates[NUM_STICKS+NUM_POTS];
|
||||
|
||||
int8_t result = 0;
|
||||
|
||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||
if (abs(calibratedStick[i] - sourcesStates[i]) > 512) {
|
||||
result = 1+i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool recent = ((tmr10ms_t)(get_tmr10ms() - s_move_last_time) > 10);
|
||||
if (recent) {
|
||||
result = 0;
|
||||
}
|
||||
|
||||
if (result || recent) {
|
||||
memcpy(sourcesStates, calibratedStick, sizeof(sourcesStates));
|
||||
}
|
||||
|
||||
s_move_last_time = get_tmr10ms();
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FLIGHT_PHASES
|
||||
uint8_t getFlightPhase()
|
||||
{
|
||||
@@ -1193,7 +1227,7 @@ uint8_t getFlightPhase()
|
||||
int16_t getRawTrimValue(uint8_t phase, uint8_t idx)
|
||||
{
|
||||
PhaseData *p = phaseaddress(phase);
|
||||
#if defined(CPUM64)
|
||||
#if defined(PCBSTD)
|
||||
return (((int16_t)p->trim[idx]) << 2) + ((p->trim_ext >> (2*idx)) & 0x03);
|
||||
#else
|
||||
return p->trim[idx];
|
||||
@@ -1208,7 +1242,7 @@ int16_t getTrimValue(uint8_t phase, uint8_t idx)
|
||||
void setTrimValue(uint8_t phase, uint8_t idx, int16_t trim)
|
||||
{
|
||||
PhaseData *p = phaseaddress(phase);
|
||||
#if defined(CPUM64)
|
||||
#if defined(PCBSTD)
|
||||
p->trim[idx] = (int8_t)(trim >> 2);
|
||||
p->trim_ext = (p->trim_ext & ~(0x03 << (2*idx))) + (((trim & 0x03) << (2*idx)));
|
||||
#else
|
||||
@@ -1283,7 +1317,7 @@ void incRotaryEncoder(uint8_t idx, int8_t inc)
|
||||
uint8_t s_gvar_timer = 0;
|
||||
uint8_t s_gvar_last = 0;
|
||||
|
||||
#if defined(CPUM64)
|
||||
#if defined(PCBSTD)
|
||||
int16_t getGVarValue(int16_t x, int16_t min, int16_t max)
|
||||
{
|
||||
if (GV_IS_GV_VALUE(x,min,max)) {
|
||||
@@ -1356,31 +1390,37 @@ void setGVarValue(uint8_t idx, int16_t value, int8_t phase)
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY) || defined(CPUARM)
|
||||
inline void convertUnit(getvalue_t & val, uint8_t & unit)
|
||||
{
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_DEGREES) {
|
||||
val += 18;
|
||||
val *= 115;
|
||||
val >>= 6;
|
||||
}
|
||||
if (unit == UNIT_METERS) {
|
||||
// m to ft *105/32
|
||||
val = val * 3 + (val >> 2) + (val >> 5);
|
||||
}
|
||||
if (unit == UNIT_FEET) {
|
||||
unit = UNIT_METERS;
|
||||
}
|
||||
if (unit == UNIT_KTS) {
|
||||
unit = UNIT_KMH;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (unit == UNIT_KTS) {
|
||||
// kts to km/h
|
||||
unit = UNIT_KMH;
|
||||
val = (val * 46) / 25;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void putsTelemetryValue(xcoord_t x, uint8_t y, lcdint_t val, uint8_t unit, uint8_t att)
|
||||
{
|
||||
#ifdef IMPERIAL_UNITS
|
||||
if (unit == UNIT_DEGREES) {
|
||||
val += 18 ;
|
||||
val *= 115 ;
|
||||
val >>= 6 ;
|
||||
}
|
||||
if (unit == UNIT_METERS) {
|
||||
// m to ft *105/32
|
||||
val = val * 3 + ( val >> 2 ) + (val >> 5) ;
|
||||
}
|
||||
if (unit == UNIT_FEET) {
|
||||
unit = UNIT_METERS;
|
||||
}
|
||||
if (unit == UNIT_KTS) {
|
||||
unit = UNIT_KMH;
|
||||
}
|
||||
#else
|
||||
if (unit == UNIT_KTS) {
|
||||
// kts to km/h
|
||||
unit = UNIT_KMH;
|
||||
val = (val * 46) / 25;
|
||||
}
|
||||
#endif
|
||||
convertUnit(val, unit);
|
||||
lcd_outdezAtt(x, y, val, att & (~NO_UNIT));
|
||||
if (!(att & NO_UNIT) && unit != UNIT_RAW)
|
||||
lcd_putsiAtt(lcdLastPos/*+1*/, y, STR_VTELEMUNIT, unit, 0);
|
||||
@@ -1568,7 +1608,7 @@ void checkTHR()
|
||||
void checkAlarm() // added by Gohst
|
||||
{
|
||||
if (g_eeGeneral.disableAlarmWarning) return;
|
||||
if (g_eeGeneral.beeperMode == e_mode_quiet) ALERT(STR_ALARMSWARN, STR_ALARMSDISABLED, AU_ERROR);
|
||||
if (IS_SOUND_OFF()) ALERT(STR_ALARMSWARN, STR_ALARMSDISABLED, AU_ERROR);
|
||||
}
|
||||
|
||||
void checkSwitches()
|
||||
@@ -1695,7 +1735,7 @@ uint8_t checkTrim(uint8_t event)
|
||||
#if defined(GVARS)
|
||||
#define TRIM_REUSED() trimGvar[idx] >= 0
|
||||
if (TRIM_REUSED()) {
|
||||
#if defined(CPUM64)
|
||||
#if defined(PCBSTD)
|
||||
phase = 0;
|
||||
#else
|
||||
phase = getGVarFlightPhase(s_perout_flight_phase, trimGvar[idx]);
|
||||
@@ -2013,12 +2053,9 @@ uint16_t inacSum = 0;
|
||||
BeepANACenter bpanaCenter = 0;
|
||||
|
||||
uint16_t sDelay[MAX_MIXERS] = {0};
|
||||
#if defined(CPUARM)
|
||||
int32_t act [MAX_MIXERS] = {0};
|
||||
#else
|
||||
__int24 act [MAX_MIXERS] = {0};
|
||||
#endif
|
||||
int24_t act [MAX_MIXERS] = {0};
|
||||
uint8_t swOn [MAX_MIXERS] = {0};
|
||||
|
||||
uint8_t mixWarning;
|
||||
|
||||
FORCEINLINE void evalTrims()
|
||||
@@ -2169,7 +2206,7 @@ tmr10ms_t lastFunctionTime[NUM_CFN] = { 0 };
|
||||
#if defined(VOICE)
|
||||
PLAY_FUNCTION(playValue, uint8_t idx)
|
||||
{
|
||||
int16_t val = getValue(idx);
|
||||
getvalue_t val = getValue(idx);
|
||||
|
||||
switch (idx) {
|
||||
case MIXSRC_FIRST_TELEM-1+TELEM_TX_VOLTAGE-1:
|
||||
@@ -2241,8 +2278,8 @@ PLAY_FUNCTION(playValue, uint8_t idx)
|
||||
#endif
|
||||
case MIXSRC_FIRST_TELEM-1+TELEM_MIN_ALT-1:
|
||||
case MIXSRC_FIRST_TELEM-1+TELEM_MAX_ALT-1:
|
||||
#if defined(IMPERIAL_UNITS)
|
||||
if (g_model.frsky.usrProto == USR_PROTO_WS_HOW_HIGH)
|
||||
#if defined(WS_HOW_HIGH)
|
||||
if (IS_IMPERIAL_ENABLE() && IS_USR_PROTO_WS_HOW_HIGH())
|
||||
PLAY_NUMBER(val, 1+UNIT_FEET, 0);
|
||||
else
|
||||
#endif
|
||||
@@ -2269,13 +2306,6 @@ PLAY_FUNCTION(playValue, uint8_t idx)
|
||||
unit = 3 + idx - (MIXSRC_FIRST_TELEM-1+TELEM_MAX_T1-1);
|
||||
|
||||
unit = pgm_read_byte(bchunit_ar+unit);
|
||||
#if !defined(IMPERIAL_UNITS)
|
||||
if (unit == UNIT_KTS) {
|
||||
// kts to km/h
|
||||
unit = UNIT_KMH;
|
||||
val = (val * 46) / 25;
|
||||
}
|
||||
#endif
|
||||
PLAY_NUMBER(val, unit == UNIT_RAW ? 0 : unit+1, 0);
|
||||
break;
|
||||
}
|
||||
@@ -2290,11 +2320,15 @@ PLAY_FUNCTION(playValue, uint8_t idx)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(PCBSTD)
|
||||
uint8_t mSwitchDuration[1+NUM_ROTARY_ENCODERS] = { 0 };
|
||||
#define CFN_PRESSLONG_DURATION 100
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
uint8_t currentSpeakerVolume = 255;
|
||||
uint8_t requiredSpeakerVolume;
|
||||
uint8_t fnSwitchDuration[NUM_CFN] = { 0 };
|
||||
#define CFN_PRESSLONG_DURATION 100
|
||||
|
||||
inline void playCustomFunctionFile(CustomFnData *sd, uint8_t id)
|
||||
{
|
||||
@@ -2304,7 +2338,6 @@ inline void playCustomFunctionFile(CustomFnData *sd, uint8_t id)
|
||||
strcat(lfn+sizeof(SOUNDS_PATH), SOUNDS_EXT);
|
||||
PLAY_FILE(lfn, sd->func==FUNC_BACKGND_MUSIC ? PLAY_BACKGROUND : 0, id);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void evalFunctions()
|
||||
@@ -2333,27 +2366,30 @@ void evalFunctions()
|
||||
MASK_CFN_TYPE switch_mask = ((MASK_CFN_TYPE)1 << i);
|
||||
uint8_t momentary = 0;
|
||||
|
||||
#if defined(CPUARM)
|
||||
#if !defined(PCBSTD)
|
||||
|
||||
#define MOMENTARY_START_TEST() ( (momentary && !(activeSwitches & switch_mask) && active) || \
|
||||
(shortPress && !active && fnSwitchDuration[i]>0 && fnSwitchDuration[i]<CFN_PRESSLONG_DURATION) || \
|
||||
(longPress && active && fnSwitchDuration[i]>=CFN_PRESSLONG_DURATION) )
|
||||
(short_long==1 && !active && mSwitchDuration[mswitch]>0 && mSwitchDuration[mswitch]<CFN_PRESSLONG_DURATION) || \
|
||||
(short_long==2 && active && mSwitchDuration[mswitch]>=CFN_PRESSLONG_DURATION) )
|
||||
|
||||
uint8_t shortPress=0, longPress=0;
|
||||
if (swtch > MAX_SWITCH+1+MAX_SWITCH+1+MAX_PSWITCH) {
|
||||
longPress = 1;
|
||||
swtch -= MAX_SWITCH+1+MAX_SWITCH+1+MAX_PSWITCH;
|
||||
uint8_t short_long = 0;
|
||||
uint8_t mswitch = 0;
|
||||
|
||||
if (swtch == SWSRC_TRAINER_LONG) {
|
||||
short_long = 2;
|
||||
swtch = SWSRC_TRAINER;
|
||||
mswitch = 0;
|
||||
}
|
||||
else if (swtch > MAX_SWITCH+1+MAX_SWITCH+1) {
|
||||
shortPress = 1;
|
||||
swtch -= MAX_SWITCH+1+MAX_SWITCH+1;
|
||||
else if (swtch == SWSRC_TRAINER_SHORT) {
|
||||
short_long = 1;
|
||||
swtch = SWSRC_TRAINER;
|
||||
mswitch = 0;
|
||||
}
|
||||
else
|
||||
|
||||
#else
|
||||
|
||||
#define shortPress 0
|
||||
#define longPress 0
|
||||
#define short_long 0
|
||||
#define MOMENTARY_START_TEST() (!(activeSwitches & switch_mask) && active)
|
||||
|
||||
#endif
|
||||
@@ -2369,48 +2405,59 @@ void evalFunctions()
|
||||
|
||||
bool active = getSwitch(swtch, 0);
|
||||
if (active) newActiveSwitches |= switch_mask;
|
||||
if (momentary || longPress || shortPress) {
|
||||
if (momentary || short_long) {
|
||||
|
||||
#if defined(CPUARM)
|
||||
#if !defined(PCBSTD)
|
||||
bool swState = active;
|
||||
#endif
|
||||
|
||||
if (MOMENTARY_START_TEST()) {
|
||||
|
||||
active = !(activeFnSwitches & switch_mask);
|
||||
if (short_long) {
|
||||
active = false;
|
||||
momentary = true;
|
||||
}
|
||||
else {
|
||||
active = !(activeFnSwitches & switch_mask);
|
||||
#if !defined(CPUARM)
|
||||
if (CFN_FUNC(sd) == FUNC_PLAY_BOTH && !active) {
|
||||
momentary = 1;
|
||||
}
|
||||
else
|
||||
if (CFN_FUNC(sd) == FUNC_PLAY_BOTH && !active) {
|
||||
momentary = true;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
momentary = 0;
|
||||
{
|
||||
momentary = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (swtch == SWSRC_ON) {
|
||||
active = false;
|
||||
momentary = false;
|
||||
}
|
||||
else {
|
||||
active = (activeFnSwitches & switch_mask);
|
||||
momentary = 0;
|
||||
momentary = false;
|
||||
}
|
||||
#if defined(CPUARM)
|
||||
if (shortPress || longPress) {
|
||||
#if !defined(PCBSTD)
|
||||
if (short_long) {
|
||||
if (swState) {
|
||||
if (fnSwitchDuration[i] < 255)
|
||||
fnSwitchDuration[i]++;
|
||||
if (mSwitchDuration[mswitch] < 255)
|
||||
mSwitchDuration[mswitch]++;
|
||||
}
|
||||
else {
|
||||
fnSwitchDuration[i] = 0;
|
||||
mSwitchDuration[mswitch] = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#if !defined(CPUARM)
|
||||
else if (CFN_FUNC(sd) == FUNC_PLAY_BOTH) {
|
||||
momentary = 1;
|
||||
momentary = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (active || momentary) {
|
||||
|
||||
if (CFN_ACTIVE(sd)) {
|
||||
if (CFN_FUNC(sd) < FUNC_TRAINER) {
|
||||
safetyCh[CFN_CH_NUMBER(sd)] = CFN_PARAM(sd);
|
||||
@@ -2623,9 +2670,9 @@ void perOut(uint8_t mode, uint8_t tick10ms)
|
||||
|
||||
if(g_model.swashR.type)
|
||||
{
|
||||
int16_t vp = anas[ELE_STICK]+trims[ELE_STICK];
|
||||
int16_t vr = anas[AIL_STICK]+trims[AIL_STICK];
|
||||
int16_t vc = 0;
|
||||
getvalue_t vp = anas[ELE_STICK]+trims[ELE_STICK];
|
||||
getvalue_t vr = anas[AIL_STICK]+trims[AIL_STICK];
|
||||
getvalue_t vc = 0;
|
||||
if (g_model.swashR.collectiveSource)
|
||||
vc = getValue(g_model.swashR.collectiveSource-1);
|
||||
|
||||
@@ -2700,7 +2747,7 @@ void perOut(uint8_t mode, uint8_t tick10ms)
|
||||
bool sw = getSwitch(md->swtch, 1);
|
||||
|
||||
//========== VALUE ===============
|
||||
int16_t v = 0;
|
||||
getvalue_t v = 0;
|
||||
if (mode != e_perout_mode_normal) {
|
||||
if (!sw || k >= NUM_STICKS || (k == THR_STICK && g_model.thrTrim)) {
|
||||
continue;
|
||||
@@ -2763,7 +2810,9 @@ void perOut(uint8_t mode, uint8_t tick10ms)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (md->mixWarn) lv_mixWarning |= 1 << (md->mixWarn - 1); // Mix warning
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -2932,7 +2981,8 @@ void perOut(uint8_t mode, uint8_t tick10ms)
|
||||
|
||||
if (tmp.dword<0) {
|
||||
if ((tmp.words_t.hi&0xFF80)!=0xFF80) tmp.words_t.hi=0xFF86; // set to min nearly
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if ((tmp.words_t.hi|0x007F)!=0x007F) tmp.words_t.hi=0x0079; // set to max nearly
|
||||
}
|
||||
*ptr=tmp.dword;
|
||||
@@ -2956,7 +3006,7 @@ void perOut(uint8_t mode, uint8_t tick10ms)
|
||||
} while (++pass < 5 && dirtyChannels);
|
||||
|
||||
mixWarning = lv_mixWarning;
|
||||
} //endfunc perOut
|
||||
}
|
||||
|
||||
#define TIME_TO_WRITE() (s_eeDirtyMsk && (tmr10ms_t)(get_tmr10ms() - s_eeDirtyTime10ms) >= (tmr10ms_t)WRITE_DELAY_10MS)
|
||||
|
||||
@@ -3038,7 +3088,7 @@ void doMixerCalculations()
|
||||
|
||||
// the reason this needs to be done before limits is the applyLimit function; it checks for safety switches which would be not initialized otherwise
|
||||
evalFunctions();
|
||||
} //endif
|
||||
}
|
||||
|
||||
int32_t weight = 0;
|
||||
if (s_fade_flight_phases) {
|
||||
@@ -3250,7 +3300,7 @@ void doMixerCalculations()
|
||||
#endif
|
||||
|
||||
s_cnt_1s++;
|
||||
s_sum_1s += val;
|
||||
s_sum_1s+=val;
|
||||
|
||||
// @@@ open.20.fsguruh: moved code here; at least val variable conflicts with caculations above, safer here?
|
||||
// even reduced code size about 8 bytes, why ever?
|
||||
@@ -3258,6 +3308,16 @@ void doMixerCalculations()
|
||||
s_time_tot += 100;
|
||||
s_timeCumTot += 1;
|
||||
|
||||
inacCounter++;
|
||||
if ((((uint8_t)inacCounter)&0x07)==0x01 && g_eeGeneral.inactivityTimer && g_vbat100mV>50 && inacCounter > ((uint16_t)g_eeGeneral.inactivityTimer*60))
|
||||
AUDIO_INACTIVITY();
|
||||
|
||||
#if defined(AUDIO)
|
||||
if (mixWarning & 1) if ((s_timeCumTot&0x03)==0) AUDIO_MIX_WARNING(1);
|
||||
if (mixWarning & 2) if ((s_timeCumTot&0x03)==1) AUDIO_MIX_WARNING(2);
|
||||
if (mixWarning & 4) if ((s_timeCumTot&0x03)==2) AUDIO_MIX_WARNING(3);
|
||||
#endif
|
||||
|
||||
#if defined(ACCURAT_THROTTLE_TIMER)
|
||||
val = s_sum_1s / s_cnt_1s;
|
||||
s_timeCum16ThrP += (val>>3); // s_timeCum16ThrP would overrun if we would store throttle value with higher accuracy; therefore stay with 16 steps
|
||||
@@ -3441,14 +3501,31 @@ void perMain()
|
||||
|
||||
checkBacklight();
|
||||
|
||||
#if defined(CPUARM) && defined(FRSKY)
|
||||
telemetryPoll10ms();
|
||||
#if defined(FRSKY)
|
||||
telemetryWakeup();
|
||||
#endif
|
||||
|
||||
lcd_clear();
|
||||
const char *warn = s_warning;
|
||||
g_menuStack[g_menuStackPtr](warn ? 0 : evt);
|
||||
if (warn) displayWarning(evt);
|
||||
uint8_t menu = s_menu_count;
|
||||
|
||||
if (EEPROM_MASSSTORAGE()) {
|
||||
menuMainView(0);
|
||||
}
|
||||
else {
|
||||
g_menuStack[g_menuStackPtr]((warn || menu) ? 0 : evt);
|
||||
if (warn) displayWarning(evt);
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
if (menu) {
|
||||
const char * result = displayMenu(evt);
|
||||
if (result) {
|
||||
menuHandler(result);
|
||||
putEvent(EVT_MENU_UP);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
drawStatusLine();
|
||||
lcdRefresh();
|
||||
|
||||
@@ -3556,7 +3633,7 @@ uint16_t getTmr16KHz()
|
||||
ISR(TIMER2_OVF_vect, ISR_NOBLOCK)
|
||||
{
|
||||
cli();
|
||||
TIMSK &= ~ (1<<TOIE2) ; // stop reentrance
|
||||
TIMSK &= ~(1<<TOIE2) ; // stop reentrance
|
||||
sei();
|
||||
|
||||
#if defined(AUDIO)
|
||||
@@ -3579,7 +3656,13 @@ ISR(TIMER_10MS_VECT, ISR_NOBLOCK)
|
||||
// without correction we are 0,16% too fast; that mean in one hour we are 5,76Sek too fast; we do not like that
|
||||
static uint8_t accuracyWarble; // because 16M / 1024 / 100 = 156.25. we need to correct the fault; no start value needed
|
||||
|
||||
#if defined(AUDIO)
|
||||
AUDIO_HEARTBEAT();
|
||||
#endif
|
||||
|
||||
#if defined(BEEPER)
|
||||
BUZZER_HEARTBEAT();
|
||||
#endif
|
||||
|
||||
#if defined(HAPTIC)
|
||||
HAPTIC_HEARTBEAT();
|
||||
@@ -3706,7 +3789,7 @@ ISR(USART0_UDRE_vect)
|
||||
else {
|
||||
FRSKY_USART0_vect();
|
||||
}
|
||||
#elif defined (FRSKY)
|
||||
#elif defined(FRSKY)
|
||||
FRSKY_USART0_vect();
|
||||
#else
|
||||
DSM2_USART0_vect();
|
||||
@@ -3777,7 +3860,7 @@ void saveTimers()
|
||||
{
|
||||
for (uint8_t i=0; i<MAX_TIMERS; i++) {
|
||||
if (g_model.timers[i].persistent) {
|
||||
if (g_model.timers[i].value != s_timerVal[i]) {
|
||||
if (g_model.timers[i].value != (uint16_t)s_timerVal[i]) {
|
||||
g_model.timers[i].value = s_timerVal[i];
|
||||
eeDirty(EE_MODEL);
|
||||
}
|
||||
|
||||
+83
-42
@@ -86,6 +86,12 @@
|
||||
#define IF_RTCLOCK(x)
|
||||
#endif
|
||||
|
||||
#if defined(BEEPER)
|
||||
#define IF_BEEPER(x) x,
|
||||
#else
|
||||
#define IF_BEEPER(x)
|
||||
#endif
|
||||
|
||||
#if defined(AUDIO)
|
||||
#define IF_AUDIO(x) x,
|
||||
#else
|
||||
@@ -177,32 +183,38 @@
|
||||
#endif
|
||||
|
||||
#if ROTARY_ENCODERS > 0
|
||||
#define ROTARY_ENCODER_NAVIGATION
|
||||
#define ROTARY_ENCODER_NAVIGATION
|
||||
#endif
|
||||
|
||||
#if defined(SIMU) || defined(CPUARM) || GCC_VERSION < 472
|
||||
typedef int32_t int24_t;
|
||||
#else
|
||||
typedef __int24 int24_t;
|
||||
#endif
|
||||
|
||||
#if defined(SIMU)
|
||||
#ifndef FORCEINLINE
|
||||
#define FORCEINLINE
|
||||
#endif
|
||||
#ifndef NOINLINE
|
||||
#define NOINLINE
|
||||
#endif
|
||||
#define CONVERT_PTR(x) ((uint32_t)(uint64_t)(x))
|
||||
#ifndef FORCEINLINE
|
||||
#define FORCEINLINE
|
||||
#endif
|
||||
#if !defined(NOINLINE)
|
||||
#define NOINLINE
|
||||
#endif
|
||||
#define CONVERT_PTR(x) ((uint32_t)(uint64_t)(x))
|
||||
#else
|
||||
#define FORCEINLINE inline __attribute__ ((always_inline))
|
||||
#define NOINLINE __attribute__ ((noinline))
|
||||
#define SIMU_SLEEP(x)
|
||||
#define CONVERT_PTR(x) ((uint32_t)(x))
|
||||
#define FORCEINLINE inline __attribute__ ((always_inline))
|
||||
#define NOINLINE __attribute__ ((noinline))
|
||||
#define SIMU_SLEEP(x)
|
||||
#define CONVERT_PTR(x) ((uint32_t)(x))
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#include "taranis/board_taranis.h"
|
||||
#include "taranis/board_taranis.h"
|
||||
#elif defined(PCBSKY9X)
|
||||
#include "sky9x/board_sky9x.h"
|
||||
#include "sky9x/board_sky9x.h"
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
#include "gruvin9x/board_gruvin9x.h"
|
||||
#include "gruvin9x/board_gruvin9x.h"
|
||||
#else
|
||||
#include "stock/board_stock.h"
|
||||
#include "stock/board_stock.h"
|
||||
#endif
|
||||
|
||||
#include "debug.h"
|
||||
@@ -563,33 +575,34 @@ enum CswFunctions {
|
||||
#define SPLASH_TIMEOUT (4*100) // 4 seconds
|
||||
#endif
|
||||
|
||||
#define EVT_KEY_MASK(e) ((e) & 0x0f)
|
||||
#define EVT_KEY_MASK(e) ((e) & 0x1f)
|
||||
|
||||
#define _MSK_KEY_BREAK 0x20
|
||||
#define _MSK_KEY_REPT 0x40
|
||||
#define _MSK_KEY_FIRST 0x60
|
||||
#define _MSK_KEY_LONG 0x80
|
||||
#define _MSK_KEY_BREAK 0x20
|
||||
#define _MSK_KEY_REPT 0x40
|
||||
#define _MSK_KEY_FIRST 0x60
|
||||
#define _MSK_KEY_LONG 0x80
|
||||
|
||||
#define EVT_KEY_BREAK(key) ((key)|_MSK_KEY_BREAK)
|
||||
#define EVT_KEY_FIRST(key) ((key)|_MSK_KEY_FIRST)
|
||||
#define EVT_KEY_REPT(key) ((key)|_MSK_KEY_REPT)
|
||||
#define EVT_KEY_LONG(key) ((key)|_MSK_KEY_LONG)
|
||||
#define EVT_KEY_BREAK(key) ((key)|_MSK_KEY_BREAK)
|
||||
#define EVT_KEY_FIRST(key) ((key)|_MSK_KEY_FIRST)
|
||||
#define EVT_KEY_REPT(key) ((key)|_MSK_KEY_REPT)
|
||||
#define EVT_KEY_LONG(key) ((key)|_MSK_KEY_LONG)
|
||||
|
||||
#define IS_KEY_BREAK(evt) (((evt)&0xf0) == _MSK_KEY_BREAK)
|
||||
#define IS_KEY_FIRST(evt) (((evt)&0xf0) == _MSK_KEY_FIRST)
|
||||
#define IS_KEY_LONG(evt) (((evt)&0xf0) == _MSK_KEY_LONG)
|
||||
#define IS_KEY_BREAK(evt) (((evt)&0xe0) == _MSK_KEY_BREAK)
|
||||
#define IS_KEY_FIRST(evt) (((evt)&0xe0) == _MSK_KEY_FIRST)
|
||||
#define IS_KEY_LONG(evt) (((evt)&0xe0) == _MSK_KEY_LONG)
|
||||
|
||||
#define EVT_ENTRY 0xbf
|
||||
#define EVT_ENTRY_UP 0xbe
|
||||
#define EVT_ENTRY 0xbf
|
||||
#define EVT_ENTRY_UP 0xbe
|
||||
#define EVT_MENU_UP 0xbd
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#define EVT_ROTARY_BREAK EVT_KEY_BREAK(KEY_ENTER)
|
||||
#define EVT_ROTARY_LONG EVT_KEY_LONG(KEY_ENTER)
|
||||
#define EVT_ROTARY_BREAK EVT_KEY_BREAK(KEY_ENTER)
|
||||
#define EVT_ROTARY_LONG EVT_KEY_LONG(KEY_ENTER)
|
||||
#else
|
||||
#define EVT_ROTARY_BREAK 0xcf
|
||||
#define EVT_ROTARY_LONG 0xce
|
||||
#define EVT_ROTARY_LEFT 0xdf
|
||||
#define EVT_ROTARY_RIGHT 0xde
|
||||
#define EVT_ROTARY_BREAK 0xcf
|
||||
#define EVT_ROTARY_LONG 0xce
|
||||
#define EVT_ROTARY_LEFT 0xdf
|
||||
#define EVT_ROTARY_RIGHT 0xde
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
@@ -730,6 +743,9 @@ bool getSwitch(int8_t swtch, bool nc);
|
||||
|
||||
extern swstate_t switches_states;
|
||||
int8_t getMovedSwitch();
|
||||
#if defined(AUTOSOURCE)
|
||||
int8_t getMovedSource();
|
||||
#endif
|
||||
|
||||
#ifdef FLIGHT_PHASES
|
||||
extern uint8_t getFlightPhase();
|
||||
@@ -756,7 +772,7 @@ extern void setTrimValue(uint8_t phase, uint8_t idx, int16_t trim);
|
||||
#endif
|
||||
|
||||
#if defined(GVARS)
|
||||
#if defined(CPUM64)
|
||||
#if defined(PCBSTD)
|
||||
int16_t getGVarValue(int16_t x, int16_t min, int16_t max);
|
||||
void setGVarValue(uint8_t x, int8_t value);
|
||||
#define GET_GVAR(x, min, max, p) getGVarValue(x, min, max)
|
||||
@@ -1148,9 +1164,10 @@ inline bool isFunctionActive(uint8_t func)
|
||||
#include "telemetry_mavlink.h"
|
||||
#endif
|
||||
|
||||
// REPEAT uses 0x01 to 0x0f
|
||||
#define PLAY_REPEAT(x) (x) /* Range 0 to 15 */
|
||||
#define PLAY_NOW 0x10
|
||||
#define PLAY_BACKGROUND 0x20
|
||||
#define PLAY_INCREMENT(x) ((uint8_t)(((uint8_t)x) << 6)) /* -1, 0, 1, 2 */
|
||||
|
||||
/* make sure the defines below always go in numeric order */
|
||||
enum AUDIO_SOUNDS {
|
||||
@@ -1215,7 +1232,9 @@ enum AUDIO_SOUNDS {
|
||||
#else
|
||||
#include "audio_avr.h"
|
||||
#endif
|
||||
#else
|
||||
#endif
|
||||
|
||||
#if defined(BEEPER)
|
||||
#include "beeper.h"
|
||||
#endif
|
||||
|
||||
@@ -1290,7 +1309,10 @@ extern union ReusableBuffer reusableBuffer;
|
||||
void checkFlashOnBeep();
|
||||
|
||||
#if defined(FRSKY) || defined(CPUARM)
|
||||
FORCEINLINE void convertUnit(getvalue_t & val, uint8_t & unit);
|
||||
void putsTelemetryValue(xcoord_t x, uint8_t y, lcdint_t val, uint8_t unit, uint8_t att);
|
||||
#else
|
||||
#define convertUnit(...)
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
@@ -1350,11 +1372,30 @@ void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val,
|
||||
#define EARTH_RADIUSKM ((uint32_t)6371)
|
||||
#define EARTH_RADIUS ((uint32_t)111194)
|
||||
|
||||
void checkMinMaxAltitude();
|
||||
void evalVario(int16_t altitude_bp, uint16_t altitude_ap);
|
||||
void getGpsPilotPosition();
|
||||
void getGpsDistance();
|
||||
void varioPoll10ms();
|
||||
void varioWakeup();
|
||||
|
||||
#if defined(AUDIO) && defined(BEEPER)
|
||||
#define IS_SOUND_OFF() (!g_eeGeneral.alarmsBeep && g_eeGeneral.beeperMode == e_mode_quiet)
|
||||
#else
|
||||
#define IS_SOUND_OFF() (g_eeGeneral.beeperMode == e_mode_quiet)
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define IS_IMPERIAL_ENABLE() (g_eeGeneral.imperial)
|
||||
#elif defined(IMPERIAL)
|
||||
#define IS_IMPERIAL_ENABLE() (1)
|
||||
#else
|
||||
#define IS_IMPERIAL_ENABLE() (0)
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#define IS_USR_PROTO_FRSKY_HUB() (1)
|
||||
#define IS_USR_PROTO_WS_HOW_HIGH() (0)
|
||||
#else
|
||||
#define IS_USR_PROTO_FRSKY_HUB() (g_model.frsky.usrProto == USR_PROTO_FRSKY)
|
||||
#define IS_USR_PROTO_WS_HOW_HIGH() (g_model.frsky.usrProto == USR_PROTO_WS_HOW_HIGH)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -47,5 +47,6 @@ inline void pausePulses() { s_pulses_paused = true; }
|
||||
inline void resumePulses() { s_pulses_paused = false; }
|
||||
|
||||
#define SEND_FAILSAFE_NOW() failsafeCounter = 1
|
||||
#define SEND_FAILSAFE_1S() failsafeCounter = 100
|
||||
|
||||
#endif
|
||||
|
||||
@@ -55,5 +55,8 @@ void setupPulses();
|
||||
void DSM2_Init();
|
||||
void DSM2_Done();
|
||||
|
||||
#define SEND_FAILSAFE_NOW()
|
||||
#define SEND_FAILSAFE_1S()
|
||||
|
||||
#endif
|
||||
/*eof*/
|
||||
|
||||
+4
-4
@@ -48,11 +48,11 @@
|
||||
#define BITMAPS_PATH "."
|
||||
#else
|
||||
#define ROOT_PATH "/"
|
||||
#define MODELS_PATH "/9XMODELS"
|
||||
#define LOGS_PATH "/9XLOGS" // no trailing slash = important
|
||||
#define SOUNDS_PATH "/9XSOUNDS" // no trailing slash = important
|
||||
#define MODELS_PATH "/MODELS"
|
||||
#define LOGS_PATH "/LOGS" // no trailing slash = important
|
||||
#define SOUNDS_PATH "/SOUNDS" // no trailing slash = important
|
||||
#define SYSTEM_SOUNDS_PATH SOUNDS_PATH "/SYSTEM" // no trailing slash = important
|
||||
#define BITMAPS_PATH "/9XBMP"
|
||||
#define BITMAPS_PATH "/BMP"
|
||||
#endif
|
||||
|
||||
#define MODELS_EXT ".bin"
|
||||
|
||||
+1
-2
@@ -97,7 +97,6 @@ typedef const uint16_t pm_uint16_t;
|
||||
typedef const uint8_t pm_uint8_t;
|
||||
typedef const int16_t pm_int16_t;
|
||||
typedef const int8_t pm_int8_t;
|
||||
typedef int32_t __int24;
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBACT)
|
||||
extern GPIO_TypeDef gpioa;
|
||||
@@ -357,7 +356,7 @@ void eeprom_read_block (void *pointer_ram, const void *pointer_eeprom, size_t si
|
||||
#define UART_Stop(...)
|
||||
#define UART3_Stop(...)
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBACT)
|
||||
#if defined(PCBTARANIS)
|
||||
inline void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct) { }
|
||||
#define GPIO_SetBits(GPIOx, pin) GPIOx->BSRRL |= pin
|
||||
#define GPIO_ResetBits(GPIOx, pin) GPIOx->BSRRL &= ~pin
|
||||
|
||||
+3
-3
@@ -241,8 +241,8 @@ long Open9xSim::onTimeout(FXObject*,FXSelector,void*)
|
||||
KEY_Page_Down, KEY_PAGE,
|
||||
KEY_Return, KEY_ENTER,
|
||||
KEY_BackSpace, KEY_EXIT,
|
||||
KEY_Right, KEY_PLUS,
|
||||
KEY_Left, KEY_MINUS,
|
||||
KEY_Up, KEY_PLUS,
|
||||
KEY_Down, KEY_MINUS,
|
||||
#else
|
||||
KEY_Return, KEY_MENU,
|
||||
KEY_BackSpace, KEY_EXIT,
|
||||
@@ -453,7 +453,7 @@ uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
#if defined(PCBTARANIS)
|
||||
if (chan == 8)
|
||||
return 2400;
|
||||
return 1000;
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
if (chan == 7)
|
||||
return 150;
|
||||
|
||||
@@ -221,7 +221,7 @@ unsigned char MEDSdcard_Initialize(Media *media, unsigned char mciID)
|
||||
// Initialize SDcard
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
if ( !CardIsConnected( ) )
|
||||
if ( !SD_CARD_PRESENT( ) )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
+1
-1
@@ -499,7 +499,7 @@
|
||||
///// MCI Card Detect pin.
|
||||
#define BOARD_SD_PIN_CD PIN_MCI_CD
|
||||
|
||||
#define CardIsConnected() ( (PIOB->PIO_PDSR & PIO_PB7) == 0 )
|
||||
#define SD_CARD_PRESENT() ( (PIOB->PIO_PDSR & PIO_PB7) == 0 )
|
||||
|
||||
// States for initialising card
|
||||
#define SD_ST_ERR -1
|
||||
|
||||
@@ -235,12 +235,13 @@ uint32_t pwrCheck();
|
||||
|
||||
// EEPROM driver
|
||||
void eepromInit();
|
||||
#define EEPROM_MASSSTORAGE() (0)
|
||||
|
||||
// Rotary Encoder driver
|
||||
void rotencInit();
|
||||
void rotencEnd();
|
||||
|
||||
#if defined(ROTARY_ENCODERS)
|
||||
#if ROTARY_ENCODERS > 0
|
||||
#define rotencDown() (!(PIOB->PIO_PDSR & 0x40))
|
||||
#else
|
||||
#define rotencDown() 0
|
||||
|
||||
@@ -285,7 +285,7 @@ const char * sdCommand(uint32_t cmd, uint32_t arg)
|
||||
uint32_t i;
|
||||
Hsmci *phsmci = HSMCI;
|
||||
|
||||
if (CardIsConnected()) {
|
||||
if (SD_CARD_PRESENT()) {
|
||||
phsmci->HSMCI_ARGR = arg;
|
||||
phsmci->HSMCI_CMDR = cmd;
|
||||
|
||||
@@ -378,7 +378,7 @@ uint32_t sdCmd16()
|
||||
{
|
||||
Hsmci *phsmci = HSMCI;
|
||||
|
||||
if (CardIsConnected()) {
|
||||
if (SD_CARD_PRESENT()) {
|
||||
phsmci->HSMCI_BLKR = ( ( 512 ) << 16 ) | 1 ;
|
||||
phsmci->HSMCI_ARGR = 512;
|
||||
phsmci->HSMCI_CMDR = SDMMC_SET_BLOCKLEN;
|
||||
@@ -963,7 +963,7 @@ void sdMountPoll()
|
||||
if (!Card_initialized)
|
||||
return;
|
||||
|
||||
if (!CardIsConnected()) {
|
||||
if (!SD_CARD_PRESENT()) {
|
||||
Card_state = SD_ST_EMPTY;
|
||||
Sd_rca = 0;
|
||||
sdErrorCount = 0;
|
||||
@@ -971,7 +971,7 @@ void sdMountPoll()
|
||||
|
||||
switch (Card_state) {
|
||||
case SD_ST_EMPTY:
|
||||
if (CardIsConnected()) {
|
||||
if (SD_CARD_PRESENT()) {
|
||||
Card_state = SD_ST_INIT1;
|
||||
}
|
||||
break;
|
||||
@@ -1030,7 +1030,7 @@ void sdInit()
|
||||
Sd_rca = 0;
|
||||
sdErrorCount = 0;
|
||||
|
||||
if (!CardIsConnected()) {
|
||||
if (!SD_CARD_PRESENT()) {
|
||||
Card_state = SD_ST_EMPTY;
|
||||
Card_initialized = 1;
|
||||
return;
|
||||
@@ -1093,12 +1093,12 @@ void sdInit()
|
||||
// returns 1 for YES, 0 for NO
|
||||
uint32_t sd_card_ready( void )
|
||||
{
|
||||
return CardIsConnected() && Card_state >= SD_ST_DATA;
|
||||
return SD_CARD_PRESENT() && Card_state >= SD_ST_DATA;
|
||||
}
|
||||
|
||||
uint32_t sdMounted( void )
|
||||
{
|
||||
return CardIsConnected() && Card_state == SD_ST_MOUNTED;
|
||||
return SD_CARD_PRESENT() && Card_state == SD_ST_MOUNTED;
|
||||
}
|
||||
|
||||
uint32_t sd_read_block(uint32_t block_no, uint32_t *data)
|
||||
|
||||
@@ -122,7 +122,7 @@ void readKeysAndTrims()
|
||||
{
|
||||
register uint32_t i;
|
||||
|
||||
#if defined(ROTARY_ENCODERS)
|
||||
#if ROTARY_ENCODERS > 0
|
||||
keys[BTN_REa].input(rotencDown(), BTN_REa);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -61,16 +61,12 @@ extern "C" void PIOC_IRQHandler()
|
||||
dummy = PIOC->PIO_PDSR ; // Read Rotary encoder (PC19, PC21)
|
||||
dummy >>= 19 ;
|
||||
dummy &= 0x05 ; // pick out the three bits
|
||||
if ( dummy != ( Rotary_position & 0x05 ) )
|
||||
{
|
||||
if ( dummy != ( Rotary_position & 0x05 ) ) {
|
||||
if ( ( Rotary_position & 0x01 ) ^ ( ( dummy & 0x04) >> 2 ) )
|
||||
{
|
||||
incRotaryEncoder(0, +1);
|
||||
}
|
||||
else
|
||||
{
|
||||
incRotaryEncoder(0, -1);
|
||||
}
|
||||
else
|
||||
incRotaryEncoder(0, +1);
|
||||
|
||||
Rotary_position &= ~0x45 ;
|
||||
Rotary_position |= dummy ;
|
||||
}
|
||||
|
||||
@@ -65,8 +65,7 @@ void rotencPoll()
|
||||
|
||||
asm(" rjmp 1f") ;
|
||||
asm("1:") ;
|
||||
// asm(" nop") ;
|
||||
// asm(" nop") ;
|
||||
|
||||
uint8_t rotary ;
|
||||
rotary = PINA ;
|
||||
DDRA = 0xFF ; // Back to all outputs
|
||||
@@ -106,14 +105,14 @@ inline void boardInit()
|
||||
DDRF = 0x00; PORTF = 0x00; //anain
|
||||
DDRG = 0x14; PORTG = 0xfb; //pullups + SIM_CTL=1 = phonejack = ppm_in, Haptic output and off (0)
|
||||
|
||||
ADMUX=ADC_VREF_TYPE;
|
||||
ADCSRA=0x85; // ADC enabled, pre-scaler division=32 (no interrupt, no auto-triggering)
|
||||
ADMUX = ADC_VREF_TYPE;
|
||||
ADCSRA = 0x85; // ADC enabled, pre-scaler division=32 (no interrupt, no auto-triggering)
|
||||
|
||||
// TCNT0 10ms = 16MHz/1024/156 periodic timer (9.984ms)
|
||||
// (with 1:4 duty at 157 to average 10.0ms)
|
||||
// Timer overflows at about 61Hz or once every 16ms.
|
||||
TCCR0 = (0b111 << CS00); // Norm mode, clk/1024
|
||||
OCR0 = 156;
|
||||
OCR0 = 156;
|
||||
|
||||
#if defined(AUDIO) || defined(VOICE)
|
||||
TCCR2 = (0b010 << CS00); // Norm mode, clk/8
|
||||
@@ -306,7 +305,7 @@ bool getBackLightState()
|
||||
return (bl_target==g_eeGeneral.blOnBright);
|
||||
}
|
||||
|
||||
void fadeBacklight() //called from per10ms()
|
||||
void backlightFade() //called from per10ms()
|
||||
{
|
||||
if (bl_target != bl_current) {
|
||||
if (bl_target > bl_current)
|
||||
|
||||
@@ -67,8 +67,8 @@
|
||||
#define PIN_TRIM_RV_DN (1<<INP_D_TRM_RV_DWN)
|
||||
#define PIN_TRIM_RH_R (1<<INP_D_TRM_RH_UP)
|
||||
|
||||
#define TIMER_16KHZ_VECT TIMER0_OVF_vect
|
||||
#define COUNTER_16KHZ TCNT0
|
||||
#define TIMER_16KHZ_VECT TIMER0_OVF_vect
|
||||
#define COUNTER_16KHZ TCNT0
|
||||
|
||||
#define TIMER_10MS_VECT TIMER0_COMP_vect
|
||||
#define TIMER_10MS_COMPVAL OCR0
|
||||
@@ -100,7 +100,7 @@ void backlightFadeOff();
|
||||
#define __BACKLIGHT_OFF backlightFadeOff()
|
||||
bool getBackLightState();
|
||||
#define IS_BACKLIGHT_ON() getBackLightState()
|
||||
void fadeBacklight();
|
||||
void backlightFade();
|
||||
#else
|
||||
|
||||
#if defined(SP22)
|
||||
@@ -215,4 +215,6 @@ extern uint8_t RotEncoder ;
|
||||
void rotencPoll();
|
||||
#endif
|
||||
|
||||
#define EEPROM_MASSSTORAGE() (0)
|
||||
|
||||
#endif
|
||||
|
||||
+5
-5
@@ -38,7 +38,7 @@
|
||||
|
||||
struct t_voice Voice ;
|
||||
|
||||
void pushPrompt16(uint16_t value)
|
||||
void pushPrompt(uint16_t value)
|
||||
{
|
||||
#ifdef SIMU
|
||||
printf("playFile(\"%04d.ad4\")\n", value); fflush(stdout);
|
||||
@@ -49,19 +49,19 @@ void pushPrompt16(uint16_t value)
|
||||
|
||||
if (vptr->VoiceQueueCount < VOICE_Q_LENGTH) {
|
||||
vptr->VoiceQueue[vptr->VoiceQueueInIndex++] = value;
|
||||
vptr->VoiceQueueInIndex &= (VOICE_Q_LENGTH - 1); // TODO flash saving?
|
||||
vptr->VoiceQueueInIndex &= (VOICE_Q_LENGTH - 1);
|
||||
vptr->VoiceQueueCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
void pushCustomPrompt(uint8_t value)
|
||||
{
|
||||
pushPrompt16(PROMPT_CUSTOM_BASE + value);
|
||||
pushPrompt(PROMPT_CUSTOM_BASE + value);
|
||||
}
|
||||
|
||||
void pushPrompt(uint8_t value)
|
||||
void pushNumberPrompt(uint8_t value)
|
||||
{
|
||||
pushPrompt16(value);
|
||||
pushPrompt(PROMPT_I18N_BASE + value);
|
||||
}
|
||||
|
||||
struct t_voice *voiceaddress()
|
||||
|
||||
+17
-21
@@ -56,8 +56,9 @@
|
||||
#define V_WAIT_BUSY_DELAY 5
|
||||
#define V_WAIT_START_BUSY_OFF 6
|
||||
|
||||
#define PROMPT_SYSTEM_BASE 230
|
||||
#define PROMPT_CUSTOM_BASE 256
|
||||
#define PROMPT_CUSTOM_BASE 0
|
||||
#define PROMPT_I18N_BASE 256
|
||||
#define PROMPT_SYSTEM_BASE 480
|
||||
|
||||
struct t_voice
|
||||
{
|
||||
@@ -75,15 +76,16 @@ struct t_voice
|
||||
void voice_process( void ) ;
|
||||
};
|
||||
|
||||
extern void pushCustomPrompt( uint8_t value );
|
||||
extern void pushPrompt( uint8_t value );
|
||||
extern void pushPrompt16(uint16_t value);
|
||||
extern void pushPrompt(uint16_t value);
|
||||
extern void pushCustomPrompt(uint8_t value);
|
||||
extern void pushNumberPrompt(uint8_t value);
|
||||
|
||||
extern struct t_voice *voiceaddress( void ) ;
|
||||
extern struct t_voice Voice ;
|
||||
|
||||
#define VOLUME_LEVEL_MAX 7
|
||||
#define VOLUME_LEVEL_DEF 7
|
||||
#define setVolume(v) pushPrompt16((v) | 0xFFF0)
|
||||
#define setVolume(v) pushPrompt((v) | 0xFFF0)
|
||||
|
||||
inline bool isPlaying()
|
||||
{
|
||||
@@ -99,24 +101,18 @@ inline bool isPlaying()
|
||||
* Check for LcdLocked (in interrupt), and voice_enabled
|
||||
*/
|
||||
#define VOICE_DRIVER() \
|
||||
if ( LcdLock == 0 ) /* LCD not in use */ \
|
||||
{ \
|
||||
if ( LcdLock == 0 ) { /* LCD not in use */ \
|
||||
struct t_voice *vptr; \
|
||||
vptr = voiceaddress(); \
|
||||
if ( vptr->VoiceState == V_CLOCKING ) \
|
||||
{ \
|
||||
if ( vptr->VoiceTimer ) \
|
||||
{ \
|
||||
if ( vptr->VoiceState == V_CLOCKING ) { \
|
||||
if ( vptr->VoiceTimer ) { \
|
||||
vptr->VoiceTimer -= 1; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
else { \
|
||||
PORTB |= (1<<OUT_B_LIGHT); /* Latch clock high */ \
|
||||
if ((vptr->VoiceCounter & 1) == 0) \
|
||||
{ \
|
||||
if ((vptr->VoiceCounter & 1) == 0) { \
|
||||
vptr->VoiceLatch &= ~VOICE_DATA_BIT; \
|
||||
if ( vptr->VoiceSerial & 0x4000 ) \
|
||||
{ \
|
||||
if ( vptr->VoiceSerial & 0x4000 ) { \
|
||||
vptr->VoiceLatch |= VOICE_DATA_BIT; \
|
||||
} \
|
||||
vptr->VoiceSerial <<= 1; \
|
||||
@@ -124,8 +120,7 @@ inline bool isPlaying()
|
||||
vptr->VoiceLatch ^= VOICE_CLOCK_BIT; \
|
||||
PORTA_LCD_DAT = vptr->VoiceLatch; /* Latch data set */ \
|
||||
PORTB &= ~(1<<OUT_B_LIGHT); /* Latch clock low */ \
|
||||
if ( --vptr->VoiceCounter == 0 ) \
|
||||
{ \
|
||||
if ( --vptr->VoiceCounter == 0 ) { \
|
||||
vptr->VoiceState = V_WAIT_BUSY_ON; \
|
||||
vptr->VoiceTimer = 5; /* 50 mS */ \
|
||||
} \
|
||||
@@ -134,8 +129,9 @@ inline bool isPlaying()
|
||||
}
|
||||
|
||||
#define PLAY_FUNCTION(x, ...) void x(__VA_ARGS__)
|
||||
#define PUSH_PROMPT(p) pushPrompt((p))
|
||||
#define PUSH_CUSTOM_PROMPT(p, ...) pushCustomPrompt((p))
|
||||
#define PUSH_NUMBER_PROMPT(p) pushNumberPrompt((p))
|
||||
#define PUSH_SYSTEM_PROMPT(p) pushNumberPrompt(PROMPT_SYSTEM_BASE-PROMPT_I18N_BASE+(p))
|
||||
#define PLAY_NUMBER(n, u, a) playNumber((n), (u), (a))
|
||||
#define PLAY_DURATION(d) playDuration((d))
|
||||
#define IS_PLAYING(id) (0) /* isPlaying() */
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
volatile uint16_t Analog_values[NUMBER_ANALOG];
|
||||
#if !defined(REV3)
|
||||
const char ana_direction[NUMBER_ANALOG] = {0,1,1,1, 1,0,1,0, 0};
|
||||
const char ana_direction[NUMBER_ANALOG] = {0,1,1,1, 1,1,1,0, 0};
|
||||
#endif
|
||||
|
||||
void adcInit()
|
||||
|
||||
@@ -181,13 +181,13 @@ void interrupt5ms()
|
||||
{
|
||||
static uint32_t pre_scale ; // Used to get 10 Hz counter
|
||||
|
||||
// HAPTIC_HEARTBEAT();
|
||||
AUDIO_HEARTBEAT();
|
||||
|
||||
if ( ++pre_scale >= 2 ) {
|
||||
pre_scale = 0 ;
|
||||
per10ms();
|
||||
}
|
||||
|
||||
#if defined(DEBUG)
|
||||
debugTx();
|
||||
#endif
|
||||
@@ -219,6 +219,16 @@ void boardInit()
|
||||
eepromInit();
|
||||
sportInit();
|
||||
usbInit();
|
||||
|
||||
//Temporary: Configure second PPM pin as input (done after USB init in case the lib already initialises USB_ID)
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIO_EXTPPM, ENABLE);
|
||||
GPIO_InitStructure.GPIO_Pin = PIN_EXTPPM_OUT;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_OD;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_Init(GPIO_EXTPPM, &GPIO_InitStructure);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -109,6 +109,7 @@ void sdInit();
|
||||
void sdPoll10ms();
|
||||
#define sdMountPoll()
|
||||
uint32_t sdMounted();
|
||||
#define SD_CARD_PRESENT() (~SD_PRESENT_GPIO->IDR & SD_PRESENT_GPIO_Pin)
|
||||
#endif
|
||||
|
||||
// Pulses driver
|
||||
@@ -163,7 +164,11 @@ void pwrOff();
|
||||
#define setBacklight(xx)
|
||||
#define __BACKLIGHT_ON GPIO_SetBits(GPIOB, GPIO_Pin_BL)
|
||||
#define __BACKLIGHT_OFF GPIO_ResetBits(GPIOB, GPIO_Pin_BL)
|
||||
#define IS_BACKLIGHT_ON() GPIO_IsSet(GPIOB, GPIO_Pin_BL)
|
||||
#define IS_BACKLIGHT_ON() GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_BL)
|
||||
|
||||
// USB driver
|
||||
void usbInit(void);
|
||||
extern uint8_t usb_connected;
|
||||
|
||||
// EEPROM driver
|
||||
#if !defined(SIMU)
|
||||
@@ -174,8 +179,6 @@ void pwrOff();
|
||||
#define eepromInit()
|
||||
void eeWriteBlockCmp(const void *pointer_ram, uint16_t pointer_eeprom, size_t size);
|
||||
#endif
|
||||
|
||||
// USB driver
|
||||
void usbInit(void);
|
||||
#define EEPROM_MASSSTORAGE() (usb_connected)
|
||||
|
||||
#endif
|
||||
|
||||
+11
-3
@@ -156,12 +156,21 @@ static inline DWORD socket_is_write_protected(void)
|
||||
|
||||
static void socket_cp_init(void)
|
||||
{
|
||||
return;
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
|
||||
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_SD_PRESENT, ENABLE);
|
||||
|
||||
GPIO_InitStructure.GPIO_Pin = SD_PRESENT_GPIO_Pin;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_OD;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_Init(SD_PRESENT_GPIO, &GPIO_InitStructure);
|
||||
}
|
||||
|
||||
static inline DWORD socket_is_empty(void)
|
||||
{
|
||||
return 0; /* fake inserted */
|
||||
return !SD_CARD_PRESENT(); /* fake inserted */
|
||||
}
|
||||
|
||||
static void card_power(BYTE on)
|
||||
@@ -364,7 +373,6 @@ void power_on (void)
|
||||
/* Enable SPI clock, SPI1: APB2, SPI2: APB1 */
|
||||
RCC_APBPeriphClockCmd_SPI_SD(RCC_APBPeriph_SPI_SD, ENABLE);
|
||||
|
||||
|
||||
card_power(1);
|
||||
|
||||
socket_cp_init();//Empty return
|
||||
|
||||
+20
-12
@@ -156,14 +156,15 @@
|
||||
#define RCC_AHB1Periph_GPIOPWR RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD
|
||||
#define GPIOPWRLED GPIOC
|
||||
#define GPIOPWR GPIOD
|
||||
#define GPIOTRNDET GPIOA
|
||||
#define PIN_TRNDET GPIO_Pin_8
|
||||
#define PIN_INT_RF_PWR GPIO_Pin_15
|
||||
#define PIN_EXT_RF_PWR GPIO_Pin_8
|
||||
|
||||
// Trainer Port
|
||||
#define GPIO_TR_INOUT GPIOC
|
||||
#define PIN_TR_PPM_IN GPIO_Pin_8 //PC.08
|
||||
#define PIN_TR_PPM_OUT GPIO_Pin_9 //PC.09
|
||||
#define GPIOTRNDET GPIOA
|
||||
#define PIN_TRNDET GPIO_Pin_8
|
||||
|
||||
// TODO merge these constants
|
||||
#define PIN_PER_1 0x0010
|
||||
@@ -181,6 +182,10 @@
|
||||
#define PIN_CPPM_OUT GPIO_Pin_7 //PA.07
|
||||
#define GPIOCPPM GPIOA
|
||||
#define GPIO_PinSource_CPPM GPIO_PinSource7
|
||||
#define RCC_AHB1Periph_GPIO_EXTPPM RCC_AHB1Periph_GPIOA
|
||||
#define PIN_EXTPPM_OUT GPIO_Pin_10 //PA.10
|
||||
#define GPIO_EXTPPM GPIOA
|
||||
#define GPIO_PinSource_EXTPPM GPIO_PinSource10
|
||||
|
||||
// Heart Beat
|
||||
#define PIN_HEART_BEAT GPIO_Pin_7 //PC.07
|
||||
@@ -274,6 +279,9 @@
|
||||
#endif
|
||||
|
||||
// SD - SPI2
|
||||
#define RCC_AHB1Periph_SD_PRESENT RCC_AHB1Periph_GPIOD
|
||||
#define SD_PRESENT_GPIO GPIOD
|
||||
#define SD_PRESENT_GPIO_Pin GPIO_Pin_9 //PD.09
|
||||
#define GPIO_Pin_SPI_SD_CS GPIO_Pin_12 //PB.12
|
||||
#define GPIO_Pin_SPI_SD_SCK GPIO_Pin_13 //PB.13
|
||||
#define GPIO_Pin_SPI_SD_MISO GPIO_Pin_14 //PB.14
|
||||
@@ -293,9 +301,9 @@
|
||||
#define SPI_BaudRatePrescaler_SPI_SD SPI_BaudRatePrescaler_4 //10.5<20MHZ,make sure < 20MHZ
|
||||
|
||||
//disabled io_ctl and cp/wp
|
||||
#define CARD_SUPPLY_SWITCHABLE 0
|
||||
#define SOCKET_WP_CONNECTED 0
|
||||
#define SOCKET_CP_CONNECTED 0
|
||||
#define CARD_SUPPLY_SWITCHABLE 0
|
||||
#define SOCKET_WP_CONNECTED 0
|
||||
#define SOCKET_CP_CONNECTED 0
|
||||
/* set to 1 to provide a disk_ioctrl function even if not needed by the FatFs */
|
||||
#define STM32_SD_DISK_IOCTRL_FORCE 0
|
||||
|
||||
@@ -303,13 +311,13 @@
|
||||
#define STM32_SD_USE_DMA //Enable the DMA for SD
|
||||
|
||||
#ifdef STM32_SD_USE_DMA
|
||||
#define DMA_Channel_SPI_SD_RX DMA1_Stream3
|
||||
#define DMA_Channel_SPI_SD_TX DMA1_Stream4
|
||||
#define DMA_Channel_SPI_SD_RX DMA1_Stream3
|
||||
#define DMA_Channel_SPI_SD_TX DMA1_Stream4
|
||||
|
||||
#define DMA_FLAG_SPI_SD_TC_RX DMA_FLAG_TCIF3
|
||||
#define DMA_FLAG_SPI_SD_TC_TX DMA_FLAG_TCIF4
|
||||
#define DMA_Channel_SPI2_TX DMA_Channel_0
|
||||
#define DMA_Channel_SPI2_RX DMA_Channel_0
|
||||
#define DMA_FLAG_SPI_SD_TC_RX DMA_FLAG_TCIF3
|
||||
#define DMA_FLAG_SPI_SD_TC_TX DMA_FLAG_TCIF4
|
||||
#define DMA_Channel_SPI2_TX DMA_Channel_0
|
||||
#define DMA_Channel_SPI2_RX DMA_Channel_0
|
||||
#endif
|
||||
|
||||
// Audio----I2S3-----SPI3
|
||||
@@ -324,4 +332,4 @@
|
||||
#define I2C_EEPROM_ADDRESS 0xA2
|
||||
#define I2C_CAT5137_ADDRESS 0x5C //0101110
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -211,7 +211,7 @@ bool switchState(EnumKeys enuk)
|
||||
xxx = GPIO_PIN_SW_H & PIN_SW_H;
|
||||
break;
|
||||
case SW_SH2:
|
||||
xxx = GPIO_PIN_SW_H & PIN_SW_H;
|
||||
xxx = ~GPIO_PIN_SW_H & PIN_SW_H;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -122,6 +122,7 @@ void disable_pxx()
|
||||
// Pin is AF1 function for timer 1
|
||||
void init_main_ppm()
|
||||
{
|
||||
EXTERNAL_RF_ON();
|
||||
// Timer1
|
||||
setupPulsesPPM() ;
|
||||
ppmStreamPtr = ppmStream ;
|
||||
@@ -163,6 +164,7 @@ void disable_main_ppm()
|
||||
NVIC_DisableIRQ(TIM1_UP_TIM10_IRQn) ;
|
||||
TIM1->DIER &= ~TIM_DIER_CC2IE & ~TIM_DIER_UIE ;
|
||||
TIM1->CR1 &= ~TIM_CR1_CEN ;
|
||||
EXTERNAL_RF_OFF();
|
||||
}
|
||||
|
||||
extern "C" void TIM1_CC_IRQHandler()
|
||||
|
||||
@@ -28,16 +28,16 @@
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "../opentx.h"
|
||||
#include "../FatFs/diskio.h"
|
||||
#include "board_taranis.h"
|
||||
|
||||
extern "C" {
|
||||
#include "STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/misc.h"
|
||||
#include "usbd_msc_mem.h"
|
||||
#include "usb_conf.h"
|
||||
|
||||
#define STORAGE_LUN_NBR 1
|
||||
void eeprom_read_block (void *pointer_ram, uint16_t pointer_eeprom, size_t size);
|
||||
|
||||
// TODO ... perhaps something more adequate ;)
|
||||
#define SD_GetStatus() (0)
|
||||
#define STORAGE_LUN_NBR 2
|
||||
|
||||
/* USB Mass storage Standard Inquiry Data */
|
||||
const unsigned char STORAGE_Inquirydata[] = {//36
|
||||
@@ -55,8 +55,23 @@ const unsigned char STORAGE_Inquirydata[] = {//36
|
||||
'T', 'a', 'r', 'a', 'n', 'i', 's', ' ', /* Product : 16 Bytes */
|
||||
'R', 'a', 'd', 'i', 'o', ' ', ' ', ' ',
|
||||
'1', '.', '0', '0', /* Version : 4 Bytes */
|
||||
/* LUN 1 */
|
||||
0x00,
|
||||
0x80,
|
||||
0x02,
|
||||
0x02,
|
||||
(USBD_STD_INQUIRY_LENGTH - 5),
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
'F', 'r', 'S', 'k', 'y', ' ', ' ', ' ', /* Manufacturer : 8 bytes */
|
||||
'T', 'a', 'r', 'a', 'n', 'i', 's', ' ', /* Product : 16 Bytes */
|
||||
'R', 'a', 'd', 'i', 'o', 'E', 'P', 'M',
|
||||
'1', '.', '0' ,'0', /* Version : 4 Bytes */
|
||||
};
|
||||
|
||||
int32_t fat12Write( const uint8_t *buffer, uint16_t sector, uint32_t count ) ;
|
||||
int32_t fat12Read( uint8_t *buffer, uint16_t sector, uint16_t count ) ;
|
||||
|
||||
int8_t STORAGE_Init (uint8_t lun);
|
||||
|
||||
@@ -123,16 +138,23 @@ int8_t STORAGE_Init (uint8_t lun)
|
||||
*/
|
||||
int8_t STORAGE_GetCapacity (uint8_t lun, uint32_t *block_num, uint32_t *block_size)
|
||||
{
|
||||
if (SD_GetStatus() != 0 )
|
||||
return -1;
|
||||
if (lun == 1) {
|
||||
*block_size = 512;
|
||||
*block_num = 1024*64 + 3 ;
|
||||
}
|
||||
else {
|
||||
if (!SD_CARD_PRESENT())
|
||||
return -1;
|
||||
|
||||
*block_size = 512;
|
||||
*block_size = 512;
|
||||
|
||||
DWORD sector_count = 0;
|
||||
if (disk_ioctl(0, GET_SECTOR_COUNT, §or_count) != RES_OK)
|
||||
return -1;
|
||||
DWORD sector_count = 0;
|
||||
if (disk_ioctl(0, GET_SECTOR_COUNT, §or_count) != RES_OK)
|
||||
return -1;
|
||||
|
||||
*block_num = sector_count;
|
||||
}
|
||||
|
||||
*block_num = sector_count;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -143,20 +165,12 @@ int8_t STORAGE_GetCapacity (uint8_t lun, uint32_t *block_num, uint32_t *block_si
|
||||
*/
|
||||
int8_t STORAGE_IsReady (uint8_t lun)
|
||||
{
|
||||
static int8_t last_status = 0;
|
||||
|
||||
if(last_status < 0)
|
||||
{
|
||||
// TODO ? SD_Init();
|
||||
last_status = 0;
|
||||
if (lun == 1) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return SD_CARD_PRESENT() ? 0 : -1;
|
||||
}
|
||||
|
||||
if(SD_GetStatus() != 0)
|
||||
{
|
||||
last_status = -1;
|
||||
return (-1);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -178,7 +192,6 @@ int8_t STORAGE_IsWriteProtected (uint8_t lun)
|
||||
* @retval Status
|
||||
*/
|
||||
|
||||
// TODO quick & dirty
|
||||
int8_t SD_ReadSectors(uint8_t *buff, uint32_t sector, uint32_t count);
|
||||
|
||||
int8_t STORAGE_Read (uint8_t lun,
|
||||
@@ -186,17 +199,19 @@ int8_t STORAGE_Read (uint8_t lun,
|
||||
uint32_t blk_addr,
|
||||
uint16_t blk_len)
|
||||
{
|
||||
|
||||
if( SD_ReadSectors (buf,
|
||||
blk_addr,
|
||||
blk_len) != 0)
|
||||
{
|
||||
return -1;
|
||||
if (lun == 1) {
|
||||
if (fat12Read(buf, blk_addr, blk_len) != 0) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
SD_WaitReadOperation();
|
||||
while (SD_GetStatus() != SD_TRANSFER_OK);
|
||||
#endif
|
||||
else {
|
||||
if (SD_ReadSectors(buf,
|
||||
blk_addr,
|
||||
blk_len) != 0) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
@@ -215,17 +230,17 @@ int8_t STORAGE_Write (uint8_t lun,
|
||||
uint32_t blk_addr,
|
||||
uint16_t blk_len)
|
||||
{
|
||||
|
||||
if( SD_WriteSectors (buf,
|
||||
blk_addr,
|
||||
blk_len) != 0)
|
||||
{
|
||||
return -1;
|
||||
if (lun == 1) {
|
||||
if (fat12Write( buf, blk_addr, blk_len ) != 0)
|
||||
return -1;
|
||||
}
|
||||
#if 0
|
||||
SD_WaitWriteOperation();
|
||||
while (SD_GetStatus() != SD_TRANSFER_OK);
|
||||
#endif
|
||||
else {
|
||||
if (SD_WriteSectors(buf,
|
||||
blk_addr,
|
||||
blk_len) != 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -240,6 +255,429 @@ int8_t STORAGE_GetMaxLun (void)
|
||||
return (STORAGE_LUN_NBR - 1);
|
||||
}
|
||||
|
||||
// Test FAT12 etc.
|
||||
|
||||
#define BLOCKSIZE 512
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/**
|
||||
* FAT12 boot sector partition.
|
||||
*/
|
||||
const char g_FATboot[BLOCKSIZE] =
|
||||
{
|
||||
0xeb, 0x3c, 0x90, // Jump instruction.
|
||||
0x39, 0x58, 0x20, 0x54, 0x45, 0x41, 0x4D, 0x00, // OEM Name
|
||||
0x00, 0x02, // Bytes per sector
|
||||
0x01, // Sectors per FS cluster.
|
||||
0x01, 0x00, // Reserved sector count
|
||||
|
||||
0x01, // Number of FATs
|
||||
0x10, 0x00, // Number of root directory entries
|
||||
0x83, 0x00, // Total sectors = 131
|
||||
0xf8, // Media descriptor
|
||||
0x01, 0x00, // Sectors per FAT table
|
||||
0x20, 0x00, // Sectors per track
|
||||
0x40, 0x00, // Number of heads
|
||||
0x00, 0x00, 0x00, 0x00, // Number of hidden sectors
|
||||
|
||||
0x00, 0x00, 0x00, 0x00, // Large number of sectors.
|
||||
0x00, // Physical drive number
|
||||
0x00, // Reserved
|
||||
0x29, // Extended boot signature
|
||||
0xCE, 0xFA, 0x5C, 0xD1, // Disk ID (serial number)
|
||||
0x56, 0x49, 0x52, 0x54, 0x46, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, // Volume label
|
||||
0x46, 0x41, 0x54, 0x31, 0x32, 0x20, 0x20, 0x20, // FAT file system type
|
||||
0x00, 0x00, // OS boot code
|
||||
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa
|
||||
};
|
||||
|
||||
const char g_FAT[BLOCKSIZE] =
|
||||
{
|
||||
0xF8, 0xFF, 0xFF, 0x03, 0x40, 0x00, 0x05, 0x60, 0x00, 0x07, 0x80, 0x00, 0x09, 0xA0, 0x00, 0x0B,
|
||||
0xC0, 0x00, 0x0D, 0xE0, 0x00, 0x0F, 0x00, 0x01, 0x11, 0x20, 0x01, 0x13, 0x40, 0x01, 0x15, 0x60,
|
||||
0x01, 0x17, 0x80, 0x01, 0x19, 0xA0, 0x01, 0x1B, 0xC0, 0x01, 0x1D, 0xE0, 0x01, 0x1F, 0x00, 0x02,
|
||||
0x21, 0x20, 0x02, 0x23, 0x40, 0x02, 0x25, 0x60, 0x02, 0x27, 0x80, 0x02, 0x29, 0xA0, 0x02, 0x2B,
|
||||
0xC0, 0x02, 0x2D, 0xE0, 0x02, 0x2F, 0x00, 0x03, 0x31, 0x20, 0x03, 0x33, 0x40, 0x03, 0x35, 0x60,
|
||||
0x03, 0x37, 0x80, 0x03, 0x39, 0xA0, 0x03, 0x3B, 0xC0, 0x03, 0x3D, 0xE0, 0x03, 0x3F, 0x00, 0x04,
|
||||
0x41, 0x20, 0x04, 0x43, 0x40, 0x04, 0x45, 0x60, 0x04, 0x47, 0x80, 0x04, 0x49, 0xA0, 0x04, 0x4B,
|
||||
0xC0, 0x04, 0x4D, 0xE0, 0x04, 0x4F, 0x00, 0x05, 0x51, 0x20, 0x05, 0x53, 0x40, 0x05, 0x55, 0x60,
|
||||
0x05, 0x57, 0x80, 0x05, 0x59, 0xA0, 0x05, 0x5B, 0xC0, 0x05, 0x5D, 0xE0, 0x05, 0x5F, 0x00, 0x06,
|
||||
0x61, 0x20, 0x06, 0x63, 0x40, 0x06, 0x65, 0x60, 0x06, 0x67, 0x80, 0x06, 0x69, 0xA0, 0x06, 0x6B,
|
||||
0xC0, 0x06, 0x6D, 0xE0, 0x06, 0x6F, 0x00, 0x07, 0x71, 0x20, 0x07, 0x73, 0x40, 0x07, 0x75, 0x60,
|
||||
0x07, 0x77, 0x80, 0x07, 0x79, 0xA0, 0x07, 0x7B, 0xC0, 0x07, 0x7D, 0xE0, 0x07, 0x7F, 0x00, 0x08,
|
||||
0x81, 0xF0, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
|
||||
// File Attributes
|
||||
// 0 0x01 Read Only.
|
||||
// 1 0x02 Hidden.
|
||||
// 2 0x04 System.
|
||||
// 3 0x08 Volume Label.
|
||||
// 4 0x10 Subdirectory.
|
||||
// 5 0x20 Archive.
|
||||
// 6 0x40 Device.
|
||||
// 7 0x80 Reserved.
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t name[8];
|
||||
uint8_t ext[3];
|
||||
uint8_t attribute;
|
||||
uint8_t reserved;
|
||||
uint8_t create_time_ms;
|
||||
uint16_t create_time;
|
||||
uint16_t create_date;
|
||||
uint16_t access_date;
|
||||
uint16_t ea_index;
|
||||
uint16_t modify_time;
|
||||
uint16_t modify_date;
|
||||
uint16_t start_cluster;
|
||||
uint32_t file_size;
|
||||
} FATDirEntry_t;
|
||||
|
||||
// First 16 FAT root directory entries (1 sector)
|
||||
const FATDirEntry_t g_DIRroot[16] =
|
||||
{
|
||||
{
|
||||
{ 'T', 'A', 'R', 'A', 'N', 'I', 'S', ' '},
|
||||
{ ' ', ' ', ' '},
|
||||
0x08, // Volume
|
||||
0x00,
|
||||
0x00,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x00000000
|
||||
},
|
||||
{
|
||||
{ 'T', 'A', 'R', 'A', 'N', 'I', 'S', ' '},
|
||||
{ 'B', 'I', 'N'},
|
||||
0x24, // Archive, hidden, system
|
||||
0x00,
|
||||
0x3E,
|
||||
0xA301,
|
||||
0x3D55,
|
||||
0x3D55,
|
||||
0x0000,
|
||||
0xA302,
|
||||
0x3D55,
|
||||
0x0002,
|
||||
0x00010000
|
||||
},
|
||||
{
|
||||
{ '\x00', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
|
||||
{ ' ', ' ', ' '},
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x00000000
|
||||
},
|
||||
{
|
||||
{ '\x00', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
|
||||
{ ' ', ' ', ' '},
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x00000000
|
||||
},
|
||||
{
|
||||
{ '\x00', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
|
||||
{ ' ', ' ', ' '},
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x00000000
|
||||
},
|
||||
{
|
||||
{ '\x00', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
|
||||
{ ' ', ' ', ' '},
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x00000000
|
||||
},
|
||||
{
|
||||
{ '\x00', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
|
||||
{ ' ', ' ', ' '},
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x00000000
|
||||
},
|
||||
{
|
||||
{ '\x00', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
|
||||
{ ' ', ' ', ' '},
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x00000000
|
||||
},
|
||||
{
|
||||
{ '\x00', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
|
||||
{ ' ', ' ', ' '},
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x00000000
|
||||
},
|
||||
{
|
||||
{ '\x00', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
|
||||
{ ' ', ' ', ' '},
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x00000000
|
||||
},
|
||||
{
|
||||
{ '\x00', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
|
||||
{ ' ', ' ', ' '},
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x00000000
|
||||
},
|
||||
{
|
||||
{ '\x00', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
|
||||
{ ' ', ' ', ' '},
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x00000000
|
||||
},
|
||||
{
|
||||
{ '\x00', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
|
||||
{ ' ', ' ', ' '},
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x00000000
|
||||
},
|
||||
{
|
||||
{ '\x00', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
|
||||
{ ' ', ' ', ' '},
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x00000000
|
||||
},
|
||||
{
|
||||
{ '\x00', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
|
||||
{ ' ', ' ', ' '},
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x00000000
|
||||
},
|
||||
{
|
||||
{ '\x00', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
|
||||
{ ' ', ' ', ' '},
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x0000,
|
||||
0x00000000
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
// count is number of 512 byte sectors
|
||||
int32_t fat12Read( uint8_t *buffer, uint16_t sector, uint16_t count )
|
||||
{
|
||||
while ( count )
|
||||
{
|
||||
if (sector == 0)
|
||||
{
|
||||
memcpy( buffer, g_FATboot, BLOCKSIZE ) ;
|
||||
}
|
||||
else if ( sector == 1/*Reserved sector count*/)
|
||||
{
|
||||
// FAT table.
|
||||
memcpy( buffer, g_FAT, BLOCKSIZE);
|
||||
}
|
||||
else if ( sector == 2)
|
||||
{
|
||||
memcpy( buffer, g_DIRroot, BLOCKSIZE ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
eeprom_read_block (buffer, (sector-3)*512, 512);
|
||||
}
|
||||
buffer += 512 ;
|
||||
sector++ ;
|
||||
count-- ;
|
||||
}
|
||||
return 0 ;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
int32_t fat12Write(const uint8_t *buffer, uint16_t sector, uint32_t count )
|
||||
{
|
||||
// TO DO, actually write to the EEPROM
|
||||
if ( sector >3 )
|
||||
{
|
||||
sector -= 4 ; // Indexes EEPROM in 512 byte blocks
|
||||
// Look for a 4K block boundary, writing 4K+
|
||||
while (count) {
|
||||
eeWriteBlockCmp((uint8_t *)buffer, sector*512, 512);
|
||||
buffer+=512;
|
||||
sector++;
|
||||
count--;
|
||||
}
|
||||
}
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
|
||||
|
||||
@@ -28,8 +28,6 @@
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "../opentx.h"
|
||||
|
||||
extern uint8_t usb_connected;
|
||||
|
||||
extern "C" {
|
||||
#include "usbd_usr.h"
|
||||
|
||||
@@ -115,6 +113,7 @@ void USBD_USR_DeviceConnected (void)
|
||||
f_mount(0, 0); // unmount SD
|
||||
}
|
||||
|
||||
eeCheck(true);
|
||||
usb_connected = 1;
|
||||
}
|
||||
|
||||
@@ -129,6 +128,9 @@ void USBD_USR_DeviceDisconnected (void)
|
||||
{
|
||||
usb_connected = 0;
|
||||
|
||||
eeReadAll();
|
||||
eeLoadModel(g_eeGeneral.currModel);
|
||||
|
||||
sdInit();
|
||||
}
|
||||
|
||||
|
||||
+65
-36
@@ -69,6 +69,33 @@ uint8_t frskyUsrStreaming = 0;
|
||||
uint8_t link_counter = 0;
|
||||
FrskyData frskyData;
|
||||
|
||||
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
|
||||
void checkMinMaxAltitude()
|
||||
{
|
||||
if (TELEMETRY_ALT_BP > frskyData.hub.maxAltitude)
|
||||
frskyData.hub.maxAltitude = TELEMETRY_ALT_BP;
|
||||
if (TELEMETRY_ALT_BP < frskyData.hub.minAltitude)
|
||||
frskyData.hub.minAltitude = TELEMETRY_ALT_BP;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(VARIO) && !defined(FRSKY_SPORT) && (defined(FRSKY_HUB) || defined(WS_HOW_HIGH))
|
||||
void evalVario(int16_t altitude_bp, uint16_t altitude_ap)
|
||||
{
|
||||
int32_t varioAltitude_cm = (int32_t)altitude_bp * 100 + (altitude_bp > 0 ? altitude_ap : -altitude_ap);
|
||||
uint8_t varioAltitudeQueuePointer = frskyData.hub.varioAltitudeQueuePointer + 1;
|
||||
if (varioAltitudeQueuePointer >= VARIO_QUEUE_LENGTH)
|
||||
varioAltitudeQueuePointer = 0;
|
||||
frskyData.hub.varioAltitudeQueuePointer = varioAltitudeQueuePointer;
|
||||
frskyData.hub.varioSpeed -= frskyData.hub.varioAltitudeQueue[varioAltitudeQueuePointer] ;
|
||||
frskyData.hub.varioAltitudeQueue[varioAltitudeQueuePointer] = varioAltitude_cm - frskyData.hub.varioAltitude_cm;
|
||||
frskyData.hub.varioAltitude_cm = varioAltitude_cm;
|
||||
frskyData.hub.varioSpeed += frskyData.hub.varioAltitudeQueue[varioAltitudeQueuePointer] ;
|
||||
}
|
||||
#else
|
||||
#define evalVario(...)
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY_HUB)
|
||||
typedef enum {
|
||||
TS_IDLE = 0, // waiting for 0x5e frame marker
|
||||
@@ -292,11 +319,11 @@ void processFrskyPacket(uint8_t *packet)
|
||||
uint8_t numBytes = 3 + (packet[1] & 0x07); // sanitize in case of data corruption leading to buffer overflow
|
||||
for (uint8_t i=3; i<numBytes; i++) {
|
||||
#if defined(FRSKY_HUB)
|
||||
if (g_model.frsky.usrProto == USR_PROTO_FRSKY)
|
||||
if (IS_USR_PROTO_FRSKY_HUB())
|
||||
parseTelemHubByte(packet[i]);
|
||||
#endif
|
||||
#if defined(WS_HOW_HIGH)
|
||||
if (g_model.frsky.usrProto == USR_PROTO_WS_HOW_HIGH)
|
||||
if (IS_USR_PROTO_WS_HOW_HIGH())
|
||||
parseTelemWSHowHighByte(packet[i]);
|
||||
#endif
|
||||
}
|
||||
@@ -447,8 +474,7 @@ ISR(USART0_RX_vect)
|
||||
uint8_t data;
|
||||
|
||||
UCSR0B &= ~(1 << RXCIE0); // disable Interrupt
|
||||
sei() ;
|
||||
|
||||
sei();
|
||||
|
||||
stat = UCSR0A; // USART control and Status Register 0 A
|
||||
|
||||
@@ -543,13 +569,13 @@ inline void frskySendNextAlarm(void)
|
||||
*ptr++ = (A22PKT + frskyAlarmsSendState); // fc - fb - fa - f9
|
||||
frskyPushValue(ptr, g_model.frsky.channels[channel].alarms_value[alarm]);
|
||||
*ptr++ = ALARM_GREATER(channel, alarm);
|
||||
*ptr++ = (g_eeGeneral.beeperMode != e_mode_quiet ? ALARM_LEVEL(channel, alarm) : alarm_off);
|
||||
*ptr++ = (IS_SOUND_OFF() ? alarm_off : ALARM_LEVEL(channel, alarm));
|
||||
}
|
||||
else {
|
||||
*ptr++ = (RSSI1PKT-alarm); // f7 - f6
|
||||
frskyPushValue(ptr, getRssiAlarmValue(alarm));
|
||||
*ptr++ = 0x00;
|
||||
*ptr++ = (g_eeGeneral.beeperMode != e_mode_quiet ? ((2+alarm+g_model.frsky.rssiAlarms[alarm].level) % 4) : alarm_off);
|
||||
*ptr++ = (IS_SOUND_OFF() ? alarm_off : ((2+alarm+g_model.frsky.rssiAlarms[alarm].level) % 4));
|
||||
}
|
||||
|
||||
*ptr++ = 0x00;
|
||||
@@ -593,7 +619,7 @@ void frskySendPacket(uint8_t type, uint8_t value, uint8_t p1, uint8_t p2)
|
||||
*ptr++ = 0x00;
|
||||
*ptr++ = 0x00;
|
||||
*ptr++ = 0x00;
|
||||
*ptr++ = (g_eeGeneral.beeperMode == e_mode_quiet ? alarm_off : p2);
|
||||
*ptr++ = (IS_SOUND_OFF() ? alarm_off : p2);
|
||||
*ptr++ = p1;
|
||||
frskyPushValue(ptr, value);
|
||||
*ptr++ = type;
|
||||
@@ -621,35 +647,8 @@ inline void frskySendNextAlarm(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
NOINLINE void telemetryPoll10ms()
|
||||
void telemetryInterrupt10ms()
|
||||
{
|
||||
#if defined(PCBSKY9X)
|
||||
rxPdcUsart(processSerialData); // Receive serial data here
|
||||
#endif
|
||||
|
||||
// Attempt to transmit any waiting Fr-Sky alarm set packets every 50ms (subject to packet buffer availability)
|
||||
static uint8_t frskyTxDelay = 5;
|
||||
if (frskyAlarmsSendState && (--frskyTxDelay == 0)) {
|
||||
frskyTxDelay = 5; // 50ms
|
||||
frskySendNextAlarm();
|
||||
}
|
||||
|
||||
#ifndef SIMU
|
||||
#if defined(WS_HOW_HIGH)
|
||||
if (frskyUsrStreaming > 0) {
|
||||
frskyUsrStreaming--;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (frskyStreaming > 0) {
|
||||
frskyStreaming--;
|
||||
}
|
||||
else {
|
||||
frskyData.rssi[0].set(0);
|
||||
frskyData.rssi[1].set(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
uint16_t voltage = 0; /* unit: 1/10 volts */
|
||||
|
||||
#if defined(FRSKY_HUB)
|
||||
@@ -687,9 +686,39 @@ NOINLINE void telemetryPoll10ms()
|
||||
frskyData.currentConsumption += 1;
|
||||
frskyData.currentPrescale -= 3600;
|
||||
}
|
||||
}
|
||||
|
||||
void telemetryWakeup()
|
||||
{
|
||||
#if defined(PCBSKY9X)
|
||||
rxPdcUsart(processSerialData); // Receive serial data here
|
||||
#endif
|
||||
|
||||
// Attempt to transmit any waiting Fr-Sky alarm set packets every 50ms (subject to packet buffer availability)
|
||||
static uint8_t frskyTxDelay = 5;
|
||||
if (frskyAlarmsSendState && (--frskyTxDelay == 0)) {
|
||||
frskyTxDelay = 5; // 50ms
|
||||
frskySendNextAlarm();
|
||||
}
|
||||
|
||||
#ifndef SIMU
|
||||
#if defined(WS_HOW_HIGH)
|
||||
if (frskyUsrStreaming > 0) {
|
||||
frskyUsrStreaming--;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (frskyStreaming > 0) {
|
||||
frskyStreaming--;
|
||||
}
|
||||
else {
|
||||
frskyData.rssi[0].set(0);
|
||||
frskyData.rssi[1].set(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(VARIO)
|
||||
varioPoll10ms();
|
||||
varioWakeup();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -194,7 +194,8 @@ extern uint8_t frskyTxBuffer[FRSKY_TX_PACKET_SIZE];
|
||||
extern uint8_t frskyTxBufferCount;
|
||||
|
||||
void FRSKY_Init(void);
|
||||
NOINLINE void telemetryPoll10ms(void);
|
||||
void telemetryWakeup(void);
|
||||
void telemetryInterrupt10ms(void);
|
||||
|
||||
inline void frskySendAlarms(void)
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@ uint8_t jetiRxBuffer[32];
|
||||
uint8_t jetiReady;
|
||||
uint16_t jetiKeys;
|
||||
|
||||
void telemetryPoll10ms()
|
||||
void telemetryWakeup()
|
||||
{
|
||||
if (jetiReady) {
|
||||
jetiKeys = JETI_KEY_NOCHANGE;
|
||||
|
||||
@@ -49,7 +49,7 @@ void JETI_DisableRXD (void);
|
||||
void JETI_EnableTXD (void);
|
||||
void JETI_DisableTXD (void);
|
||||
|
||||
void telemetryPoll10ms();
|
||||
void telemetryWakeup();
|
||||
void menuTelemetryJeti(uint8_t event);
|
||||
|
||||
#endif
|
||||
|
||||
+19
-35
@@ -36,9 +36,7 @@
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
#include "menus.h"
|
||||
#include "serial.h"
|
||||
#include "mavlink.h"
|
||||
|
||||
#define DUMP_RX_TX
|
||||
|
||||
@@ -607,7 +605,7 @@ void MAVLINK10mspoll(uint8_t count) {
|
||||
}
|
||||
}
|
||||
|
||||
void telemetryPoll10ms() {
|
||||
void telemetryWakeup() {
|
||||
uint16_t tmr10ms = get_tmr10ms();
|
||||
uint8_t count = tmr10ms & 0x0f; // 15*10ms
|
||||
if (!count) {
|
||||
@@ -637,30 +635,16 @@ enum mavlink_menu_ {
|
||||
MENU_DUMP_TX, //
|
||||
#endif
|
||||
MAX_MAVLINK_MENU
|
||||
} MAVLINK_menu = MENU_INFO;
|
||||
};
|
||||
|
||||
inline mavlink_menu_ operator++(mavlink_menu_ &eDOW, int) {
|
||||
int i = static_cast<int>(eDOW);
|
||||
i++;
|
||||
if (i < MAX_MAVLINK_MENU) {
|
||||
eDOW = static_cast<mavlink_menu_>(i);
|
||||
}
|
||||
return eDOW;
|
||||
}
|
||||
uint8_t MAVLINK_menu = MENU_INFO;
|
||||
|
||||
inline mavlink_menu_ operator--(mavlink_menu_ &eDOW, int) {
|
||||
int i = static_cast<int>(eDOW);
|
||||
if (i > 0) {
|
||||
eDOW = static_cast<mavlink_menu_>(--i);
|
||||
}
|
||||
return eDOW;
|
||||
}
|
||||
|
||||
void mav_title(const pm_char * s, uint8_t index) {
|
||||
lcd_putsAtt(0, 0, PSTR("MAVLINK"), INVERS);
|
||||
lcd_putsAtt(10 * FW, 0, s, 0);
|
||||
displayScreenIndex(index, MAX_MAVLINK_MENU, INVERS);
|
||||
lcd_putcAtt(8 * FW, 0, (mav_heartbeat > 0) ? '*' : ' ', 0);
|
||||
void mav_title(const pm_char * s, uint8_t index)
|
||||
{
|
||||
lcd_putsAtt(0, 0, PSTR("MAVLINK"), INVERS);
|
||||
lcd_puts(10 * FW, 0, s);
|
||||
displayScreenIndex(index, MAX_MAVLINK_MENU, INVERS);
|
||||
lcd_putc(8 * FW, 0, (mav_heartbeat > 0) ? '*' : ' ');
|
||||
}
|
||||
|
||||
void lcd_outdezFloat(uint8_t x, uint8_t y, float val, uint8_t precis, uint8_t mode = 0) {
|
||||
@@ -761,9 +745,9 @@ void menuTelemetryMavlinkInfos(void) {
|
||||
uint8_t * ptr = mav_statustext;
|
||||
for (uint8_t j = 0; j < LEN_STATUSTEXT; j++) {
|
||||
if (*ptr == 0) {
|
||||
lcd_putcAtt(x1, y, ' ', 0);
|
||||
lcd_putc(x1, y, ' ');
|
||||
} else {
|
||||
lcd_putcAtt(x1, y, *ptr++, 0);
|
||||
lcd_putc(x1, y, *ptr++);
|
||||
}
|
||||
x1 += FW;
|
||||
}
|
||||
@@ -772,19 +756,19 @@ void menuTelemetryMavlinkInfos(void) {
|
||||
|
||||
if (telemetry_data.status) {
|
||||
if (!isValidReqControlMode()) {
|
||||
lcd_putsnAtt(x1, y, PSTR("REQ"), 3, 0);
|
||||
lcd_puts(x1, y, PSTR("REQ"));
|
||||
putsControlMode(x2, y, telemetry_data.req_mode, 0, 6);
|
||||
y += FH;
|
||||
}
|
||||
lcd_putsnAtt(x1, y, PSTR("MODE"), 4, 0);
|
||||
lcd_puts(x1, y, PSTR("MODE"));
|
||||
putsMavlinkControlMode(x2, y, 6);
|
||||
|
||||
y += FH;
|
||||
lcd_putsnAtt(x1, y, PSTR("BATT"), 4, 0);
|
||||
lcd_puts(x1, y, PSTR("BATT"));
|
||||
lcd_outdezNAtt(xnum, y, telemetry_data.vbat, PREC1, 5);
|
||||
|
||||
y += FH;
|
||||
lcd_putsnAtt(x1, y, PSTR("DROP"), 4, 0);
|
||||
lcd_puts(x1, y, PSTR("DROP"));
|
||||
lcd_outdezAtt(xnum, y, telemetry_data.packet_drop, 0);
|
||||
|
||||
}
|
||||
@@ -807,16 +791,16 @@ void menuTelemetryMavlinkGPS(void) {
|
||||
} else {
|
||||
lcd_outdezNAtt(xnum, y, fix_type, 0, 3);
|
||||
}
|
||||
lcd_putsnAtt(x2 + 5 * FW, y, PSTR("SAT"), 3, 0);
|
||||
lcd_puts(x2 + 5 * FW, y, PSTR("SAT"));
|
||||
lcd_outdezNAtt(x2 + 8 * FW + 3 * FWNUM, y, telemetry_data.satellites_visible, 0, 2);
|
||||
|
||||
// if (telemetry_data.fix_type > 0) {
|
||||
y += FH;
|
||||
lcd_putsnAtt(0, y, PSTR("HDOP"), 4, 0);
|
||||
lcd_puts(0, y, PSTR("HDOP"));
|
||||
lcd_outdezFloat(xnum, y, telemetry_data.eph, 2);
|
||||
|
||||
y += FH;
|
||||
lcd_putsnAtt(0, y, PSTR("COOR"), 4, 0);
|
||||
lcd_puts(0, y, PSTR("COOR"));
|
||||
lcd_outdezFloat(xnum, y, telemetry_data.loc_current.lat, 5);
|
||||
|
||||
// y += FH;
|
||||
@@ -924,7 +908,7 @@ void menuTelemetryMavlink(uint8_t event) {
|
||||
#endif
|
||||
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ extern inline uint8_t MAVLINK_Action2CtrlMode(uint8_t action) {
|
||||
return action;
|
||||
}
|
||||
#endif
|
||||
void telemetryPoll10ms();
|
||||
void telemetryWakeup();
|
||||
void MAVLINK_Init(void);
|
||||
void menuTelemetryMavlink(uint8_t event);
|
||||
void MAVLINK10mspoll(uint16_t time);
|
||||
|
||||
+15
-15
@@ -122,11 +122,11 @@ void setSwitch(uint8_t idx, uint8_t func, int8_t v1, int8_t v2)
|
||||
cs->v2 = v2;
|
||||
}
|
||||
|
||||
const pm_int8_t heli_ar1[] PROGMEM = {-100, 20, 50, 70, 90};
|
||||
const pm_int8_t heli_ar2[] PROGMEM = {90, 70, 50, 70, 90};
|
||||
const pm_int8_t heli_ar3[] PROGMEM = {-20, -20, 0, 60, 100};
|
||||
const pm_int8_t heli_ar4[] PROGMEM = {-100, -60, 0, 60, 100};
|
||||
const pm_int8_t heli_ar5[] PROGMEM = {-100, 0, 0, 0, 100};
|
||||
const pm_int8_t heli_ar1[] PROGMEM = {-100, 20, 30, 70, 90};
|
||||
const pm_int8_t heli_ar2[] PROGMEM = {80, 70, 60, 70, 100};
|
||||
const pm_int8_t heli_ar3[] PROGMEM = {100, 90, 80, 90, 100};
|
||||
const pm_int8_t heli_ar4[] PROGMEM = {-30, -15, 0, 50, 100};
|
||||
const pm_int8_t heli_ar5[] PROGMEM = {-100, -50, 0, 50, 100};
|
||||
|
||||
void applyTemplate(uint8_t idx)
|
||||
{
|
||||
@@ -198,19 +198,19 @@ void applyTemplate(uint8_t idx)
|
||||
case TMPL_HELI_SETUP:
|
||||
clearCurves();
|
||||
|
||||
//Set up Mixes
|
||||
// 3 cyclic channels
|
||||
//Set up Mixes
|
||||
// 3 cyclic channels
|
||||
md=setDest(0, MIXSRC_CYC1); // md->weight=100;
|
||||
md=setDest(1, MIXSRC_CYC2); // md->weight=100;
|
||||
md=setDest(2, MIXSRC_CYC3); // md->weight=100;
|
||||
|
||||
// rudder
|
||||
md=setDest(3, MIXSRC_Rud); // md->weight=100;
|
||||
md=setDest(3, MIXSRC_Rud); // md->weight=100;
|
||||
|
||||
// throttle
|
||||
md=setDest(4, MIXSRC_Thr); md->swtch=SWSRC_ID0; md->curveMode=MODE_CURVE; md->curveParam=CV(1); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(4, MIXSRC_Thr); md->swtch=SWSRC_ID1; md->curveMode=MODE_CURVE; md->curveParam=CV(2); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(4, MIXSRC_Thr); md->swtch=SWSRC_ID2; md->curveMode=MODE_CURVE; md->curveParam=CV(3); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(4, MIXSRC_Thr); md->swtch=SWSRC_ID0; md->curveMode=MODE_CURVE; md->curveParam=CV(1); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(4, MIXSRC_Thr); md->swtch=SWSRC_ID1; md->curveMode=MODE_CURVE; md->curveParam=CV(2); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(4, MIXSRC_Thr); md->swtch=SWSRC_ID2; md->curveMode=MODE_CURVE; md->curveParam=CV(3); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(4, MIXSRC_MAX); md_SetWeight(md, -100); md->swtch=SWSRC_THR; md->mltpx=MLTPX_REP;
|
||||
|
||||
// gyro gain
|
||||
@@ -218,11 +218,11 @@ void applyTemplate(uint8_t idx)
|
||||
md=setDest(5, MIXSRC_MAX); md_SetWeight(md, -30); md->swtch= SWSRC_GEA;
|
||||
|
||||
// collective
|
||||
md=setDest(11, MIXSRC_Thr); /*md->weight= 100;*/ md->swtch=SWSRC_ID0; md->curveMode=MODE_CURVE; md->curveParam=CV(4); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11, MIXSRC_Thr); /*md->weight= 100;*/ md->swtch=SWSRC_ID1; md->curveMode=MODE_CURVE; md->curveParam=CV(5); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(11, MIXSRC_Thr); /*md->weight= 100;*/ md->swtch=SWSRC_ID2; md->curveMode=MODE_CURVE; md->curveParam=CV(6); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(10, MIXSRC_Thr); /*md->weight= 100;*/ md->swtch=SWSRC_ID0; md->curveMode=MODE_CURVE; md->curveParam=CV(4); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(10, MIXSRC_Thr); /*md->weight= 100;*/ md->swtch=SWSRC_ID1; md->curveMode=MODE_CURVE; md->curveParam=CV(5); md->carryTrim=TRIM_OFF;
|
||||
md=setDest(10, MIXSRC_Thr); /*md->weight= 100;*/ md->swtch=SWSRC_ID2; md->curveMode=MODE_CURVE; md->curveParam=CV(6); md->carryTrim=TRIM_OFF;
|
||||
|
||||
g_model.swashR.collectiveSource = MIXSRC_CH11 - MAX_SWITCH;
|
||||
g_model.swashR.collectiveSource = MIXSRC_CH11;
|
||||
g_model.swashR.type = SWASH_TYPE_120;
|
||||
|
||||
//Set up Curves
|
||||
|
||||
+45
-9
@@ -70,7 +70,12 @@ const pm_char STR_OPEN9X[] PROGMEM =
|
||||
ISTR(FUNCSOUNDS)
|
||||
ISTR(VTELEMCHNS)
|
||||
#if defined(FRSKY) || defined(CPUARM)
|
||||
#if defined(CPUARM)
|
||||
ISTR(VTELEMUNIT_IMP)
|
||||
ISTR(VTELEMUNIT_NORM)
|
||||
#else
|
||||
ISTR(VTELEMUNIT)
|
||||
#endif
|
||||
ISTR(VALARM)
|
||||
ISTR(VALARMFN)
|
||||
ISTR(VTELPROTO)
|
||||
@@ -79,17 +84,17 @@ const pm_char STR_OPEN9X[] PROGMEM =
|
||||
ISTR(VARIOSRC)
|
||||
ISTR(VSCREEN)
|
||||
#endif
|
||||
#ifdef TEMPLATES
|
||||
#if defined(TEMPLATES)
|
||||
ISTR(VTEMPLATES)
|
||||
#endif
|
||||
#ifdef HELI
|
||||
#if defined(HELI)
|
||||
ISTR(VSWASHTYPE)
|
||||
#endif
|
||||
ISTR(VKEYS)
|
||||
ISTR(VSWITCHES)
|
||||
ISTR(VSRCRAW)
|
||||
ISTR(VTMRMODES)
|
||||
#if defined(PCBGRUVIN9X) || defined (CPUARM)
|
||||
#if defined(PCBGRUVIN9X) || defined(CPUARM)
|
||||
ISTR(DATETIME)
|
||||
#endif
|
||||
#if defined(CPUARM)
|
||||
@@ -135,6 +140,10 @@ const pm_char STR_AILDIRECTION[] PROGMEM = TR_AILDIRECTION;
|
||||
const pm_char STR_COLDIRECTION[] PROGMEM = TR_COLDIRECTION;
|
||||
#endif
|
||||
const pm_char STR_MODE[] PROGMEM = TR_MODE;
|
||||
#if defined(AUDIO) && defined(BEEPER)
|
||||
const pm_char STR_SPEAKER[] PROGMEM = INDENT"Speaker";
|
||||
const pm_char STR_BEEPER[] PROGMEM = INDENT"Beeper";
|
||||
#endif
|
||||
const pm_char STR_NOFREEEXPO[] PROGMEM = TR_NOFREEEXPO;
|
||||
const pm_char STR_NOFREEMIXER[] PROGMEM = TR_NOFREEMIXER;
|
||||
const pm_char STR_INSERTMIX[] PROGMEM = TR_INSERTMIX;
|
||||
@@ -297,9 +306,10 @@ const pm_char STR_RXNUM[] PROGMEM = TR_RXNUM;
|
||||
const pm_char STR_SYNCMENU[] PROGMEM = TR_SYNCMENU;
|
||||
const pm_char STR_INTERNALRF[] PROGMEM = TR_INTERNALRF;
|
||||
const pm_char STR_EXTERNALRF[] PROGMEM = TR_EXTERNALRF;
|
||||
const pm_char STR_FAILSAFE[] PROGMEM = TR_FAILSAFE;
|
||||
const pm_char STR_FAILSAFESET[] PROGMEM = TR_FAILSAFESET;
|
||||
const pm_char STR_COUNTRYCODE[] PROGMEM = TR_COUNTRYCODE;
|
||||
const pm_char STR_FAILSAFE[] PROGMEM = TR_FAILSAFE;
|
||||
const pm_char STR_VFAILSAFE[] PROGMEM = "\011""Hold\0 ""Custom\0 ""No pulses"; // TODO non-zero terminated
|
||||
const pm_char STR_FAILSAFESET[] PROGMEM = TR_FAILSAFESET;
|
||||
#endif
|
||||
|
||||
const pm_char STR_INVERT_THR[] PROGMEM = TR_INVERT_THR;
|
||||
@@ -323,6 +333,8 @@ const pm_char STR_CURRENT[] PROGMEM = TR_CURRENT;
|
||||
|
||||
#if defined(CPUARM)
|
||||
const pm_char STR_CURRENT_CALIB[] PROGMEM = TR_CURRENT_CALIB;
|
||||
const pm_char STR_UNITSSYSTEM[] PROGMEM = "Units";
|
||||
const pm_char STR_VUNITSSYSTEM[] PROGMEM = TR("\006MetricImper.", "\010Metric\0 Imperial"); // TODO move it to non-zero terminated strings
|
||||
#endif
|
||||
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
@@ -331,6 +343,17 @@ const pm_char STR_CREATE_MODEL[] PROGMEM = TR_CREATE_MODEL;
|
||||
const pm_char STR_COPY_MODEL[] PROGMEM = TR_COPY_MODEL;
|
||||
const pm_char STR_MOVE_MODEL[] PROGMEM = TR_MOVE_MODEL;
|
||||
const pm_char STR_DELETE_MODEL[] PROGMEM = TR_DELETE_MODEL;
|
||||
const pm_char STR_EDIT[] PROGMEM = "Edit";
|
||||
const pm_char STR_INSERT_BEFORE[] PROGMEM = "Insert Before";
|
||||
const pm_char STR_INSERT_AFTER[] PROGMEM = "Insert After";
|
||||
const pm_char STR_COPY[] PROGMEM = "Copy";
|
||||
const pm_char STR_MOVE[] PROGMEM = "Move";
|
||||
const pm_char STR_DELETE[] PROGMEM = "Delete";
|
||||
const pm_char STR_RESET_FLIGHT[] PROGMEM = "Reset Flight";
|
||||
const pm_char STR_RESET_TIMER1[] PROGMEM = "Reset Timer1";
|
||||
const pm_char STR_RESET_TIMER2[] PROGMEM = "Reset Timer2";
|
||||
const pm_char STR_RESET_TELEMETRY[] PROGMEM = "Reset Telemetry";
|
||||
const pm_char STR_STATISTICS[] PROGMEM = "Statistics";
|
||||
#endif
|
||||
|
||||
#if defined(SDCARD)
|
||||
@@ -397,10 +420,23 @@ const pm_char STR_DATE[] PROGMEM = TR_DATE;
|
||||
const pm_char STR_CHANNELS_MONITOR[] PROGMEM = TR_CHANNELS_MONITOR;
|
||||
|
||||
#if LCD_W >= 212
|
||||
const pm_char STR_MODELNAME[] PROGMEM = TR_MODELNAME;
|
||||
const pm_char STR_PHASENAME[] PROGMEM = TR_PHASENAME;
|
||||
const pm_char STR_MIXNAME[] PROGMEM = TR_MIXNAME;
|
||||
const pm_char STR_EXPONAME[] PROGMEM = TR_EXPONAME;
|
||||
const pm_char STR_MODELNAME[] PROGMEM = TR_MODELNAME;
|
||||
const pm_char STR_PHASENAME[] PROGMEM = TR_PHASENAME;
|
||||
const pm_char STR_MIXNAME[] PROGMEM = TR_MIXNAME;
|
||||
const pm_char STR_EXPONAME[] PROGMEM = TR_EXPONAME;
|
||||
#endif
|
||||
|
||||
#if LCD_W >= 212
|
||||
const char * STR_PHASES_HEADERS[] = { " Name ", " Switch ", " Trims ", " Fade In ", " Fade Out " };
|
||||
const char * STR_LIMITS_HEADERS[] = { " Name ", " Offset ", " Min ", " Max ", " Direction ", " PPM Center ", " Symetrical " };
|
||||
const char * STR_CSW_HEADERS[] = { " Function ", " V1 ", " V2 ", " AND Switch ", " Duration ", " Delay " };
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
const pm_char STR_BYTES[] PROGMEM = "bytes";
|
||||
const pm_char STR_MODULE_BIND[] PROGMEM = "[Bind]";
|
||||
const pm_char STR_MODULE_RANGE[] PROGMEM = "[Range]";
|
||||
const pm_char STR_SET[] PROGMEM = "[Set]";
|
||||
#endif
|
||||
|
||||
const pm_uchar font_5x7[] PROGMEM = {
|
||||
|
||||
+56
-6
@@ -67,9 +67,9 @@
|
||||
#define EOFS(x) ( OFS_##x + sizeof(TR_##x) )
|
||||
|
||||
#if LCD_W >= 212
|
||||
#define TR(x,y) y
|
||||
#define TR(x,y) y
|
||||
#else
|
||||
#define TR(x,y) x
|
||||
#define TR(x,y) x
|
||||
#endif
|
||||
|
||||
// The non-0-terminated-strings
|
||||
@@ -111,8 +111,14 @@ extern const pm_char STR_OPEN9X[];
|
||||
#define OFS_FUNCSOUNDS (OFS_VFSWRESET + sizeof(TR_VFSWRESET))
|
||||
#define OFS_VTELEMCHNS (OFS_FUNCSOUNDS + sizeof(TR_FUNCSOUNDS))
|
||||
#if defined(FRSKY) || defined(CPUARM)
|
||||
#define OFS_VTELEMUNIT (OFS_VTELEMCHNS + sizeof(TR_VTELEMCHNS))
|
||||
#define OFS_VALARM (OFS_VTELEMUNIT + sizeof(TR_VTELEMUNIT))
|
||||
#if defined(CPUARM)
|
||||
#define OFS_VTELEMUNIT_IMP (OFS_VTELEMCHNS + sizeof(TR_VTELEMCHNS))
|
||||
#define OFS_VTELEMUNIT_NORM (OFS_VTELEMUNIT_IMP + sizeof(TR_VTELEMUNIT_IMP))
|
||||
#define OFS_VALARM (OFS_VTELEMUNIT_NORM + sizeof(TR_VTELEMUNIT_NORM))
|
||||
#else
|
||||
#define OFS_VTELEMUNIT (OFS_VTELEMCHNS + sizeof(TR_VTELEMCHNS))
|
||||
#define OFS_VALARM (OFS_VTELEMUNIT + sizeof(TR_VTELEMUNIT))
|
||||
#endif
|
||||
#define OFS_VALARMFN (OFS_VALARM + sizeof(TR_VALARM))
|
||||
#define OFS_VTELPROTO (OFS_VALARMFN + sizeof(TR_VALARMFN))
|
||||
#define OFS_GPSFORMAT (OFS_VTELPROTO + sizeof(TR_VTELPROTO))
|
||||
@@ -180,7 +186,11 @@ extern const pm_char STR_OPEN9X[];
|
||||
#define STR_VTELEMCHNS (STR_OPEN9X + OFS_VTELEMCHNS)
|
||||
|
||||
#if defined(FRSKY) || defined(CPUARM)
|
||||
#define STR_VTELEMUNIT (STR_OPEN9X + OFS_VTELEMUNIT)
|
||||
#if defined(CPUARM)
|
||||
#define STR_VTELEMUNIT (STR_OPEN9X + (g_eeGeneral.imperial ? OFS_VTELEMUNIT_IMP : OFS_VTELEMUNIT_NORM))
|
||||
#else
|
||||
#define STR_VTELEMUNIT (STR_OPEN9X + OFS_VTELEMUNIT)
|
||||
#endif
|
||||
#define STR_VALARM (STR_OPEN9X + OFS_VALARM)
|
||||
#define STR_VALARMFN (STR_OPEN9X + OFS_VALARMFN)
|
||||
#define STR_VTELPROTO (STR_OPEN9X + OFS_VTELPROTO)
|
||||
@@ -261,6 +271,13 @@ extern const pm_char STR_ELEDIRECTION[];
|
||||
extern const pm_char STR_AILDIRECTION[];
|
||||
extern const pm_char STR_COLDIRECTION[];
|
||||
extern const pm_char STR_MODE[];
|
||||
#if defined(AUDIO) && defined(BEEPER)
|
||||
extern const pm_char STR_SPEAKER[];
|
||||
extern const pm_char STR_BEEPER[];
|
||||
#else
|
||||
#define STR_SPEAKER STR_MODE
|
||||
#define STR_BEEPER STR_MODE
|
||||
#endif
|
||||
extern const pm_char STR_NOFREEEXPO[];
|
||||
extern const pm_char STR_NOFREEMIXER[];
|
||||
extern const pm_char STR_INSERTMIX[];
|
||||
@@ -402,6 +419,7 @@ extern const pm_char STR_INTERNALRF[];
|
||||
extern const pm_char STR_EXTERNALRF[];
|
||||
extern const pm_char STR_FAILSAFE[];
|
||||
extern const pm_char STR_FAILSAFESET[];
|
||||
extern const pm_char STR_VFAILSAFE[]; // TODO non-zero terminated
|
||||
extern const pm_char STR_COUNTRYCODE[];
|
||||
#endif
|
||||
|
||||
@@ -429,6 +447,8 @@ extern const pm_char STR_CURRENT[];
|
||||
#if defined(CPUARM)
|
||||
extern const pm_char STR_CURRENT_CALIB[];
|
||||
#define LEN_CALIB_FIELDS (PSIZE(TR_BATT_CALIB) > PSIZE(TR_CURRENT_CALIB) ? PSIZE(TR_BATT_CALIB) : PSIZE(TR_CURRENT_CALIB))
|
||||
extern const pm_char STR_UNITSSYSTEM[];
|
||||
extern const pm_char STR_VUNITSSYSTEM[];
|
||||
#else
|
||||
#define LEN_CALIB_FIELDS PSIZE(TR_BATT_CALIB)
|
||||
#endif
|
||||
@@ -439,6 +459,17 @@ extern const pm_char STR_CURRENT[];
|
||||
extern const pm_char STR_COPY_MODEL[];
|
||||
extern const pm_char STR_MOVE_MODEL[];
|
||||
extern const pm_char STR_DELETE_MODEL[];
|
||||
extern const pm_char STR_EDIT[];
|
||||
extern const pm_char STR_INSERT_BEFORE[];
|
||||
extern const pm_char STR_INSERT_AFTER[];
|
||||
extern const pm_char STR_COPY[];
|
||||
extern const pm_char STR_MOVE[];
|
||||
extern const pm_char STR_DELETE[];
|
||||
extern const pm_char STR_RESET_FLIGHT[];
|
||||
extern const pm_char STR_RESET_TIMER1[];
|
||||
extern const pm_char STR_RESET_TIMER2[];
|
||||
extern const pm_char STR_RESET_TELEMETRY[];
|
||||
extern const pm_char STR_STATISTICS[];
|
||||
#endif
|
||||
|
||||
#if defined(SDCARD)
|
||||
@@ -517,7 +548,7 @@ extern const pm_char STR_DATE[];
|
||||
extern const pm_char STR_CHANNELS_MONITOR[];
|
||||
|
||||
#if defined(VOICE)
|
||||
PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att);
|
||||
PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att);
|
||||
PLAY_FUNCTION(playDuration, int16_t seconds);
|
||||
#endif
|
||||
|
||||
@@ -533,4 +564,23 @@ extern const pm_char STR_CHANNELS_MONITOR[];
|
||||
#define STR_EXPONAME STR_NAME
|
||||
#endif
|
||||
|
||||
#if LCD_W >= 212
|
||||
extern const char * STR_PHASES_HEADERS[];
|
||||
extern const char * STR_LIMITS_HEADERS[];
|
||||
extern const char * STR_CSW_HEADERS[];
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
extern const pm_char STR_BYTES[];
|
||||
extern const pm_char STR_MODULE_BIND[];
|
||||
extern const pm_char STR_MODULE_RANGE[];
|
||||
extern const pm_char STR_SET[];
|
||||
#endif
|
||||
|
||||
// TODO move to translations files
|
||||
#define CHR_SHORT 's'
|
||||
#define CHR_LONG 'l'
|
||||
#define CHR_TOGGLE 't'
|
||||
#define CHR_HOUR 'h'
|
||||
|
||||
#endif
|
||||
|
||||
+26
-15
@@ -121,8 +121,8 @@
|
||||
#define LEN_VMIXTRIMS "\004"
|
||||
#define TR_VMIXTRIMS "VYP\0""ZAP\0""Sm\203r""V\212\207k""Plyn""K\206id"
|
||||
|
||||
#define LEN_VCSWFUNC "\006"
|
||||
#define TR_VCSWFUNC "---\0 ""v1==x\0""v1>x\0 ""v1<x\0 ""|v1|>x""|v1|<x""AND\0 ""OR\0 ""XOR\0 ""v1==v2""v1>v2\0""v1<v2\0""d>=x\0 ""|d|>=x"
|
||||
#define LEN_VCSWFUNC "\005"
|
||||
#define TR_VCSWFUNC "---\0 ""a{x\0 ""a>x\0 ""a<x\0 ""|a|>x""|a|<x""AND\0 ""OR\0 ""XOR\0 ""a=b\0 ""a>b\0 ""a<b\0 ""d}x\0 ""|d|}x"
|
||||
|
||||
#define LEN_VFSWFUNC "\013"
|
||||
|
||||
@@ -138,7 +138,9 @@
|
||||
#define TR_SOUND "P\204pnout\0 "
|
||||
#endif
|
||||
|
||||
#if defined(HAPTIC)
|
||||
#if defined(PCBTARANIS)
|
||||
#define TR_HAPTIC
|
||||
#elif defined(HAPTIC)
|
||||
#define TR_HAPTIC "Vibrovat\0 "
|
||||
#else
|
||||
#define TR_HAPTIC "[Vibrovat]\0"
|
||||
@@ -195,8 +197,10 @@
|
||||
#define TR_FSW_RESET_TELEM
|
||||
#endif
|
||||
|
||||
#if ROTARY_ENCODERS > 0
|
||||
#define TR_FSW_RESET_ROTENC "R.Enc"
|
||||
#if ROTARY_ENCODERS == 2
|
||||
#define TR_FSW_RESET_ROTENC TR("REa\0 ""REb\0 ", "RotEnc A\0""RotEnc B\0")
|
||||
#elif ROTARY_ENCODERS == 1
|
||||
#define TR_FSW_RESET_ROTENC TR("R.Enc", "RotEnc\0 ")
|
||||
#else
|
||||
#define TR_FSW_RESET_ROTENC
|
||||
#endif
|
||||
@@ -209,16 +213,23 @@
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2""Tx\0 ""Rx\0 ""A1\0 ""A2\0 ""Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+""Cur+""Acc\0""Time"
|
||||
|
||||
#ifdef IMPERIAL_UNITS
|
||||
#define LENGTH_UNIT "ft\0"
|
||||
#define SPEED_UNIT "kts"
|
||||
#if defined(CPUARM)
|
||||
#define LEN_VTELEMUNIT_NORM "\003"
|
||||
#define TR_VTELEMUNIT_NORM "v\0 ""A\0 ""m/s""-\0 ""kmh""m\0 ""@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#define LEN_VTELEMUNIT_IMP "\003"
|
||||
#define TR_VTELEMUNIT_IMP "v\0 ""A\0 ""m/s""-\0 ""kts""ft\0""@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#else
|
||||
#define LENGTH_UNIT "m\0 "
|
||||
#define SPEED_UNIT "kmh"
|
||||
#if defined(IMPERIAL_UNITS)
|
||||
#define LENGTH_UNIT "ft\0"
|
||||
#define SPEED_UNIT "kts"
|
||||
#else
|
||||
#define LENGTH_UNIT "m\0 "
|
||||
#define SPEED_UNIT "kmh"
|
||||
#endif
|
||||
#define LEN_VTELEMUNIT "\003"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""m/s""-\0 " SPEED_UNIT LENGTH_UNIT "@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#endif
|
||||
|
||||
#define LEN_VTELEMUNIT "\003"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""m/s""-\0 " SPEED_UNIT LENGTH_UNIT "@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#define STR_V (STR_VTELEMUNIT+1)
|
||||
#define STR_A (STR_VTELEMUNIT+4)
|
||||
|
||||
@@ -251,7 +262,7 @@
|
||||
#define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0"
|
||||
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS " Menu"" Exit"" Dol\211""Nhoru""Vprvo""Vlevo"
|
||||
#define TR_VKEYS TR(" Menu"" Exit"" Dol\211""Nhoru""Vprvo""Vlevo", " Menu"" Exit""Enter"" Page"" Plus""Minus")
|
||||
|
||||
#define LEN_VRENCODERS "\003"
|
||||
#define TR_VRENCODERS "REa""REb"
|
||||
@@ -433,7 +444,7 @@
|
||||
#define TR_TXnRX "Tx:\0Rx:"
|
||||
#define OFS_RX 4
|
||||
#define TR_ACCEL "Acc:"
|
||||
#define TR_NODATA "NO DATA"
|
||||
#define TR_NODATA CENTER"NO DATA"
|
||||
#define TR_TM1TM2 "TM1\032TM2"
|
||||
#define TR_THRTHP "THR\032TH%"
|
||||
#define TR_TOT "TOT"
|
||||
@@ -450,7 +461,7 @@
|
||||
|
||||
#define TR_T10MSUS "T10ms\016us"
|
||||
#define TR_FREESTACKMINB "Free Stack\010b"
|
||||
#define TR_MENUTORESET "[MENU] >> Reset"
|
||||
#define TR_MENUTORESET CENTER TR_ENTER" >> Reset"
|
||||
#define TR_PPM "PPM"
|
||||
#define TR_CH "CH"
|
||||
#define TR_MODEL "MODEL"
|
||||
|
||||
+345
-339
@@ -2,7 +2,7 @@
|
||||
* Authors (alphabetical order)
|
||||
* - Andre Bernet <bernet.andre@gmail.com>
|
||||
* - Andreas Weitl <andreas.weitl@gmx.de>
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Helmut Renz <hrenz62961@aol.com>
|
||||
* - Thomas Husterer
|
||||
*
|
||||
* opentx is based on code named
|
||||
@@ -23,79 +23,79 @@
|
||||
*/
|
||||
|
||||
// NON ZERO TERMINATED STRINGS
|
||||
#define LEN_OFFON "\003"
|
||||
#define TR_OFFON "AUS""AN\0"
|
||||
#define LEN_OFFON "\003"
|
||||
#define TR_OFFON "AUS""EIN"
|
||||
|
||||
#define LEN_MMMINV "\003"
|
||||
#define TR_MMMINV "---""INV"
|
||||
#define LEN_MMMINV "\003"
|
||||
#define TR_MMMINV "---""INV"
|
||||
|
||||
#define LEN_NCHANNELS "\004"
|
||||
#define TR_NCHANNELS "\0014CH\0016CH\0018CH10CH12CH14CH16CH"
|
||||
#define LEN_NCHANNELS "\004"
|
||||
#define TR_NCHANNELS "\0014CH\0016CH\0018CH10CH12CH14CH16CH"
|
||||
|
||||
#define LEN_VBEEPMODE "\005"
|
||||
#define TR_VBEEPMODE "Stumm""Alarm""NoKey""Alle\0"
|
||||
#define LEN_VBEEPMODE "\005"
|
||||
#define TR_VBEEPMODE "Stumm""Alarm""NoKey""Alle\0"
|
||||
|
||||
#define LEN_VBEEPLEN "\005"
|
||||
#define TR_VBEEPLEN "0====""=0===""==0==""===0=""====0"
|
||||
#define LEN_VBEEPLEN "\005"
|
||||
#define TR_VBEEPLEN "0====""=0===""==0==""===0=""====0"
|
||||
|
||||
#define LEN_VRENAVIG "\003"
|
||||
#define TR_VRENAVIG "AUSDGaDGb"
|
||||
#define LEN_VRENAVIG "\003"
|
||||
#define TR_VRENAVIG "AUSDGaDGb"
|
||||
|
||||
#define LEN_VBLMODE "\004"
|
||||
#define TR_VBLMODE "OFF ""Tast""Knpl""Alle""ON\0"
|
||||
#define LEN_VBLMODE "\004"
|
||||
#define TR_VBLMODE "AUS ""Tast""Stks""Both""EIN "
|
||||
|
||||
#define LEN_TRNMODE "\003"
|
||||
#define TR_TRNMODE "AUS"" +="" :="
|
||||
#define LEN_TRNMODE "\003"
|
||||
#define TR_TRNMODE "AUS"" +="" :="
|
||||
|
||||
#define LEN_TRNCHN "\003"
|
||||
#define TR_TRNCHN "CH1CH2CH3CH4"
|
||||
#define LEN_TRNCHN "\003"
|
||||
#define TR_TRNCHN "CH1CH2CH3CH4"
|
||||
|
||||
#define LEN_DATETIME "\005"
|
||||
#define TR_DATETIME "DATE:""TIME:"
|
||||
#define LEN_DATETIME "\005"
|
||||
#define TR_DATETIME "DATE:""ZEIT:"
|
||||
|
||||
#define LEN_VLCD "\006"
|
||||
#define TR_VLCD "NormalOptrex"
|
||||
#define LEN_VLCD "\006"
|
||||
#define TR_VLCD "NormalOptrex"
|
||||
|
||||
#define LEN_COUNTRYCODES TR("\002", "\007")
|
||||
#define TR_COUNTRYCODES TR("US""JP""EU", "America""Japan\0 ""Europe\0")
|
||||
#define TR_COUNTRYCODES TR("US""JP""EU", "Amerika""Japan\0 ""Europa\0")
|
||||
|
||||
#define LEN_VTRIMINC "\006"
|
||||
#define TR_VTRIMINC "Expo. ""X-Fein""Fein ""Mittel""Grob "
|
||||
#define LEN_VTRIMINC TR("\006","\013")
|
||||
#define TR_VTRIMINC TR("Expo ""ExFein""Fein ""Mittel""Grob ","Exponential""Extra Fein ""Fein ""Mittel ""Grob ")
|
||||
|
||||
#define LEN_RETA123 "\001"
|
||||
#define LEN_RETA123 "\001"
|
||||
|
||||
#if defined(PCBGRUVIN9X)
|
||||
#if ROTARY_ENCODERS > 2
|
||||
#define TR_RETA123 "SHGQ123abcd"
|
||||
#define TR_RETA123 "SHGQ123abcd"
|
||||
#else
|
||||
#define TR_RETA123 "SHGQ123ab"
|
||||
#define TR_RETA123 "SHGQ123ab"
|
||||
#endif
|
||||
#elif defined(PCBTARANIS)
|
||||
#define TR_RETA123 "SHGQ12LR"
|
||||
#define TR_RETA123 "SHGQ12LR"
|
||||
#else
|
||||
#define TR_RETA123 "SHGQ123"
|
||||
#define TR_RETA123 "SHGQ123"
|
||||
#endif
|
||||
|
||||
#define LEN_VPROTOS "\006"
|
||||
#define LEN_VPROTOS "\006"
|
||||
|
||||
#if defined(PXX)
|
||||
#define TR_PXX "PXX\0 "
|
||||
#define TR_PXX "PXX\0 "
|
||||
#elif defined(DSM2) || defined(IRPROTOS)
|
||||
#define TR_PXX "[PXX]\0"
|
||||
#define TR_PXX "[PXX]\0"
|
||||
#else
|
||||
#define TR_PXX
|
||||
#endif
|
||||
|
||||
#if defined(DSM2)
|
||||
#define TR_DSM2 "LP45\0 ""DSM2\0 ""DSMX\0 "
|
||||
#define TR_DSM2 "LP45\0 ""DSM2\0 ""DSMX\0 "
|
||||
#elif defined(IRPROTOS)
|
||||
#define TR_DSM2 "[LP45]""[DSM2]""[DSMX]"
|
||||
#define TR_DSM2 "[LP45]""[DSM2]""[DSMX]"
|
||||
#else
|
||||
#define TR_DSM2
|
||||
#endif
|
||||
|
||||
#if defined(IRPROTOS)
|
||||
#define TR_IRPROTOS "SILV TRAC09PICZ SWIFT\0"
|
||||
#define TR_IRPROTOS "SILV TRAC09PICZ SWIFT\0"
|
||||
#else
|
||||
#define TR_IRPROTOS
|
||||
#endif
|
||||
@@ -103,166 +103,177 @@
|
||||
#if defined(CPUARM)
|
||||
#define TR_XPPM
|
||||
#else
|
||||
#define TR_XPPM "PPM16\0""PPMsim"
|
||||
#define TR_XPPM "PPM16\0""PPMsim"
|
||||
#endif
|
||||
|
||||
#define TR_VPROTOS "PPM\0 " TR_XPPM TR_PXX TR_DSM2 TR_IRPROTOS
|
||||
#define TR_VPROTOS "PPM\0 " TR_XPPM TR_PXX TR_DSM2 TR_IRPROTOS
|
||||
|
||||
#define LEN_POSNEG "\003"
|
||||
#define TR_POSNEG "POS""NEG"
|
||||
#define LEN_POSNEG "\003"
|
||||
#define TR_POSNEG "POS""NEG"
|
||||
|
||||
#define LEN_VCURVEFUNC "\003"
|
||||
#define TR_VCURVEFUNC "---""x>0""x<0""|x|""f>0""f<0""|f|"
|
||||
#define LEN_VCURVEFUNC "\003"
|
||||
#define TR_VCURVEFUNC "---""x>0""x<0""|x|""f>0""f<0""|f|"
|
||||
|
||||
#define LEN_VMLTPX "\010"
|
||||
#define TR_VMLTPX "Addieren""Multipl.""Ersetzen"
|
||||
#define LEN_VMLTPX "\010"
|
||||
#define TR_VMLTPX "Addiere ""Multipl.""Ersetze "
|
||||
|
||||
#define LEN_VMLTPX2 "\002"
|
||||
#define TR_VMLTPX2 "+=""*="":="
|
||||
#define LEN_VMLTPX2 "\002"
|
||||
#define TR_VMLTPX2 "+=""*="":="
|
||||
|
||||
#define LEN_VMIXTRIMS "\003"
|
||||
#define TR_VMIXTRIMS "AUS""AN ""StR""H\203R""Gas""QuR"
|
||||
#define LEN_VMIXTRIMS "\003"
|
||||
#define TR_VMIXTRIMS "AUSF""EIN""Rud""Ele""Thr""Ail"
|
||||
|
||||
#define LEN_VCSWFUNC "\006"
|
||||
#define TR_VCSWFUNC "---\0 ""v1==x\0""v1>x\0 ""v1<x\0 ""|v1|>x""|v1|<x""AND\0 ""OR\0 ""XOR\0 ""v1==v2""v1>v2\0""v1<v2\0""d>=x\0 ""|d|>=x"
|
||||
#define LEN_VCSWFUNC "\005"
|
||||
#define TR_VCSWFUNC "---\0 ""a{x\0 ""a>x\0 ""a<x\0 ""|a|>x""|a|<x""AND\0 ""OR\0 ""XOR\0 ""a=b\0 ""a>b\0 ""a<b\0 ""d}x\0 ""|d|}x"
|
||||
|
||||
#define LEN_VFSWFUNC "\015"
|
||||
#define LEN_VFSWFUNC "\012"
|
||||
|
||||
#if defined(VARIO)
|
||||
#define TR_VVARIO "Vario\0 "
|
||||
#if defined(VARIO)
|
||||
#define TR_VVARIO "Vario\0 " // nur 10 Zeichen String!
|
||||
#else
|
||||
#define TR_VVARIO "[Vario]\0 "
|
||||
#define TR_VVARIO "[Vario]\0 "
|
||||
#endif
|
||||
|
||||
#if defined(AUDIO)
|
||||
#define TR_SOUND "Ton spiel.\0 "
|
||||
#define TR_SOUND "Spiel T\203ne"
|
||||
#else
|
||||
#define TR_SOUND "Piep\0 "
|
||||
#define TR_SOUND "Spiel\0 "
|
||||
#endif
|
||||
|
||||
#if defined(HAPTIC)
|
||||
#define TR_HAPTIC "Haptic\0 "
|
||||
#if defined(PCBTARANIS)
|
||||
#define TR_HAPTIC
|
||||
#elif defined(HAPTIC)
|
||||
#define TR_HAPTIC "Haptic\0 "
|
||||
#else
|
||||
#define TR_HAPTIC "[Haptic]\0 "
|
||||
#define TR_HAPTIC "[Haptic]\0 "
|
||||
#endif
|
||||
|
||||
#if defined(VOICE)
|
||||
#if defined(PCBSKY9X)
|
||||
#define TR_PLAY_TRACK "Ton spiel.\0 "
|
||||
#define TR_PY_TRACK "Spiel\0 "
|
||||
#else
|
||||
#define TR_PLAY_TRACK "Ton spiel.\0 "
|
||||
#define TR_PLAY_TRACK "Sag Text\0 "
|
||||
#endif
|
||||
#define TR_PLAY_BOTH "Play Both\0 "
|
||||
#define TR_PLAY_VALUE "Wert sagen\0 "
|
||||
#define TR_PLAY_BOTH "Sag Beide "
|
||||
#define TR_PLAY_VALUE "Sag Wert\0 "
|
||||
#else
|
||||
#define TR_PLAY_TRACK "[Ton spiel.]\0"
|
||||
#define TR_PLAY_BOTH "[Play Both]\0 "
|
||||
#define TR_PLAY_VALUE "[Wert sagen]\0"
|
||||
#define TR_PLAY_TRACK "[Sag Text]"
|
||||
#define TR_PLAY_BOTH "[SagBeide]"
|
||||
#define TR_PLAY_VALUE "[Sag Wert]"
|
||||
#endif
|
||||
|
||||
#define TR_CFN_VOLUME "Lautst\201rke\0 "
|
||||
#define TR_CFN_BG_MUSIC "Musik Start\0 ""Musik Pause\0 "
|
||||
#define TR_CFN_VOLUME "Lautst\201rke"
|
||||
#define TR_CFN_BG_MUSIC "MusikStart""MusikPause"
|
||||
|
||||
#if defined(SDCARD)
|
||||
#define TR_SDCLOGS "SD Aufz.\0 "
|
||||
#define TR_SDCLOGS "SD Aufz.\0 "
|
||||
#else
|
||||
#define TR_SDCLOGS "[SD Aufz.]\0 "
|
||||
#define TR_SDCLOGS "[SD Aufz.]"
|
||||
#endif
|
||||
|
||||
#ifdef GVARS
|
||||
#define TR_CFN_ADJUST_GVAR "\200ndere \0 "
|
||||
#define TR_CFN_ADJUST_GVAR "\200ndere \0 "
|
||||
#else
|
||||
#define TR_CFN_ADJUST_GVAR
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
#define TR_CFN_TEST "Test\0 "
|
||||
#define TR_CFN_TEST "Test\0"
|
||||
#else
|
||||
#define TR_CFN_TEST
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define TR_VFSWFUNC "Sicher\0 ""Lehrsch.\0 ""Instant. Trim" TR_SOUND TR_HAPTIC "R\205cksetz.\0 " TR_VVARIO TR_PLAY_TRACK TR_PLAY_VALUE TR_SDCLOGS TR_CFN_VOLUME "Beleuchtung\0 " TR_CFN_BG_MUSIC TR_CFN_ADJUST_GVAR TR_CFN_TEST
|
||||
#define TR_VFSWFUNC "Sicher\0 ""Lehrer \0 ""Inst. Trim" TR_SOUND TR_HAPTIC "R\205cksetz.\0" TR_VVARIO TR_PLAY_TRACK TR_PLAY_VALUE TR_SDCLOGS TR_CFN_VOLUME "LCD Licht\0" TR_CFN_BG_MUSIC TR_CFN_ADJUST_GVAR TR_CFN_TEST
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
#define TR_VFSWFUNC "Sicher\0 ""Lehrsch.\0 ""Instant. Trim" TR_SOUND TR_HAPTIC "R\205cksetz.\0 " TR_VVARIO TR_PLAY_TRACK TR_PLAY_BOTH TR_PLAY_VALUE TR_SDCLOGS "Beleuchtung\0 " TR_CFN_ADJUST_GVAR TR_CFN_TEST
|
||||
#define TR_VFSWFUNC "Sicher\0 ""Lehrer \0 ""Inst. Trim" TR_SOUND TR_HAPTIC "R\205cksetz.\0" TR_VVARIO TR_PLAY_TRACK TR_PLAY_BOTH TR_PLAY_VALUE TR_SDCLOGS "LCD Licht\0" TR_CFN_ADJUST_GVAR TR_CFN_TEST
|
||||
#else
|
||||
#define TR_VFSWFUNC "Sicher\0 ""Lehrsch.\0 ""Instant. Trim" TR_SOUND TR_HAPTIC "R\205cksetz.\0 " TR_VVARIO TR_PLAY_TRACK TR_PLAY_BOTH TR_PLAY_VALUE "Beleuchtung\0 " TR_CFN_ADJUST_GVAR TR_CFN_TEST
|
||||
#define TR_VFSWFUNC "Sicher\0 ""Lehrer \0 ""Inst. Trim" TR_SOUND TR_HAPTIC "R\205cksetz.\0" TR_VVARIO TR_PLAY_TRACK TR_PLAY_BOTH TR_PLAY_VALUE "LCD Licht\0" TR_CFN_ADJUST_GVAR TR_CFN_TEST
|
||||
#endif
|
||||
|
||||
#define LEN_VFSWRESET "\006"
|
||||
#define LEN_VFSWRESET TR("\005", "\011")
|
||||
|
||||
#if defined(FRSKY)
|
||||
#define TR_FSW_RESET_TELEM "Telem."
|
||||
#define TR_FSW_RESET_TELEM TR("Telem", "Telemetry")
|
||||
#else
|
||||
#define TR_FSW_RESET_TELEM
|
||||
#define TR_FSW_RESET_TELEM
|
||||
#endif
|
||||
|
||||
#if ROTARY_ENCODERS > 0
|
||||
#define TR_FSW_RESET_ROTENC "R.Enc"
|
||||
#if ROTARY_ENCODERS == 2
|
||||
#define TR_FSW_RESET_ROTENC TR("REa\0 ""REb\0 ", "RotEnc A\0""RotEnc B\0")
|
||||
#elif ROTARY_ENCODERS == 1
|
||||
#define TR_FSW_RESET_ROTENC TR("R.Enc", "RotEnc\0 ")
|
||||
#else
|
||||
#define TR_FSW_RESET_ROTENC
|
||||
#endif
|
||||
|
||||
#define TR_VFSWRESET "S.Uhr1""S.Uhr2""Alle " TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC
|
||||
#define TR_VFSWRESET TR("Tmr1\0""Tmr2\0""Alle\0" TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC, "Timer 1 ""Timer 2 ""Alle Tmr." TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC)
|
||||
|
||||
#define LEN_FUNCSOUNDS "\006"
|
||||
#define TR_FUNCSOUNDS "Piep1\0""Piep2\0""Piep3\0""Warn1\0""Warn2\0""Cheep\0""Ring\0 ""SciFi\0""Robot\0""Chirp\0""Tada\0 ""Crickt""Siren\0""AlmClk""Ratata""Tick\0 "
|
||||
#define LEN_FUNCSOUNDS "\006"
|
||||
#define TR_FUNCSOUNDS "Piep1\0""Piep2\0""Piep3\0""Warn1\0""Warn2\0""Cheep\0""Ring\0 ""SciFi\0""Robot\0""Chirp\0""Tada\0 ""Crickt""Siren\0""AlmClk""Ratata""Tick\0 "
|
||||
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#define TR_VTELEMCHNS "---\0""Batt""Uhr1""Uhr2""Tx\0 ""Rx\0 ""A1\0 ""A2\0 ""H\203he""Umdr""Stof""T1\0 ""T2\0 ""Gesc""Dist""GH\203h""Zell""Zels""Vfas""Strm""Verb""Leis""BesX""BesY""BesZ""Rich""VGes""A1-\0""A2-\0""H\203h-""H\203h+""Umd+""T1+\0""T2+\0""Ges+""Dst+""Str+""Besc""Zeit"
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#define TR_VTELEMCHNS "---\0""Batt""Uhr1""Uhr2""Tx\0 ""Rx\0 ""A1\0 ""A2\0 ""H\203he""Umdr""Stof""T1\0 ""T2\0 ""Gesc""Dist""GH\203h""Zell""Zels""Vfas""Strm""Verb""Leis""BesX""BesY""BesZ""Rich""VGes""A1-\0""A2-\0""H\203h-""H\203h+""Umd+""T1+\0""T2+\0""Ges+""Dst+""Str+""Besc""Zeit"
|
||||
|
||||
#ifdef IMPERIAL_UNITS
|
||||
#define LENGTH_UNIT "ft\0"
|
||||
#define SPEED_UNIT "kts"
|
||||
#if defined(CPUARM)
|
||||
#define LEN_VTELEMUNIT_NORM "\003"
|
||||
#define TR_VTELEMUNIT_NORM "v\0 ""A\0 ""m/s""-\0 ""kmh""m\0 ""@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#define LEN_VTELEMUNIT_IMP "\003"
|
||||
#define TR_VTELEMUNIT_IMP "v\0 ""A\0 ""m/s""-\0 ""kts""ft\0""@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#else
|
||||
#define LENGTH_UNIT "m\0 "
|
||||
#define SPEED_UNIT "kmh"
|
||||
#if defined(IMPERIAL_UNITS)
|
||||
#define LENGTH_UNIT "ft\0"
|
||||
#define SPEED_UNIT "kts"
|
||||
#else
|
||||
#define LENGTH_UNIT "m\0 "
|
||||
#define SPEED_UNIT "kmh"
|
||||
#endif
|
||||
#define LEN_VTELEMUNIT "\003"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""m/s""-\0 " SPEED_UNIT LENGTH_UNIT "@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#endif
|
||||
|
||||
#define LEN_VTELEMUNIT "\003"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""m/s""-\0 " SPEED_UNIT LENGTH_UNIT "@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#define STR_V (STR_VTELEMUNIT+1)
|
||||
#define STR_A (STR_VTELEMUNIT+4)
|
||||
#define STR_V (STR_VTELEMUNIT+1)
|
||||
#define STR_A (STR_VTELEMUNIT+4)
|
||||
|
||||
#define LEN_VALARM "\003"
|
||||
#define TR_VALARM "---""Gel""Org""Rot"
|
||||
#define LEN_VALARM "\003"
|
||||
#define TR_VALARM "---""Gel""Org""Rot"
|
||||
|
||||
#define LEN_VALARMFN "\001"
|
||||
#define TR_VALARMFN "<>"
|
||||
#define LEN_VALARMFN "\001"
|
||||
#define TR_VALARMFN "<>"
|
||||
|
||||
#define LEN_VTELPROTO "\007"
|
||||
#define TR_VTELPROTO "Kein\0 ""Hub\0 ""WSHHigh""Halcyon"
|
||||
#define LEN_VTELPROTO "\007"
|
||||
#define TR_VTELPROTO "Kein\0 ""Hub\0 ""WSHHigh""Halcyon"
|
||||
|
||||
#define LEN_VOLTSRC "\003"
|
||||
#define TR_VOLTSRC "---""A1\0""A2\0""FAS""Cel"
|
||||
#define LEN_VOLTSRC "\003"
|
||||
#define TR_VOLTSRC "---""A1\0""A2\0""FAS""Cel"
|
||||
|
||||
#define LEN_VARIOSRC "\005"
|
||||
#define TR_VARIOSRC "Alti\0""Alti+""Vario""A1\0 ""A2\0"
|
||||
#define LEN_VARIOSRC "\005"
|
||||
#define TR_VARIOSRC "Alti\0""Alti+""Vario""A1\0 ""A2\0"
|
||||
|
||||
#define LEN_VSCREEN "\004"
|
||||
#define TR_VSCREEN "Wert""Str."
|
||||
#define LEN_VSCREEN "\004"
|
||||
#define TR_VSCREEN "Wert""Str."
|
||||
|
||||
#define LEN_GPSFORMAT "\004"
|
||||
#define TR_GPSFORMAT "HMS NMEA"
|
||||
#define LEN_GPSFORMAT "\004"
|
||||
#define TR_GPSFORMAT "HMS NMEA"
|
||||
|
||||
#define LEN2_VTEMPLATES 15
|
||||
#define LEN_VTEMPLATES "\017"
|
||||
#define TR_VTEMPLATES "Misch. L\203sch.\0 ""Einfach. 4-CH\0 ""Feste Gassp.\0 ""V-Stabilisator\0""Delta - Xmix\0 ""eCCPM\0 ""Hubschrauber\0 ""Servo Test\0 "
|
||||
#define LEN2_VTEMPLATES 13
|
||||
#define LEN_VTEMPLATES "\017"
|
||||
#define TR_VTEMPLATES "Misch. L\203sch.\0 ""Einfach. 4-CH\0 ""Fixe Gassperre\0""V-Stabilisator\0""Delta Mischer\0 ""eCCPM\0 ""Hubschrauber\0 ""Servo Tester\0 "
|
||||
|
||||
#define LEN_VSWASHTYPE "\004"
|
||||
#define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0"
|
||||
#define LEN_VSWASHTYPE "\004"
|
||||
#define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0"
|
||||
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS " Menu"" Exit""Unten"" Oben"" Re."" Li."
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS TR(" Menu"" Exit"" Down"" Up""Right"" Left", " Menu"" Exit""Enter"" Page"" Plus""Minus")
|
||||
|
||||
#define LEN_VRENCODERS "\003"
|
||||
#define TR_VRENCODERS "DGa""DGb"
|
||||
#define LEN_VRENCODERS "\003"
|
||||
#define TR_VRENCODERS "DGa""DGb" //Digitalgeber a und b = Drehgeber
|
||||
|
||||
#define LEN_VSWITCHES "\003"
|
||||
#define LEN_VSRCRAW "\004"
|
||||
#define LEN_VSWITCHES "\003"
|
||||
#define LEN_VSRCRAW "\004"
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""LS\0 ""RS\0 "
|
||||
#if defined(PCBX9D)
|
||||
#define TR_POTS_VSRCRAW "S1\0 ""S2\0 ""LS\0 ""RS\0 " //4 Potis S1,S2,Links,Rechts
|
||||
#define TR_SW_VSRCRAW "SA\0 ""SB\0 ""SC\0 ""SD\0 ""SE\0 ""SF\0 ""SG\0 ""SH\0 "
|
||||
#elif defined(EXTRA_3POS)
|
||||
#define TR_POTS_VSRCRAW "P1\0 ""P2\0 "
|
||||
@@ -275,7 +286,7 @@
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define TR_CUSTOMSW "PS1""PS2""PS3""PS4""PS5""PS6""PS7""PS8""PS9""PSA""PSB""PSC""PSD""PSE""PSF""PSG""PSH""PSI""PSJ""PSK""PSL""PSM""PSN""PSO""PSP""PSQ""PSR""PSS""PST""PSU""PSV""PSW"
|
||||
#define TR_CUSTOMSW "PS1""PS2""PS3""PS4""PS5""PS6""PS7""PS8""PS9""PSA""PSB""PSC""PSD""PSE""PSF""PSG""PSH""PSI""PSJ""PSK""PSL""PSM""PSN""PSO""PSP""PSQ""PSR""PSS""PST""PSU""PSV""PSW"
|
||||
#elif defined(PCBGRUVIN9X) || defined(CPUM128)
|
||||
#define TR_CUSTOMSW "PS1""PS2""PS3""PS4""PS5""PS6""PS7""PS8""PS9""PSA""PSB""PSC""PSD""PSE""PSF"
|
||||
#else
|
||||
@@ -299,234 +310,228 @@
|
||||
#endif
|
||||
|
||||
#if defined(HELI)
|
||||
#define TR_CYC_VSRCRAW "ZYK1""ZYK2""ZYK3"
|
||||
#define TR_CYC_VSRCRAW "ZYK1""ZYK2""ZYK3"
|
||||
#else
|
||||
#define TR_CYC_VSRCRAW "[C1]""[C2]""[C3]"
|
||||
#define TR_CYC_VSRCRAW "[C1]""[C2]""[C3]"
|
||||
#endif
|
||||
|
||||
#define TR_VSRCRAW "---\0""Sei\0""H\203h\0""Gas\0""Que\0" TR_POTS_VSRCRAW TR_ROTARY_ENCODERS_VSRCRAW "MAX\0" TR_CYC_VSRCRAW "TrmS" "TrmH" "TrmG" "TrmQ" TR_SW_VSRCRAW
|
||||
#define TR_VSRCRAW "---\0""Sei\0""H\203h\0""Gas\0""Que\0" TR_POTS_VSRCRAW TR_ROTARY_ENCODERS_VSRCRAW "MAX\0" TR_CYC_VSRCRAW "TrmS" "TrmH" "TrmG" "TrmQ" TR_SW_VSRCRAW
|
||||
|
||||
#define LEN_VTMRMODES "\003"
|
||||
#define TR_VTMRMODES "AUS""ABS""GSs""GS%""GSt"
|
||||
#define LEN_VTMRMODES "\003"
|
||||
#define TR_VTMRMODES "AUS""ABS""GSs""GS%""GSt"
|
||||
|
||||
// ZERO TERMINATED STRINGS
|
||||
#define INDENT "\001"
|
||||
#define LEN_INDENT 1
|
||||
#define INDENT_WIDTH (FW/2)
|
||||
#define INDENT "\001"
|
||||
#define LEN_INDENT 1
|
||||
#define INDENT_WIDTH (FW/2)
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#define TR_ENTER "[ENTER]"
|
||||
#if defined(PCBX9D)
|
||||
#define TR_ENTER "[ENTER]"
|
||||
#else
|
||||
#define TR_ENTER "[MENU]"
|
||||
#define TR_ENTER "[MENU]"
|
||||
#endif
|
||||
|
||||
#define TR_POPUPS TR_ENTER"\010[EXIT]"
|
||||
#define OFS_EXIT sizeof(TR_ENTER)
|
||||
#define TR_POPUPS TR_ENTER"\010[EXIT]"
|
||||
#define OFS_EXIT sizeof(TR_ENTER)
|
||||
|
||||
#define TR_MENUWHENDONE CENTER"\006"TR_ENTER" > Weiter"
|
||||
#define TR_FREE "frei"
|
||||
#define TR_DELETEMODEL "Modell l\203schen?"
|
||||
#define TR_COPYINGMODEL "Kopiere Modell"
|
||||
#define TR_MOVINGMODEL "Schiebe Modell"
|
||||
#define TR_LOADINGMODEL "Lade Modell..."
|
||||
#define TR_NAME "Name"
|
||||
#define TR_MODELNAME "Model Name"
|
||||
#define TR_PHASENAME "Phase Name"
|
||||
#define TR_MIXNAME "Mix Name"
|
||||
#define TR_EXPONAME "Expo Name"
|
||||
#define TR_BITMAP "Model Image"
|
||||
#define TR_TIMER "Stoppuhr"
|
||||
#define TR_ELIMITS "Erw.Limit"
|
||||
#define TR_ETRIMS "Erw.Trims"
|
||||
#define TR_TRIMINC "Trim Schr."
|
||||
#define TR_TTRACE "Gasquelle"
|
||||
#define TR_TTRIM "Gastrim"
|
||||
#define TR_BEEPCTR "Mitt.Piep"
|
||||
#define TR_PROTO INDENT"Proto."
|
||||
#define TR_PPMFRAME "PPM Einst."
|
||||
#define TR_MS "ms"
|
||||
#define TR_SWITCH "Schalter"
|
||||
#define TR_TRIMS "Trims"
|
||||
#define TR_FADEIN "Langs. Ein"
|
||||
#define TR_FADEOUT "Langs. Aus"
|
||||
#define TR_DEFAULT "(Normal)"
|
||||
#define TR_CHECKTRIMS "\006Trims\012Pr\205fen"
|
||||
#define OFS_CHECKTRIMS (9*FW)
|
||||
#define TR_SWASHTYPE "Taumelsch."
|
||||
#define TR_COLLECTIVE "Kollektiv Pit"
|
||||
#define TR_SWASHRING "Zykl. Begrenz."
|
||||
#define TR_ELEDIRECTION "Nick Richtung"
|
||||
#define TR_AILDIRECTION "Roll Richtung"
|
||||
#define TR_COLDIRECTION "Pit. Richtung"
|
||||
#define TR_MODE INDENT"Modus"
|
||||
#define TR_NOFREEEXPO "Expos voll!"
|
||||
#define TR_NOFREEMIXER "Mischer voll!"
|
||||
#define TR_INSERTMIX "MISCHER HINZ."
|
||||
#define TR_EDITMIX "MISCHER"
|
||||
#define TR_SOURCE INDENT"Quelle"
|
||||
#define TR_WEIGHT "Gewicht"
|
||||
#define TR_EXPO "Expo"
|
||||
#define TR_SIDE "Seite"
|
||||
#define TR_DIFFERENTIAL "Differz."
|
||||
#define TR_OFFSET INDENT"Ausgl."
|
||||
#define TR_TRIM "Trim"
|
||||
#define TR_DREX "DRex"
|
||||
#define TR_CURVE "Kurve"
|
||||
#define TR_FPHASE "Phase"
|
||||
#define TR_MIXWARNING "Warnung"
|
||||
#define TR_OFF "AUS"
|
||||
#define TR_MULTPX "Wirkung"
|
||||
#define TR_DELAYDOWN "Verz. Unten"
|
||||
#define TR_DELAYUP "Verz. Oben"
|
||||
#define TR_SLOWDOWN "Langs.Unten"
|
||||
#define TR_SLOWUP "Langs.Oben"
|
||||
#define TR_MIXER "MISCHER"
|
||||
#define TR_CV "KV"
|
||||
#define TR_GV "GV"
|
||||
#define TR_ACHANNEL "A"
|
||||
#define TR_RANGE INDENT"Skala"
|
||||
#define TR_BAR "Streifen"
|
||||
#define TR_ALARM INDENT"Alarm"
|
||||
#define TR_USRDATA "Daten"
|
||||
#define TR_BLADES INDENT"Bl\201tter"
|
||||
#define TR_SCREEN "Schirm"
|
||||
#define TR_SOUND_LABEL "Ton"
|
||||
#define TR_LENGTH INDENT"Dauer"
|
||||
#define TR_SPKRPITCH INDENT"Tonh\203he"
|
||||
#define TR_HAPTIC_LABEL "Vibration"
|
||||
#define TR_HAPTICSTRENGTH INDENT"St\201rke"
|
||||
#define TR_CONTRAST "Kontrast"
|
||||
#define TR_ALARMS_LABEL "Alarm wenn"
|
||||
#define TR_BATTERY_RANGE "Akku V-Bereich"
|
||||
#define TR_BATTERYWARNING INDENT"Akku leer"
|
||||
#define TR_INACTIVITYALARM INDENT"Inaktivit\201t"
|
||||
#define TR_MEMORYWARNING INDENT"Speicher voll"
|
||||
#define TR_ALARMWARNING INDENT"Ton aus"
|
||||
#define TR_RENAVIG "Drehgeb. Navig."
|
||||
#define TR_THROTTLEREVERSE "Gasumkehrung"
|
||||
#define TR_MINUTEBEEP INDENT"Minuten"
|
||||
#define TR_BEEPCOUNTDOWN INDENT"Countdown"
|
||||
#define TR_PERSISTENT INDENT"Persist."
|
||||
#define TR_BACKLIGHT_LABEL "Beleuchtung"
|
||||
#define TR_BLDELAY INDENT"Dauer"
|
||||
#define TR_BLONBRIGHTNESS INDENT"An Helligkeit"
|
||||
#define TR_BLOFFBRIGHTNESS INDENT"Aus Helligkeit"
|
||||
#define TR_SPLASHSCREEN "Startbild"
|
||||
#define TR_THROTTLEWARNING "Gasalarm"
|
||||
#define TR_SWITCHWARNING "Sch.Alarm"
|
||||
#define TR_TIMEZONE "Zeitzone"
|
||||
#define TR_RXCHANNELORD "Kanalanordnung"
|
||||
#define TR_SLAVE "Sch\205ler"
|
||||
#define TR_MODESRC " Modus\002% Quelle"
|
||||
#define TR_MULTIPLIER "Multiplikator"
|
||||
#define TR_CAL "Kal."
|
||||
#define TR_VTRIM "Trim- +"
|
||||
#define TR_BG "BG:"
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#define TR_MENUTOSTART CENTER"\006[ENTER] > Starten"
|
||||
#else
|
||||
#define TR_MENUTOSTART CENTER"\006[MENU] > Starten"
|
||||
#endif
|
||||
|
||||
#define TR_SETMIDPOINT CENTER"\006NEUTRALSTELLUNG"
|
||||
#define TR_MOVESTICKSPOTS CENTER"\004KNPL/POTIS BEWEGEN"
|
||||
#define TR_RXBATT "Rx Batt:"
|
||||
#define TR_TXnRX "Tx:\0Rx:"
|
||||
#define OFS_RX 4
|
||||
#define TR_ACCEL "Acc:"
|
||||
#define TR_NODATA "NO DATA"
|
||||
#define TR_TM1TM2 "TM1\032TM2"
|
||||
#define TR_THRTHP "THR\032TH%"
|
||||
#define TR_TOT "TOT"
|
||||
#define TR_TMR1LATMAXUS "Tmr1Lat max\006us"
|
||||
#define TR_MENUWHENDONE CENTER"\006"TR_ENTER" > Weiter"
|
||||
#define TR_FREE "frei"
|
||||
#define TR_DELETEMODEL "Modell l\203schen?"
|
||||
#define TR_COPYINGMODEL "Kopiere Modell"
|
||||
#define TR_MOVINGMODEL "Schiebe Modell"
|
||||
#define TR_LOADINGMODEL "Lade Modell..."
|
||||
#define TR_NAME "Name"
|
||||
#define TR_MODELNAME "Modell Name"
|
||||
#define TR_PHASENAME "Phase Name"
|
||||
#define TR_MIXNAME "Mix Name"
|
||||
#define TR_EXPONAME "Expo Name"
|
||||
#define TR_BITMAP "Modell Bild"
|
||||
#define TR_TIMER TR("Stoppuhr","Stoppuhr ")
|
||||
#define TR_ELIMITS TR("Erw.Limit","Erweit. Limits")
|
||||
#define TR_ETRIMS TR("Erw.Trims","Erweit. Trimmung")
|
||||
#define TR_TRIMINC TR("Trim Schr.","Trimm Schritte")
|
||||
#define TR_TTRACE TR("Gasquelle","Gas Quelle")
|
||||
#define TR_TTRIM TR("Gastrim","Gas Trimmung")
|
||||
#define TR_BEEPCTR TR("Mitt.Piep","Mittelst. Pieps")
|
||||
#define TR_PROTO TR(INDENT"Proto.",INDENT"Protokoll")
|
||||
#define TR_PPMFRAME "PPM Einst."
|
||||
#define TR_MS "ms"
|
||||
#define TR_SWITCH TR("Schalt.","Schalter")
|
||||
#define TR_TRIMS "Trims"
|
||||
#define TR_FADEIN "Langs. Ein"
|
||||
#define TR_FADEOUT "Langs. Aus"
|
||||
#define TR_DEFAULT "(Normal)"
|
||||
#define TR_CHECKTRIMS "\006Trims\012Pr\205fen"
|
||||
#define OFS_CHECKTRIMS (9*FW)
|
||||
#define TR_SWASHTYPE TR("Typ Taumelsch","Typ Taumelscheibe")
|
||||
#define TR_COLLECTIVE TR("Kollektiv Pit","Kollektives Pitch")
|
||||
#define TR_SWASHRING TR("Zykl. Begrenz","Zyklische Begrenzung")
|
||||
#define TR_ELEDIRECTION TR("Nick Richtung"," Nick Servo Richtung")
|
||||
#define TR_AILDIRECTION TR("Roll Richtung"," Roll Servo Richtung")
|
||||
#define TR_COLDIRECTION TR("Pit. Richtung","Pitch Servo Richtung")
|
||||
#define TR_MODE INDENT"Modus"
|
||||
#define TR_NOFREEEXPO "Expos voll!"
|
||||
#define TR_NOFREEMIXER "Mischer voll!"
|
||||
#define TR_INSERTMIX "MISCHER HINZ."
|
||||
#define TR_EDITMIX "MISCHER Edit"
|
||||
#define TR_SOURCE INDENT"Quelle"
|
||||
#define TR_WEIGHT "Gewicht"
|
||||
#define TR_EXPO TR("Expo","Exponential")
|
||||
#define TR_SIDE "Seite"
|
||||
#define TR_DIFFERENTIAL "Diff"
|
||||
#define TR_OFFSET INDENT"Offset"
|
||||
#define TR_TRIM "Trim"
|
||||
#define TR_DREX "DRex"
|
||||
#define TR_CURVE "Kurve"
|
||||
#define TR_FPHASE TR("Phase","Phasen")
|
||||
#define TR_MIXWARNING "Warnung"
|
||||
#define TR_OFF "AUS"
|
||||
#define TR_MULTPX "Wirkung"
|
||||
#define TR_DELAYDOWN "Verz. Dn"
|
||||
#define TR_DELAYUP "Verz. Up"
|
||||
#define TR_SLOWDOWN "Langs.Dn"
|
||||
#define TR_SLOWUP "Langs.Up"
|
||||
#define TR_MIXER "MISCHER"
|
||||
#define TR_CV "KV"
|
||||
#define TR_GV "GV"
|
||||
#define TR_ACHANNEL "A\004Kanal "
|
||||
#define TR_RANGE INDENT"Skala"
|
||||
#define TR_BAR "Streifen"
|
||||
#define TR_ALARM INDENT"Alarm"
|
||||
#define TR_USRDATA "Daten"
|
||||
#define TR_BLADES INDENT"Bl\201tter"
|
||||
#define TR_SCREEN "Bild "
|
||||
#define TR_SOUND_LABEL "Ton"
|
||||
#define TR_LENGTH INDENT"Dauer"
|
||||
#define TR_SPKRPITCH INDENT"Tonh\203he"
|
||||
#define TR_HAPTIC_LABEL "Vibration"
|
||||
#define TR_HAPTICSTRENGTH INDENT"St\201rke"
|
||||
#define TR_CONTRAST "Kontrast"
|
||||
#define TR_ALARMS_LABEL "Alarm wenn"
|
||||
#define TR_BATTERY_RANGE "Akku Spannung V"
|
||||
#define TR_BATTERYWARNING INDENT"Akku leer kl."
|
||||
#define TR_INACTIVITYALARM INDENT"Inaktivit\201t "
|
||||
#define TR_MEMORYWARNING INDENT"Speicher voll"
|
||||
#define TR_ALARMWARNING INDENT"Ton aus"
|
||||
#define TR_RENAVIG "Drehgeb. Navig."
|
||||
#define TR_THROTTLEREVERSE TR("Vollgas hinten?", "Vollgas hinten?")
|
||||
#define TR_MINUTEBEEP TR(INDENT"Minute",INDENT"Jede Minute")
|
||||
#define TR_BEEPCOUNTDOWN INDENT"Countdown"
|
||||
#define TR_PERSISTENT TR(INDENT"Dauernd",INDENT"Dauernd ein")
|
||||
#define TR_BACKLIGHT_LABEL "LCD Licht an"
|
||||
#define TR_BLDELAY INDENT"Dauer"
|
||||
#define TR_BLONBRIGHTNESS INDENT"An Helligkeit"
|
||||
#define TR_BLOFFBRIGHTNESS INDENT"Aus Helligkeit"
|
||||
#define TR_SPLASHSCREEN "Startbild"
|
||||
#define TR_THROTTLEWARNING "Gas Alarm"
|
||||
#define TR_SWITCHWARNING TR("Sch. Alarm","Schalter Alarm")
|
||||
#define TR_TIMEZONE TR("Zeitzone","GPS Zeit Zone")
|
||||
#define TR_RXCHANNELORD TR("Kanalanordnung","Kanalvoreinstellung")
|
||||
#define TR_SLAVE "Sch\205ler"
|
||||
#define TR_MODESRC " Modus\002% Quelle"
|
||||
#define TR_MULTIPLIER "Multiplikator"
|
||||
#define TR_CAL "Kal."
|
||||
#define TR_VTRIM "Trim- +"
|
||||
#define TR_BG "BG:"
|
||||
#define TR_MENUTOSTART CENTER"\006"TR_ENTER" zum Start"
|
||||
#define TR_SETMIDPOINT CENTER"Sticks+Potis auf Mitte"
|
||||
#define TR_MOVESTICKSPOTS CENTER"Sticks+Potis bewegen"
|
||||
#define TR_RXBATT "Rx Batt:"
|
||||
#define TR_TXnRX "Tx:\0Rx:"
|
||||
#define OFS_RX 4
|
||||
#define TR_ACCEL "Acc:"
|
||||
#define TR_NODATA CENTER"NO DATA"
|
||||
#define TR_TM1TM2 "TM1\032TM2"
|
||||
#define TR_THRTHP "THR\032TH%"
|
||||
#define TR_TOT "TOT"
|
||||
#define TR_TMR1LATMAXUS "Tmr1Lat max\006us"
|
||||
#define STR_US (STR_TMR1LATMAXUS+12)
|
||||
#define TR_TMR1LATMINUS "Tmr1Lat min\006us"
|
||||
#define TR_TMR1JITTERUS "Tmr1 Jitter\006us"
|
||||
#define TR_TMR1LATMINUS "Tmr1Lat min\006us"
|
||||
#define TR_TMR1JITTERUS "Tmr1 Jitter\006us"
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define TR_TMIXMAXMS "Tmix max\012ms"
|
||||
#define TR_TMIXMAXMS "Tmix max\012ms"
|
||||
#else
|
||||
#define TR_TMIXMAXMS "Tmix max\014ms"
|
||||
#define TR_TMIXMAXMS "Tmix max\014ms"
|
||||
#endif
|
||||
|
||||
#define TR_T10MSUS "T10ms\016us"
|
||||
#define TR_FREESTACKMINB "Free Stack\010b"
|
||||
#define TR_MENUTORESET "[MENU] f\205r Reset"
|
||||
#define TR_PPM "PPM"
|
||||
#define TR_CH "CH"
|
||||
#define TR_MODEL "MODELL"
|
||||
#define TR_FP "FP"
|
||||
#define TR_MIX "MIX"
|
||||
#define TR_EEPROMLOWMEM "EEPROM voll"
|
||||
#define TR_ALERT "WARNUNG"
|
||||
#define TR_PRESSANYKEYTOSKIP "Taste dr\205cken"
|
||||
#define TR_THROTTLENOTIDLE "Gas nicht Null!"
|
||||
#define TR_ALARMSDISABLED "Alarme ausgeschaltet"
|
||||
#define TR_PRESSANYKEY "Taste dr\205cken"
|
||||
#define TR_BADEEPROMDATA "EEPROM ung\205ltig"
|
||||
#define TR_EEPROMFORMATTING "EEPROM Initialisieren"
|
||||
#define TR_EEPROMOVERFLOW "EEPROM \204berlauf"
|
||||
#define TR_MENURADIOSETUP "SYSTEMEINST."
|
||||
#define TR_MENUDATEANDTIME "DATUM UND ZEIT"
|
||||
#define TR_MENUTRAINER "LEHR/SCH\204L."
|
||||
#define TR_MENUVERSION "VERSION"
|
||||
#define TR_MENUDIAG "SCHALT."
|
||||
#define TR_MENUANA "ANALOG TEST"
|
||||
#define TR_MENUCALIBRATION "KALIBRIERUNG"
|
||||
#define TR_TRIMS2OFFSETS "\006Trims => Ausgl."
|
||||
#define TR_MENUMODELSEL "MODELLE"
|
||||
#define TR_MENUSETUP "KONF."
|
||||
#define TR_MENUFLIGHTPHASE "FLUGPHASE"
|
||||
#define TR_MENUFLIGHTPHASES "FLUGPHASEN"
|
||||
#define TR_MENUHELISETUP "HUBSCHRAUBER"
|
||||
#define TR_T10MSUS "T10ms\016us"
|
||||
#define TR_FREESTACKMINB "Free Stack\010b"
|
||||
#define TR_MENUTORESET CENTER TR_ENTER" f\205r Reset"
|
||||
#define TR_PPM "PPM"
|
||||
#define TR_CH "CH"
|
||||
#define TR_MODEL "MODELL"
|
||||
#define TR_FP "FP"
|
||||
#define TR_MIX "MIX"
|
||||
#define TR_EEPROMLOWMEM "EEPROM voll"
|
||||
#define TR_ALERT "WARNUNG"
|
||||
#define TR_PRESSANYKEYTOSKIP "Taste dr\205cken"
|
||||
#define TR_THROTTLENOTIDLE "Gas nicht Null!"
|
||||
#define TR_ALARMSDISABLED "Alarme ausgeschaltet"
|
||||
#define TR_PRESSANYKEY TR("Taste dr\205cken",CENTER"Taste dr\205cken")
|
||||
#define TR_BADEEPROMDATA "EEPROM ung\205ltig"
|
||||
#define TR_EEPROMFORMATTING "EEPROM Initialisieren"
|
||||
#define TR_EEPROMOVERFLOW "EEPROM \204berlauf"
|
||||
#define TR_MENURADIOSETUP TR("SENDER EINST.","SENDER GRUNGEINSTELLUNGEN")
|
||||
#define TR_MENUDATEANDTIME "DATUM UND ZEIT"
|
||||
#define TR_MENUTRAINER TR("Lehr./Sch\204l.","LEHRER/SCH\204LER")
|
||||
#define TR_MENUVERSION "VERSION"
|
||||
#define TR_MENUDIAG TR("Schalt.","Schalter Test")
|
||||
#define TR_MENUANA "Analog Test"
|
||||
#define TR_MENUCALIBRATION TR("KALIB. ANALOG","KALIBRIERUNG STICKS+POTIS")
|
||||
#define TR_TRIMS2OFFSETS "\006Trims => Offset"
|
||||
#define TR_MENUMODELSEL TR("MODELLE","MODELL W\201HLEN")
|
||||
#define TR_MENUSETUP TR("KONF.","MODELL EINSTELLUNGEN")
|
||||
#define TR_MENUFLIGHTPHASE "FLUGPHASE"
|
||||
#define TR_MENUFLIGHTPHASES "FLUGPHASEN"
|
||||
#define TR_MENUHELISETUP "HUBSCHRAUBER"
|
||||
|
||||
#if defined(PPM_CENTER_ADJUSTABLE) || defined(PPM_LIMITS_SYMETRICAL) // The right menu titles for the gurus ...
|
||||
#define TR_MENUDREXPO "KN\204PPEL"
|
||||
#define TR_MENULIMITS "AUSG\200NGE"
|
||||
#define TR_MENUDREXPO "KN\204PPEL"
|
||||
#define TR_MENULIMITS "AUSG\200NGE"
|
||||
#else
|
||||
#define TR_MENUDREXPO "DR/EXPO"
|
||||
#define TR_MENULIMITS "GRENZEN"
|
||||
#define TR_MENUDREXPO TR("DR/EXPO","DUALRATE/EXPO")
|
||||
#define TR_MENULIMITS TR("GRENZEN","SERVO WEG")
|
||||
#endif
|
||||
|
||||
#define TR_MENUCURVES "KURVEN"
|
||||
#define TR_MENUCURVE "KURVE"
|
||||
#define TR_MENUCUSTOMSWITCH "PROG.SCHALTER"
|
||||
#define TR_MENUCUSTOMSWITCHES TR_MENUCUSTOMSWITCH
|
||||
#define TR_MENUCUSTOMFUNC "SPEZ. FUNKTIONEN"
|
||||
#define TR_MENUTELEMETRY "TELEMETRIE"
|
||||
#define TR_MENUTEMPLATES "VORLAGEN"
|
||||
#define TR_MENUSTAT "STAT"
|
||||
#define TR_MENUDEBUG "DEBUG"
|
||||
#define TR_RXNUM "RxNum"
|
||||
#define TR_SYNCMENU "Sync [MENU]"
|
||||
#define TR_LIMIT INDENT"Limite"
|
||||
#define TR_MINRSSI "Min. RSSI"
|
||||
#define TR_LATITUDE "Breite:"
|
||||
#define TR_LONGITUDE "L\201nge:"
|
||||
#define TR_GPSCOORD "Gps Koord."
|
||||
#define TR_VARIO "Vario"
|
||||
#define TR_SHUTDOWN "Herunterfahren"
|
||||
#define TR_BATT_CALIB "Akku. Kalib."
|
||||
#define TR_CURRENT_CALIB "Stromkalib."
|
||||
#define TR_VOLTAGE INDENT"Spann."
|
||||
#define TR_CURRENT INDENT"Strom"
|
||||
#define TR_SELECT_MODEL "Modell W\201hlen"
|
||||
#define TR_CREATE_MODEL "Neues Modell"
|
||||
#define TR_COPY_MODEL "Copy Model"
|
||||
#define TR_MOVE_MODEL "Move Model"
|
||||
#define TR_BACKUP_MODEL "Modell Backup"
|
||||
#define TR_DELETE_MODEL "Modell L\203schen" // TODO merged into DELETEMODEL?
|
||||
#define TR_RESTORE_MODEL "Modell Restore"
|
||||
#define TR_SDCARD_ERROR "SDcard Fehler"
|
||||
#define TR_NO_SDCARD "Keine SDcard"
|
||||
#define TR_INCOMPATIBLE "Nicht kompatibel"
|
||||
#define TR_WARNING "WARNUNG"
|
||||
#define TR_EEPROMWARN "EEPROM"
|
||||
#define TR_THROTTLEWARN "GAS"
|
||||
#define TR_ALARMSWARN "ALARM"
|
||||
#define TR_SWITCHWARN "SCHALTER"
|
||||
#define TR_INVERT_THR "Gas umkehren?"
|
||||
#define TR_MENUCURVES "KURVEN"
|
||||
#define TR_MENUCURVE "KURVE"
|
||||
#define TR_MENUCUSTOMSWITCH "PROG.SCHALTER"
|
||||
#define TR_MENUCUSTOMSWITCHES TR_MENUCUSTOMSWITCH
|
||||
#define TR_MENUCUSTOMFUNC "SPEZ. FUNKTIONEN"
|
||||
#define TR_MENUTELEMETRY "TELEMETRIE"
|
||||
#define TR_MENUTEMPLATES "VORLAGEN"
|
||||
#define TR_MENUSTAT "STAT"
|
||||
#define TR_MENUDEBUG "DEBUG"
|
||||
#define TR_RXNUM TR("Rx Nummer",INDENT"Empf\201nger Nr.")
|
||||
#define TR_SYNCMENU "Sync [MENU]"
|
||||
#define TR_LIMIT INDENT"Limite"
|
||||
#define TR_MINRSSI "Min. RSSI"
|
||||
#define TR_LATITUDE "Breite:"
|
||||
#define TR_LONGITUDE "L\201nge:"
|
||||
#define TR_GPSCOORD TR("Gps Koord.","GPS Koordinaten Format")
|
||||
#define TR_VARIO TR("Vario","Variometer")
|
||||
#define TR_SHUTDOWN "Herunterfahren"
|
||||
#define TR_BATT_CALIB "Akku. Kalib."
|
||||
#define TR_CURRENT_CALIB "Stromkalib."
|
||||
#define TR_VOLTAGE INDENT"Spann."
|
||||
#define TR_CURRENT INDENT"Strom"
|
||||
#define TR_SELECT_MODEL "Modell W\201hlen"
|
||||
#define TR_CREATE_MODEL "Neues Modell"
|
||||
#define TR_COPY_MODEL "Kopiere Modell"
|
||||
#define TR_MOVE_MODEL "Verschiebe Modell"
|
||||
#define TR_BACKUP_MODEL "Modell Backup"
|
||||
#define TR_DELETE_MODEL "Modell L\203schen" // TODO merged into DELETEMODEL?
|
||||
#define TR_RESTORE_MODEL "Modell Restore"
|
||||
#define TR_SDCARD_ERROR "SDcard Fehler"
|
||||
#define TR_NO_SDCARD "Keine SDcard"
|
||||
#define TR_INCOMPATIBLE "Nicht kompatibel"
|
||||
#define TR_WARNING "WARNUNG"
|
||||
#define TR_EEPROMWARN "EEPROM"
|
||||
#define TR_THROTTLEWARN "GAS"
|
||||
#define TR_ALARMSWARN "ALARM"
|
||||
#define TR_SWITCHWARN "SCHALTER"
|
||||
#define TR_INVERT_THR TR("Gas umkehren?","Vollgas hinten?")
|
||||
#define TR_SPEAKER_VOLUME INDENT"Lautst\201rke"
|
||||
#define TR_LCD "Bildschirm"
|
||||
#define TR_BRIGHTNESS "Helligkeit"
|
||||
@@ -536,7 +541,7 @@
|
||||
#define TR_COPROC "CoProz."
|
||||
#define TR_COPROC_TEMP "MB Temp. \016>"
|
||||
#define TR_CAPAWARNING INDENT "Kapaz. niedrig"
|
||||
#define TR_TEMPWARNING INDENT "Hohe Temp."
|
||||
#define TR_TEMPWARNING INDENT "Temperatur gr\203er"
|
||||
#define TR_FUNC "Funktion"
|
||||
#define TR_V1 "V1"
|
||||
#define TR_V2 "V2"
|
||||
@@ -546,7 +551,7 @@
|
||||
#define TR_SDHC_CARD "SD-HC Karte"
|
||||
#define TR_NO_SOUNDS_ON_SD "Keine T\203ne auf SD"
|
||||
#define TR_NO_MODELS_ON_SD "Keine Modelle auf SD"
|
||||
#define TR_NO_BITMAPS_ON_SD "No Bitmaps on SD"
|
||||
#define TR_NO_BITMAPS_ON_SD "Keine Bitmaps auf SD"
|
||||
#define TR_PLAY_FILE "Spielen"
|
||||
#define TR_DELETE_FILE "L\203schen"
|
||||
#define TR_COPY_FILE "Kopieren"
|
||||
@@ -554,11 +559,11 @@
|
||||
#define TR_REMOVED " gel\203scht"
|
||||
#define TR_SD_INFO "Information"
|
||||
#define TR_SD_FORMAT "Formattieren"
|
||||
#define TR_NA "N/V"
|
||||
#define TR_NA "N/V" //Kurz-Meldung: NV=Nicht Verfügbar
|
||||
#define TR_HARDWARE "Hardware"
|
||||
#define TR_FORMATTING "Formattierung..."
|
||||
#define TR_TEMP_CALIB "Temp. Kalib."
|
||||
#define TR_TIME "Zeit"
|
||||
#define TR_TIME "Uhrzeit:"
|
||||
#define TR_BAUDRATE "Baudrate"
|
||||
#define TR_SD_INFO_TITLE "SD INFO"
|
||||
#define TR_SD_TYPE "Typ:"
|
||||
@@ -568,11 +573,12 @@
|
||||
#define TR_CURVE_TYPE "Typ"
|
||||
#define TR_GLOBAL_VARS "Globale Variablen"
|
||||
#define TR_OWN "Eigen"
|
||||
#define TR_DATE "Datum"
|
||||
#define TR_DATE "Datum:"
|
||||
#define TR_ROTARY_ENCODER "Drehgeber"
|
||||
#define TR_CHANNELS_MONITOR "Kanal Monitor"
|
||||
#define TR_INTERNALRF "Internal RF"
|
||||
#define TR_EXTERNALRF "External RF"
|
||||
#define TR_FAILSAFE "Failsafe mode"
|
||||
#define TR_FAILSAFESET "FAILSAFE SETTINGS"
|
||||
#define TR_COUNTRYCODE "Country Code"
|
||||
#define TR_INTERNALRF "Internes HF Modul"
|
||||
#define TR_EXTERNALRF "Externes HF Modul"
|
||||
#define TR_FAILSAFE "Failsafe Mode"
|
||||
#define TR_FAILSAFESET "Failsafe Einst."
|
||||
#define TR_COUNTRYCODE "L\201nder Code"
|
||||
|
||||
|
||||
+49
-38
@@ -127,7 +127,7 @@
|
||||
#define TR_VCURVEFUNC "---""x>0""x<0""|x|""f>0""f<0""|f|"
|
||||
|
||||
#define LEN_VMLTPX "\010"
|
||||
#define TR_VMLTPX "Add ""Multiply""Replace "
|
||||
#define TR_VMLTPX "Add\0 ""Multiply""Replace\0"
|
||||
|
||||
#define LEN_VMLTPX2 "\002"
|
||||
#define TR_VMLTPX2 "+=""*="":="
|
||||
@@ -152,7 +152,9 @@
|
||||
#define TR_SOUND "Beep\0 "
|
||||
#endif
|
||||
|
||||
#if defined(HAPTIC)
|
||||
#if defined(PCBTARANIS)
|
||||
#define TR_HAPTIC
|
||||
#elif defined(HAPTIC)
|
||||
#define TR_HAPTIC "Haptic\0 "
|
||||
#else
|
||||
#define TR_HAPTIC "[Haptic]\0 "
|
||||
@@ -209,8 +211,10 @@
|
||||
#define TR_FSW_RESET_TELEM
|
||||
#endif
|
||||
|
||||
#if ROTARY_ENCODERS > 0
|
||||
#define TR_FSW_RESET_ROTENC TR("R.Enc", "RotEnc ")
|
||||
#if ROTARY_ENCODERS == 2
|
||||
#define TR_FSW_RESET_ROTENC TR("REa\0 ""REb\0 ", "RotEnc A\0""RotEnc B\0")
|
||||
#elif ROTARY_ENCODERS == 1
|
||||
#define TR_FSW_RESET_ROTENC TR("R.Enc", "RotEnc\0 ")
|
||||
#else
|
||||
#define TR_FSW_RESET_ROTENC
|
||||
#endif
|
||||
@@ -223,16 +227,23 @@
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2""Tx\0 ""Rx\0 ""A1\0 ""A2\0 ""Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+""Cur+""Acc\0""Time"
|
||||
|
||||
#ifdef IMPERIAL_UNITS
|
||||
#define LENGTH_UNIT "ft\0"
|
||||
#define SPEED_UNIT "kts"
|
||||
#if defined(CPUARM)
|
||||
#define LEN_VTELEMUNIT_NORM "\003"
|
||||
#define TR_VTELEMUNIT_NORM "v\0 ""A\0 ""m/s""-\0 ""kmh""m\0 ""@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#define LEN_VTELEMUNIT_IMP "\003"
|
||||
#define TR_VTELEMUNIT_IMP "v\0 ""A\0 ""m/s""-\0 ""kts""ft\0""@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#else
|
||||
#define LENGTH_UNIT "m\0 "
|
||||
#define SPEED_UNIT "kmh"
|
||||
#if defined(IMPERIAL_UNITS)
|
||||
#define LENGTH_UNIT "ft\0"
|
||||
#define SPEED_UNIT "kts"
|
||||
#else
|
||||
#define LENGTH_UNIT "m\0 "
|
||||
#define SPEED_UNIT "kmh"
|
||||
#endif
|
||||
#define LEN_VTELEMUNIT "\003"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""m/s""-\0 " SPEED_UNIT LENGTH_UNIT "@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#endif
|
||||
|
||||
#define LEN_VTELEMUNIT "\003"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""m/s""-\0 " SPEED_UNIT LENGTH_UNIT "@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#define STR_V (STR_VTELEMUNIT+1)
|
||||
#define STR_A (STR_VTELEMUNIT+4)
|
||||
|
||||
@@ -262,10 +273,10 @@
|
||||
#define TR_VTEMPLATES "Clear Mixes\0\0""Simple 4-CH \0""Sticky-T-Cut\0""V-Tail \0""Elevon\\Delta\0""eCCPM \0""Heli Setup \0""Servo Test \0"
|
||||
|
||||
#define LEN_VSWASHTYPE "\004"
|
||||
#define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0"
|
||||
#define TR_VSWASHTYPE "---\0""120\0""120X""140\0""90\0"
|
||||
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS " Menu"" Exit"" Down"" Up""Right"" Left"
|
||||
#define TR_VKEYS TR(" Menu"" Exit"" Down"" Up""Right"" Left", " Menu"" Exit""Enter"" Page"" Plus""Minus")
|
||||
|
||||
#define LEN_VRENCODERS "\003"
|
||||
#define TR_VRENCODERS "REa""REb"
|
||||
@@ -295,9 +306,9 @@
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#define TR_VSWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_CUSTOMSW " ON"
|
||||
#define TR_VSWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_CUSTOMSW "One"
|
||||
#else
|
||||
#define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_CUSTOMSW " ON"
|
||||
#define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_CUSTOMSW "One"
|
||||
#endif
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
@@ -332,10 +343,10 @@
|
||||
#define TR_ENTER "[MENU]"
|
||||
#endif
|
||||
|
||||
#define TR_POPUPS TR_ENTER"\010[EXIT]"
|
||||
#define TR_POPUPS TR_ENTER "\010[EXIT]"
|
||||
#define OFS_EXIT sizeof(TR_ENTER)
|
||||
|
||||
#define TR_MENUWHENDONE CENTER"\006"TR_ENTER" WHEN DONE"
|
||||
#define TR_MENUWHENDONE CENTER "\006" TR_ENTER " WHEN DONE"
|
||||
#define TR_FREE "free"
|
||||
#define TR_DELETEMODEL "DELETE MODEL"
|
||||
#define TR_COPYINGMODEL "Copying model..."
|
||||
@@ -343,7 +354,7 @@
|
||||
#define TR_LOADINGMODEL "Loading model..."
|
||||
#define TR_NAME "Name"
|
||||
#define TR_MODELNAME "Model Name"
|
||||
#define TR_PHASENAME "Phase Name"
|
||||
#define TR_PHASENAME "Mode Name"
|
||||
#define TR_MIXNAME "Mix Name"
|
||||
#define TR_EXPONAME "Expo Name"
|
||||
#define TR_BITMAP "Model Image"
|
||||
@@ -362,7 +373,7 @@
|
||||
#define TR_FADEIN "Fade In"
|
||||
#define TR_FADEOUT "Fade Out"
|
||||
#define TR_DEFAULT "(default)"
|
||||
#define TR_CHECKTRIMS CENTER"\006Check\012Trims"
|
||||
#define TR_CHECKTRIMS CENTER "\006Check\012Trims"
|
||||
#define OFS_CHECKTRIMS CENTER_OFS+(9*FW)
|
||||
#define TR_SWASHTYPE "Swash Type"
|
||||
#define TR_COLLECTIVE TR("Collective","Collective source")
|
||||
@@ -384,7 +395,7 @@
|
||||
#define TR_TRIM "Trim"
|
||||
#define TR_DREX "DRex"
|
||||
#define TR_CURVE "Curve"
|
||||
#define TR_FPHASE TR("Phase","Phases")
|
||||
#define TR_FPHASE TR("Mode","Modes")
|
||||
#define TR_MIXWARNING "Warning"
|
||||
#define TR_OFF "OFF"
|
||||
#define TR_MULTPX "Multpx"
|
||||
@@ -409,14 +420,14 @@
|
||||
#define TR_HAPTICSTRENGTH INDENT"Strength"
|
||||
#define TR_CONTRAST "Contrast"
|
||||
#define TR_ALARMS_LABEL "Alarms"
|
||||
#define TR_BATTERY_RANGE "Battery Range"
|
||||
#define TR_BATTERY_RANGE TR("Battery range","Battery meter range")
|
||||
#define TR_BATTERYWARNING INDENT"Battery Low"
|
||||
#define TR_INACTIVITYALARM INDENT"Inactivity"
|
||||
#define TR_MEMORYWARNING INDENT"Memory Low"
|
||||
#define TR_ALARMWARNING INDENT"Sound Off"
|
||||
#define TR_RENAVIG "RotEnc Navig"
|
||||
#define TR_THROTTLEREVERSE TR("Thr reverse","Throttle reverse")
|
||||
#define TR_MINUTEBEEP TR(INDENT"Minute",INDENT"Every minute")
|
||||
#define TR_MINUTEBEEP TR(INDENT"Minute",INDENT"Minute call")
|
||||
#define TR_BEEPCOUNTDOWN INDENT"Countdown"
|
||||
#define TR_PERSISTENT TR(INDENT"Persist.",INDENT"Persistent")
|
||||
#define TR_BACKLIGHT_LABEL "Backlight"
|
||||
@@ -434,14 +445,14 @@
|
||||
#define TR_CAL "Cal"
|
||||
#define TR_VTRIM "Trim- +"
|
||||
#define TR_BG "BG:"
|
||||
#define TR_MENUTOSTART CENTER"\006"TR_ENTER" TO START"
|
||||
#define TR_SETMIDPOINT CENTER"\003SET STICKS MIDPOINT"
|
||||
#define TR_MOVESTICKSPOTS CENTER"\006MOVE STICKS/POTS"
|
||||
#define TR_MENUTOSTART CENTER "\006" TR_ENTER " TO START"
|
||||
#define TR_SETMIDPOINT CENTER "\003SET STICKS MIDPOINT"
|
||||
#define TR_MOVESTICKSPOTS CENTER "\006MOVE STICKS/POTS"
|
||||
#define TR_RXBATT "Rx Batt:"
|
||||
#define TR_TXnRX "Tx:\0Rx:"
|
||||
#define OFS_RX 4
|
||||
#define TR_ACCEL "Acc:"
|
||||
#define TR_NODATA "NO DATA"
|
||||
#define TR_NODATA CENTER "NO DATA"
|
||||
#define TR_TM1TM2 "TM1\032TM2"
|
||||
#define TR_THRTHP "THR\032TH%"
|
||||
#define TR_TOT "TOT"
|
||||
@@ -458,21 +469,21 @@
|
||||
|
||||
#define TR_T10MSUS "T10ms\016us"
|
||||
#define TR_FREESTACKMINB "Free Stack\010b"
|
||||
#define TR_MENUTORESET "[MENU] to reset"
|
||||
#define TR_MENUTORESET CENTER TR_ENTER " to reset"
|
||||
#define TR_PPM "PPM"
|
||||
#define TR_CH "CH"
|
||||
#define TR_MODEL "MODEL"
|
||||
#define TR_FP "FP"
|
||||
#define TR_FP "FM"
|
||||
#define TR_MIX "MIX"
|
||||
#define TR_EEPROMLOWMEM "EEPROM low mem"
|
||||
#define TR_ALERT "\016ALERT"
|
||||
#define TR_PRESSANYKEYTOSKIP CENTER"Press any key to skip"
|
||||
#define TR_THROTTLENOTIDLE CENTER"Throttle not idle"
|
||||
#define TR_ALARMSDISABLED CENTER"Alarms Disabled"
|
||||
#define TR_PRESSANYKEY TR("\010Press any Key", CENTER"Press any Key")
|
||||
#define TR_BADEEPROMDATA CENTER"Bad EEprom Data"
|
||||
#define TR_EEPROMFORMATTING CENTER"Formatting EEPROM"
|
||||
#define TR_EEPROMOVERFLOW CENTER"EEPROM overflow"
|
||||
#define TR_PRESSANYKEYTOSKIP CENTER "Press any key to skip"
|
||||
#define TR_THROTTLENOTIDLE CENTER "Throttle not idle"
|
||||
#define TR_ALARMSDISABLED CENTER "Alarms Disabled"
|
||||
#define TR_PRESSANYKEY TR("\010Press any Key", CENTER "Press any Key")
|
||||
#define TR_BADEEPROMDATA CENTER "Bad EEprom Data"
|
||||
#define TR_EEPROMFORMATTING CENTER "Formatting EEPROM"
|
||||
#define TR_EEPROMOVERFLOW CENTER "EEPROM overflow"
|
||||
#define TR_MENURADIOSETUP "RADIO SETUP"
|
||||
#define TR_MENUDATEANDTIME "DATE AND TIME"
|
||||
#define TR_MENUTRAINER "TRAINER"
|
||||
@@ -483,13 +494,13 @@
|
||||
#define TR_TRIMS2OFFSETS "\006Trims => Offsets"
|
||||
#define TR_MENUMODELSEL TR("MODELSEL","MODEL SELECTION")
|
||||
#define TR_MENUSETUP TR("SETUP","MODEL SETUP")
|
||||
#define TR_MENUFLIGHTPHASE "FLIGHT PHASE"
|
||||
#define TR_MENUFLIGHTPHASES "FLIGHT PHASES"
|
||||
#define TR_MENUFLIGHTPHASE "FLIGHT MODE"
|
||||
#define TR_MENUFLIGHTPHASES "FLIGHT MODES"
|
||||
#define TR_MENUHELISETUP "HELI SETUP"
|
||||
|
||||
#if defined(PPM_CENTER_ADJUSTABLE) || defined(PPM_LIMITS_SYMETRICAL) // The right menu titles for the gurus ...
|
||||
#define TR_MENUDREXPO "STICKS"
|
||||
#define TR_MENULIMITS "OUTPUTS"
|
||||
#define TR_MENULIMITS "SERVOS"
|
||||
#else
|
||||
#define TR_MENUDREXPO "DR/EXPO"
|
||||
#define TR_MENULIMITS "LIMITS"
|
||||
|
||||
+26
-15
@@ -121,8 +121,8 @@
|
||||
#define LEN_VMIXTRIMS "\003"
|
||||
#define TR_VMIXTRIMS "OFF""ON\0""Dir""Ele""Ace""Ale"
|
||||
|
||||
#define LEN_VCSWFUNC "\006"
|
||||
#define TR_VCSWFUNC "---\0 ""v1==x\0""v1>x\0 ""v1<x\0 ""|v1|>x""|v1|<x""AND\0 ""OR\0 ""XOR\0 ""v1==v2""v1>v2\0""v1<v2\0""d>=x\0 ""|d|>=x"
|
||||
#define LEN_VCSWFUNC "\005"
|
||||
#define TR_VCSWFUNC "---\0 ""a{x\0 ""a>x\0 ""a<x\0 ""|a|>x""|a|<x""AND\0 ""OR\0 ""XOR\0 ""a=b\0 ""a>b\0 ""a<b\0 ""d}x\0 ""|d|}x"
|
||||
|
||||
#define LEN_VFSWFUNC "\013"
|
||||
|
||||
@@ -138,7 +138,9 @@
|
||||
#define TR_SOUND "Beep\0 "
|
||||
#endif
|
||||
|
||||
#if defined(HAPTIC)
|
||||
#if defined(PCBTARANIS)
|
||||
#define TR_HAPTIC
|
||||
#elif defined(HAPTIC)
|
||||
#define TR_HAPTIC "Tactil\0 "
|
||||
#else
|
||||
#define TR_HAPTIC "[Tactil]\0 "
|
||||
@@ -195,8 +197,10 @@
|
||||
#define TR_FSW_RESET_TELEM
|
||||
#endif
|
||||
|
||||
#if ROTARY_ENCODERS > 0
|
||||
#define TR_FSW_RESET_ROTENC "R.Enc"
|
||||
#if ROTARY_ENCODERS == 2
|
||||
#define TR_FSW_RESET_ROTENC TR("REa\0 ""REb\0 ", "RotEnc A\0""RotEnc B\0")
|
||||
#elif ROTARY_ENCODERS == 1
|
||||
#define TR_FSW_RESET_ROTENC TR("R.Enc", "RotEnc\0 ")
|
||||
#else
|
||||
#define TR_FSW_RESET_ROTENC
|
||||
#endif
|
||||
@@ -209,16 +213,23 @@
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2""Tx\0 ""Rx\0 ""A1\0 ""A2\0 ""Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+""Cur+""Acc\0""Hora"
|
||||
|
||||
#ifdef IMPERIAL_UNITS
|
||||
#define LENGTH_UNIT "ft\0"
|
||||
#define SPEED_UNIT "kts"
|
||||
#if defined(CPUARM)
|
||||
#define LEN_VTELEMUNIT_NORM "\003"
|
||||
#define TR_VTELEMUNIT_NORM "v\0 ""A\0 ""m/s""-\0 ""kmh""m\0 ""@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#define LEN_VTELEMUNIT_IMP "\003"
|
||||
#define TR_VTELEMUNIT_IMP "v\0 ""A\0 ""m/s""-\0 ""kts""ft\0""@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#else
|
||||
#define LENGTH_UNIT "m\0 "
|
||||
#define SPEED_UNIT "kmh"
|
||||
#if defined(IMPERIAL_UNITS)
|
||||
#define LENGTH_UNIT "ft\0"
|
||||
#define SPEED_UNIT "kts"
|
||||
#else
|
||||
#define LENGTH_UNIT "m\0 "
|
||||
#define SPEED_UNIT "kmh"
|
||||
#endif
|
||||
#define LEN_VTELEMUNIT "\003"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""m/s""-\0 " SPEED_UNIT LENGTH_UNIT "@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#endif
|
||||
|
||||
#define LEN_VTELEMUNIT "\003"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""m/s""-\0 " SPEED_UNIT LENGTH_UNIT "@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#define STR_V (STR_VTELEMUNIT+1)
|
||||
#define STR_A (STR_VTELEMUNIT+4)
|
||||
|
||||
@@ -251,7 +262,7 @@
|
||||
#define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0"
|
||||
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS " Menu""Salir""Abajo""Arrib""Dcha.""Izqd."
|
||||
#define TR_VKEYS TR(" Menu""Salir""Abajo""Arrib""Dcha.""Izqd.", " Menu"" Exit""Enter"" Page"" Plus""Minus")
|
||||
|
||||
#define LEN_VRENCODERS "\003"
|
||||
#define TR_VRENCODERS "REa""REb"
|
||||
@@ -433,7 +444,7 @@
|
||||
#define TR_TXnRX "Tx:\0Rx:"
|
||||
#define OFS_RX 4
|
||||
#define TR_ACCEL "Acc:"
|
||||
#define TR_NODATA "SIN DATOS"
|
||||
#define TR_NODATA CENTER"SIN DATOS"
|
||||
#define TR_TM1TM2 "TM1\032TM2"
|
||||
#define TR_THRTHP "THR\032TH%"
|
||||
#define TR_TOT "TOT"
|
||||
@@ -450,7 +461,7 @@
|
||||
|
||||
#define TR_T10MSUS "T10ms\016us"
|
||||
#define TR_FREESTACKMINB "Pila libre\010b"
|
||||
#define TR_MENUTORESET "[MENU] Resetea"
|
||||
#define TR_MENUTORESET CENTER TR_ENTER" Resetea"
|
||||
#define TR_PPM "PPM"
|
||||
#define TR_CH "CH"
|
||||
#define TR_MODEL "MODELO"
|
||||
|
||||
+25
-14
@@ -135,8 +135,8 @@
|
||||
#define LEN_VMIXTRIMS "\003"
|
||||
#define TR_VMIXTRIMS "OFF""ON\0""Dir""Prf""Gaz""Ail"
|
||||
|
||||
#define LEN_VCSWFUNC "\006"
|
||||
#define TR_VCSWFUNC "---\0 ""v1==x\0""v1>x\0 ""v1<x\0 ""|v1|>x""|v1|<x""ET\0 ""OU\0 ""OU Exc""v1==v2""v1>v2\0""v1<v2\0""d>=x\0 ""|d|>=x"
|
||||
#define LEN_VCSWFUNC "\005"
|
||||
#define TR_VCSWFUNC "---\0 ""a{x\0 ""a>x\0 ""a<x\0 ""|a|>x""|a|<x""AND\0 ""OR\0 ""XOR\0 ""a=b\0 ""a>b\0 ""a<b\0 ""d}x\0 ""|d|}x"
|
||||
|
||||
#define LEN_VFSWFUNC "\015"
|
||||
|
||||
@@ -152,7 +152,9 @@
|
||||
#define TR_SOUND "Bip\0 "
|
||||
#endif
|
||||
|
||||
#if defined(HAPTIC)
|
||||
#if defined(PCBTARANIS)
|
||||
#define TR_HAPTIC
|
||||
#elif defined(HAPTIC)
|
||||
#define TR_HAPTIC "Vibreur\0 "
|
||||
#else
|
||||
#define TR_HAPTIC "[Vibreur]\0 "
|
||||
@@ -209,8 +211,10 @@
|
||||
#define TR_FSW_RESET_TELEM
|
||||
#endif
|
||||
|
||||
#if ROTARY_ENCODERS > 0
|
||||
#define TR_FSW_RESET_ROTENC "Enc.r"
|
||||
#if ROTARY_ENCODERS == 2
|
||||
#define TR_FSW_RESET_ROTENC TR("ERa\0 ""ERb\0 ", "EncRot A\0""EncRot B\0")
|
||||
#elif ROTARY_ENCODERS == 1
|
||||
#define TR_FSW_RESET_ROTENC TR("Enc.r", "EncRot\0 ")
|
||||
#else
|
||||
#define TR_FSW_RESET_ROTENC
|
||||
#endif
|
||||
@@ -223,16 +227,23 @@
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#define TR_VTELEMCHNS "---\0""Batt""Chr1""Chr2""Tx\0 ""Rx\0 ""A1\0 ""A2\0 ""Alt\0""Rpm\0""Carb""T1\0 ""T2\0 ""Vit\0""Dist""AltG""Elem""Velm""Vfas""Cour""Cnsm""Puis""AccX""AccY""AccZ""Cap\0""VitV""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Vit+""Dst+""Cur+""Acc\0""Time"
|
||||
|
||||
#ifdef IMPERIAL_UNITS
|
||||
#define LENGTH_UNIT "ft\0"
|
||||
#define SPEED_UNIT "kts"
|
||||
#if defined(CPUARM)
|
||||
#define LEN_VTELEMUNIT_NORM "\003"
|
||||
#define TR_VTELEMUNIT_NORM "v\0 ""A\0 ""m/s""-\0 ""kmh""m\0 ""@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#define LEN_VTELEMUNIT_IMP "\003"
|
||||
#define TR_VTELEMUNIT_IMP "v\0 ""A\0 ""m/s""-\0 ""kts""ft\0""@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#else
|
||||
#define LENGTH_UNIT "m\0 "
|
||||
#define SPEED_UNIT "kmh"
|
||||
#if defined(IMPERIAL_UNITS)
|
||||
#define LENGTH_UNIT "ft\0"
|
||||
#define SPEED_UNIT "kts"
|
||||
#else
|
||||
#define LENGTH_UNIT "m\0 "
|
||||
#define SPEED_UNIT "kmh"
|
||||
#endif
|
||||
#define LEN_VTELEMUNIT "\003"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""m/s""-\0 " SPEED_UNIT LENGTH_UNIT "@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#endif
|
||||
|
||||
#define LEN_VTELEMUNIT "\003"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""m/s""-\0 " SPEED_UNIT LENGTH_UNIT "@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#define STR_V (STR_VTELEMUNIT+1)
|
||||
#define STR_A (STR_VTELEMUNIT+4)
|
||||
|
||||
@@ -265,7 +276,7 @@
|
||||
#define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0"
|
||||
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS " Menu"" Exit"" Bas"" Haut""Droit""Gauch"
|
||||
#define TR_VKEYS TR(" Menu"" Exit"" Bas"" Haut""Droit""Gauch", " Menu"" Exit""Enter"" Page"" Plus""Minus")
|
||||
|
||||
#define LEN_VRENCODERS "\003"
|
||||
#define TR_VRENCODERS "REa""REb"
|
||||
@@ -464,7 +475,7 @@
|
||||
|
||||
#define TR_T10MSUS "T10ms\016us"
|
||||
#define TR_FREESTACKMINB "Free Stack\010b"
|
||||
#define TR_MENUTORESET "[MENU] pour reset"
|
||||
#define TR_MENUTORESET CENTER TR_ENTER" pour reset"
|
||||
#define TR_PPM "PPM"
|
||||
#define TR_CH "CH"
|
||||
#define TR_MODEL "MODELE"
|
||||
|
||||
+26
-15
@@ -120,8 +120,8 @@
|
||||
#define LEN_VMIXTRIMS "\003"
|
||||
#define TR_VMIXTRIMS "OFF""ON ""Rud""Ele""Thr""Ail"
|
||||
|
||||
#define LEN_VCSWFUNC "\006"
|
||||
#define TR_VCSWFUNC "---\0 ""v1==x\0""v1>x\0 ""v1<x\0 ""|v1|>x""|v1|<x""AND\0 ""OR\0 ""XOR\0 ""v1==v2""v1>v2\0""v1<v2\0""d>=x\0 ""|d|>=x"
|
||||
#define LEN_VCSWFUNC "\005"
|
||||
#define TR_VCSWFUNC "---\0 ""a{x\0 ""a>x\0 ""a<x\0 ""|a|>x""|a|<x""AND\0 ""OR\0 ""XOR\0 ""a=b\0 ""a>b\0 ""a<b\0 ""d}x\0 ""|d|}x"
|
||||
|
||||
#define LEN_VFSWFUNC "\015"
|
||||
|
||||
@@ -137,7 +137,9 @@
|
||||
#define TR_SOUND "Beep\0 "
|
||||
#endif
|
||||
|
||||
#if defined(HAPTIC)
|
||||
#if defined(PCBTARANIS)
|
||||
#define TR_HAPTIC
|
||||
#elif defined(HAPTIC)
|
||||
#define TR_HAPTIC "Vibrazione\0 "
|
||||
#else
|
||||
#define TR_HAPTIC "[Vibrazione]\0"
|
||||
@@ -194,8 +196,10 @@
|
||||
#define TR_FSW_RESET_TELEM
|
||||
#endif
|
||||
|
||||
#if ROTARY_ENCODERS > 0
|
||||
#define TR_FSW_RESET_ROTENC "R.Enc"
|
||||
#if ROTARY_ENCODERS == 2
|
||||
#define TR_FSW_RESET_ROTENC TR("REa\0 ""REb\0 ", "RotEnc A\0""RotEnc B\0")
|
||||
#elif ROTARY_ENCODERS == 1
|
||||
#define TR_FSW_RESET_ROTENC TR("R.Enc", "RotEnc\0 ")
|
||||
#else
|
||||
#define TR_FSW_RESET_ROTENC
|
||||
#endif
|
||||
@@ -208,16 +212,23 @@
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2""Tx\0 ""Rx\0 ""A1\0 ""A2\0 ""Alt\0""Rpm\0""Carb""T1\0 ""T2\0 ""Vel\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsm""Powr""AccX""AccY""AccZ""Dir\0""VelV""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Vel+""Dst+""Cur+""Acc\0""Time"
|
||||
|
||||
#ifdef IMPERIAL_UNITS
|
||||
#define LENGTH_UNIT "ft\0"
|
||||
#define SPEED_UNIT "kts"
|
||||
#if defined(CPUARM)
|
||||
#define LEN_VTELEMUNIT_NORM "\003"
|
||||
#define TR_VTELEMUNIT_NORM "v\0 ""A\0 ""m/s""-\0 ""kmh""m\0 ""@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#define LEN_VTELEMUNIT_IMP "\003"
|
||||
#define TR_VTELEMUNIT_IMP "v\0 ""A\0 ""m/s""-\0 ""kts""ft\0""@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#else
|
||||
#define LENGTH_UNIT "m\0 "
|
||||
#define SPEED_UNIT "kmh"
|
||||
#if defined(IMPERIAL_UNITS)
|
||||
#define LENGTH_UNIT "ft\0"
|
||||
#define SPEED_UNIT "kts"
|
||||
#else
|
||||
#define LENGTH_UNIT "m\0 "
|
||||
#define SPEED_UNIT "kmh"
|
||||
#endif
|
||||
#define LEN_VTELEMUNIT "\003"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""m/s""-\0 " SPEED_UNIT LENGTH_UNIT "@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#endif
|
||||
|
||||
#define LEN_VTELEMUNIT "\003"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""m/s""-\0 " SPEED_UNIT LENGTH_UNIT "@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#define STR_V (STR_VTELEMUNIT+1)
|
||||
#define STR_A (STR_VTELEMUNIT+4)
|
||||
|
||||
@@ -250,7 +261,7 @@
|
||||
#define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0"
|
||||
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS " Men\200"" EXIT"" DN "" UP"" SX"" DX"
|
||||
#define TR_VKEYS TR(" Men\200"" EXIT"" DN "" UP"" SX"" DX", " Menu"" Exit""Enter"" Page"" Plus""Minus")
|
||||
|
||||
#define LEN_VRENCODERS "\003"
|
||||
#define TR_VRENCODERS "REa""REb"
|
||||
@@ -432,7 +443,7 @@
|
||||
#define TR_TXnRX "Tx:\0Rx:"
|
||||
#define OFS_RX 4
|
||||
#define TR_ACCEL "Acc:"
|
||||
#define TR_NODATA "NO DATA"
|
||||
#define TR_NODATA CENTER"NO DATA"
|
||||
#define TR_TM1TM2 "TM1\032TM2"
|
||||
#define TR_THRTHP "THR\032TH%"
|
||||
#define TR_TOT "TOT"
|
||||
@@ -449,7 +460,7 @@
|
||||
|
||||
#define TR_T10MSUS "T10ms\007us"
|
||||
#define TR_FREESTACKMINB "Free Stack\004b"
|
||||
#define TR_MENUTORESET "[Men\200] x Azzerare"
|
||||
#define TR_MENUTORESET CENTER TR_ENTER" x Azzerare"
|
||||
#define TR_PPM "PPM"
|
||||
#define TR_CH "CH"
|
||||
#define TR_MODEL "MODELLO"
|
||||
|
||||
+26
-15
@@ -99,8 +99,8 @@
|
||||
#define LEN_VMIXTRIMS "\003"
|
||||
#define TR_VMIXTRIMS "OFF""ON\0""Lem""Pfd""Mot""Ail"
|
||||
|
||||
#define LEN_VCSWFUNC "\006"
|
||||
#define TR_VCSWFUNC "---\0 ""v1==x\0""v1>x\0 ""v1<x\0 ""|v1|>x""|v1|<x""AND\0 ""OR\0 ""XOR\0 ""v1==v2""v1>v2\0""v1<v2\0""d>=x\0 ""|d|>=x"
|
||||
#define LEN_VCSWFUNC "\005"
|
||||
#define TR_VCSWFUNC "---\0 ""a{x\0 ""a>x\0 ""a<x\0 ""|a|>x""|a|<x""AND\0 ""OR\0 ""XOR\0 ""a=b\0 ""a>b\0 ""a<b\0 ""d}x\0 ""|d|}x"
|
||||
|
||||
#define LEN_VFSWFUNC "\015"
|
||||
|
||||
@@ -116,7 +116,9 @@
|
||||
#define TR_SOUND "Beep\0 "
|
||||
#endif
|
||||
|
||||
#if defined(HAPTIC)
|
||||
#if defined(PCBTARANIS)
|
||||
#define TR_HAPTIC
|
||||
#elif defined(HAPTIC)
|
||||
#define TR_HAPTIC "Vibrar\0 "
|
||||
#else
|
||||
#define TR_HAPTIC "[Vibrar]\0 "
|
||||
@@ -173,8 +175,10 @@
|
||||
#define TR_FSW_RESET_TELEM
|
||||
#endif
|
||||
|
||||
#if ROTARY_ENCODERS > 0
|
||||
#define TR_FSW_RESET_ROTENC "R.Enc"
|
||||
#if ROTARY_ENCODERS == 2
|
||||
#define TR_FSW_RESET_ROTENC TR("REa\0 ""REb\0 ", "RotEnc A\0""RotEnc B\0")
|
||||
#elif ROTARY_ENCODERS == 1
|
||||
#define TR_FSW_RESET_ROTENC TR("R.Enc", "RotEnc\0 ")
|
||||
#else
|
||||
#define TR_FSW_RESET_ROTENC
|
||||
#endif
|
||||
@@ -187,16 +191,23 @@
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2""Tx\0 ""Rx\0 ""A1\0 ""A2\0 ""Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VVel""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Vel+""Dst+""Cur+""Acc\0""Hora"
|
||||
|
||||
#ifdef IMPERIAL_UNITS
|
||||
#define LENGTH_UNIT "ft\0"
|
||||
#define SPEED_UNIT "kts"
|
||||
#if defined(CPUARM)
|
||||
#define LEN_VTELEMUNIT_NORM "\003"
|
||||
#define TR_VTELEMUNIT_NORM "v\0 ""A\0 ""m/s""-\0 ""kmh""m\0 ""@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#define LEN_VTELEMUNIT_IMP "\003"
|
||||
#define TR_VTELEMUNIT_IMP "v\0 ""A\0 ""m/s""-\0 ""kts""ft\0""@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#else
|
||||
#define LENGTH_UNIT "m\0 "
|
||||
#define SPEED_UNIT "kmh"
|
||||
#if defined(IMPERIAL_UNITS)
|
||||
#define LENGTH_UNIT "ft\0"
|
||||
#define SPEED_UNIT "kts"
|
||||
#else
|
||||
#define LENGTH_UNIT "m\0 "
|
||||
#define SPEED_UNIT "kmh"
|
||||
#endif
|
||||
#define LEN_VTELEMUNIT "\003"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""m/s""-\0 " SPEED_UNIT LENGTH_UNIT "@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#endif
|
||||
|
||||
#define LEN_VTELEMUNIT "\003"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""m/s""-\0 " SPEED_UNIT LENGTH_UNIT "@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#define STR_V (STR_VTELEMUNIT+1)
|
||||
#define STR_A (STR_VTELEMUNIT+4)
|
||||
|
||||
@@ -229,7 +240,7 @@
|
||||
#define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0"
|
||||
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS " Menu"" Sair""Desce"" Sobe""Direi""Esqda"
|
||||
#define TR_VKEYS TR(" Menu"" Sair""Desce"" Sobe""Direi""Esqda", " Menu"" Exit""Enter"" Page"" Plus""Minus")
|
||||
|
||||
#define LEN_VRENCODERS "\003"
|
||||
#define TR_VRENCODERS "REa""REb"
|
||||
@@ -411,7 +422,7 @@
|
||||
#define TR_TXnRX "Tx:\0Rx:"
|
||||
#define OFS_RX 4
|
||||
#define TR_ACCEL "Acc:"
|
||||
#define TR_NODATA "SEM DADOS"
|
||||
#define TR_NODATA CENTER"SEM DADOS"
|
||||
#define TR_TM1TM2 "TM1\032TM2"
|
||||
#define TR_THRTHP "MTR\032MT%"
|
||||
#define TR_TOT "TOT"
|
||||
@@ -428,7 +439,7 @@
|
||||
|
||||
#define TR_T10MSUS "T10ms\016us"
|
||||
#define TR_FREESTACKMINB "Pilha Livre\010b"
|
||||
#define TR_MENUTORESET "[MENU] Reinicia"
|
||||
#define TR_MENUTORESET CENTER TR_ENTER" Reinicia"
|
||||
#define TR_PPM "PPM"
|
||||
#define TR_CH "CH"
|
||||
#define TR_MODEL "MODEL"
|
||||
|
||||
+101
-82
@@ -2,6 +2,19 @@
|
||||
* Authors (alphabetical order)
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Kjell Kernen <kjell.kernen@gmail.com>
|
||||
* *
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* << Blank area used to row align file with en.h >>
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
@@ -18,11 +31,12 @@
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
*
|
||||
*/
|
||||
|
||||
// NON ZERO TERMINATED STRINGS
|
||||
#define LEN_OFFON "\003"
|
||||
#define TR_OFFON "AV ""P\203 "
|
||||
#define TR_OFFON "AV ""P\203\0"
|
||||
|
||||
#define LEN_MMMINV "\003"
|
||||
#define TR_MMMINV "---""INV"
|
||||
@@ -40,7 +54,7 @@
|
||||
#define TR_VRENAVIG "No REaREb"
|
||||
|
||||
#define LEN_VBLMODE "\004"
|
||||
#define TR_VBLMODE "AV ""Knpp""Spak""B\200da""P\203 "
|
||||
#define TR_VBLMODE "AV ""Knpp""Spak""B\200da""P\203\0"
|
||||
|
||||
#define LEN_TRNMODE "\003"
|
||||
#define TR_TRNMODE " AV"" +="" :="
|
||||
@@ -55,7 +69,7 @@
|
||||
#define TR_VLCD "NormalOptrex"
|
||||
|
||||
#define LEN_COUNTRYCODES TR("\002", "\007")
|
||||
#define TR_COUNTRYCODES TR("US""JP""EU", "America""Japan\0 ""Europe\0")
|
||||
#define TR_COUNTRYCODES TR("US""JP""EU", "Amerika""Japan\0 ""Europa\0")
|
||||
|
||||
#define LEN_VTRIMINC TR("\006","\014")
|
||||
#define TR_VTRIMINC TR("Expo ""xFin ""Fin ""Medium""Grov ","Exponentiell""Extra Fin ""Fin ""Medium ""Grov ")
|
||||
@@ -69,7 +83,7 @@
|
||||
#define TR_RETA123 "RHGS123ab"
|
||||
#endif
|
||||
#elif defined(PCBTARANIS)
|
||||
#define TR_RETA123 "RHGS12LR"
|
||||
#define TR_RETA123 "RHGS12HV"
|
||||
#else
|
||||
#define TR_RETA123 "RHGS123"
|
||||
#endif
|
||||
@@ -77,17 +91,17 @@
|
||||
#define LEN_VPROTOS "\006"
|
||||
|
||||
#if defined(PXX)
|
||||
#define TR_PXX "PXX\0 "
|
||||
#define TR_PXX "PXX\0 "
|
||||
#elif defined(DSM2) || defined(IRPROTOS)
|
||||
#define TR_PXX "[PXX]\0"
|
||||
#define TR_PXX "[PXX]\0"
|
||||
#else
|
||||
#define TR_PXX
|
||||
#endif
|
||||
|
||||
#if defined(DSM2)
|
||||
#define TR_DSM2 "LP45\0 ""DSM2\0 ""DSMX\0 "
|
||||
#define TR_DSM2 "LP45\0 ""DSM2\0 ""DSMX\0 "
|
||||
#elif defined(IRPROTOS)
|
||||
#define TR_DSM2 "[LP45]""[DSM2]""[DSMX]"
|
||||
#define TR_DSM2 "[LP45]""[DSM2]""[DSMX]"
|
||||
#else
|
||||
#define TR_DSM2
|
||||
#endif
|
||||
@@ -113,62 +127,64 @@
|
||||
#define TR_VCURVEFUNC "---""x>0""x<0""|x|""f>0""f<0""|f|"
|
||||
|
||||
#define LEN_VMLTPX "\010"
|
||||
#define TR_VMLTPX "Addera ""F\202rst\201rk""Ers\201tt\0"
|
||||
#define TR_VMLTPX "Addera ""F\202rst\201rk""Ers\201tt "
|
||||
|
||||
#define LEN_VMLTPX2 "\002"
|
||||
#define TR_VMLTPX2 "+=""*="":="
|
||||
|
||||
#define LEN_VMIXTRIMS "\003"
|
||||
#define TR_VMIXTRIMS "AV ""P\203 ""Rod""Hjd""Gas""Ske"
|
||||
#define TR_VMIXTRIMS "AV ""P\203\0""Rod""Hjd""Gas""Ske"
|
||||
|
||||
#define LEN_VCSWFUNC "\006"
|
||||
#define TR_VCSWFUNC "---\0 ""v1==x\0""v1>x\0 ""v1<x\0 ""|v1|>x""|v1|<x""AND\0 ""OR\0 ""XOR\0 ""v1==v2""v1>v2\0""v1<v2\0""d>=x\0 ""|d|>=x"
|
||||
#define LEN_VCSWFUNC "\005"
|
||||
#define TR_VCSWFUNC "---\0 ""a{x\0 ""a>x\0 ""a<x\0 ""|a|>x""|a|<x""AND\0 ""OR\0 ""XOR\0 ""a=b\0 ""a>b\0 ""a<b\0 ""d}x\0 ""|d|}x"
|
||||
|
||||
#define LEN_VFSWFUNC "\013"
|
||||
#define LEN_VFSWFUNC "\012"
|
||||
|
||||
#if defined(VARIO)
|
||||
#define TR_VVARIO "Vario "
|
||||
#define TR_VVARIO "Vario "
|
||||
#else
|
||||
#define TR_VVARIO "[Vario] "
|
||||
#define TR_VVARIO "[Vario] "
|
||||
#endif
|
||||
|
||||
#if defined(AUDIO)
|
||||
#define TR_SOUND "Spela Ljud\0"
|
||||
#define TR_SOUND "Spela Ljud"
|
||||
#else
|
||||
#define TR_SOUND "Pip\0 "
|
||||
#define TR_SOUND "Pip\0 "
|
||||
#endif
|
||||
|
||||
#if defined(HAPTIC)
|
||||
#define TR_HAPTIC "Vibrator\0 "
|
||||
#if defined(PCBTARANIS)
|
||||
#define TR_HAPTIC
|
||||
#elif defined(HAPTIC)
|
||||
#define TR_HAPTIC "Vibrator\0 "
|
||||
#else
|
||||
#define TR_HAPTIC "[Vibrator]\0"
|
||||
#define TR_HAPTIC "[Vibrator]"
|
||||
#endif
|
||||
|
||||
#if defined(VOICE)
|
||||
#if defined(PCBSKY9X)
|
||||
#define TR_PLAY_TRACK "Spela Sp\200r\0"
|
||||
#define TR_PLAY_TRACK "Spela Sp\200r"
|
||||
#else
|
||||
#define TR_PLAY_TRACK "Spela\0 "
|
||||
#define TR_PLAY_TRACK "Spela\0 "
|
||||
#endif
|
||||
#define TR_PLAY_BOTH "Play Both\0 "
|
||||
#define TR_PLAY_VALUE "Spela V\201rde"
|
||||
#define TR_PLAY_BOTH "Spela B\203da"
|
||||
#define TR_PLAY_VALUE "Spela Val "
|
||||
#else
|
||||
#define TR_PLAY_TRACK "[Spela Sp\200r]"
|
||||
#define TR_PLAY_BOTH "[Play Both]"
|
||||
#define TR_PLAY_VALUE "[Spela V\201rde]"
|
||||
#define TR_PLAY_TRACK "[Sp. Sp\200r]"
|
||||
#define TR_PLAY_BOTH "[Sp. B\200da]"
|
||||
#define TR_PLAY_VALUE "[Sp. V\201rd]"
|
||||
#endif
|
||||
|
||||
#define TR_CFN_VOLUME "Volym\0 "
|
||||
#define TR_CFN_BG_MUSIC "BgMusik\0 ""BgMusik ||\0"
|
||||
#define TR_CFN_VOLUME "Volym\0 "
|
||||
#define TR_CFN_BG_MUSIC "BgMusik\0 ""BgMusik ||"
|
||||
|
||||
#if defined(SDCARD)
|
||||
#define TR_SDCLOGS "SDCARD Loggar"
|
||||
#define TR_SDCLOGS "SD Loggar\0"
|
||||
#else
|
||||
#define TR_SDCLOGS "[SDCARD Logg]"
|
||||
#define TR_SDCLOGS "[SD Logg]\0"
|
||||
#endif
|
||||
|
||||
#ifdef GVARS
|
||||
#define TR_CFN_ADJUST_GVAR "Justera\0 "
|
||||
#define TR_CFN_ADJUST_GVAR "Justera\0 "
|
||||
#else
|
||||
#define TR_CFN_ADJUST_GVAR
|
||||
#endif
|
||||
@@ -180,28 +196,30 @@
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define TR_VFSWFUNC "S\201kra\0 ""Trainer \0 ""S\201tt Trim\0 " TR_SOUND TR_HAPTIC "Nollst\201ll\0 " TR_VVARIO TR_PLAY_TRACK TR_PLAY_VALUE TR_SDCLOGS TR_CFN_VOLUME "Belysning\0 " TR_CFN_BG_MUSIC TR_CFN_ADJUST_GVAR TR_CFN_TEST
|
||||
#define TR_VFSWFUNC "S\201kra\0 ""Trainer\0 ""S\201tt Trim\0" TR_SOUND TR_HAPTIC "Nollst\201ll\0" TR_VVARIO TR_PLAY_TRACK TR_PLAY_VALUE TR_SDCLOGS TR_CFN_VOLUME "Belysning\0" TR_CFN_BG_MUSIC TR_CFN_ADJUST_GVAR TR_CFN_TEST
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
#define TR_VFSWFUNC "S\201kra\0 ""Trainer \0 ""S\201tt Trim\0 " TR_SOUND TR_HAPTIC "Nollst\201ll\0 " TR_VVARIO TR_PLAY_TRACK TR_PLAY_BOTH TR_PLAY_VALUE TR_SDCLOGS "Belysning\0 " TR_CFN_ADJUST_GVAR TR_CFN_TEST
|
||||
#define TR_VFSWFUNC "S\201kra\0 ""Trainer\0 ""S\201tt Trim\0" TR_SOUND TR_HAPTIC "Nollst\201ll\0" TR_VVARIO TR_PLAY_TRACK TR_PLAY_BOTH TR_PLAY_VALUE TR_SDCLOGS "Belysning\0" TR_CFN_ADJUST_GVAR TR_CFN_TEST
|
||||
#else
|
||||
#define TR_VFSWFUNC "S\201kra\0 ""Trainer \0 ""S\201tt Trim\0 " TR_SOUND TR_HAPTIC "Nollst\201ll\0 " TR_VVARIO TR_PLAY_TRACK TR_PLAY_BOTH TR_PLAY_VALUE "Belysning\0 " TR_CFN_ADJUST_GVAR TR_CFN_TEST
|
||||
#define TR_VFSWFUNC "S\201kra\0 ""Trainer\0 ""S\201tt Trim\0" TR_SOUND TR_HAPTIC "Nollst\201ll\0" TR_VVARIO TR_PLAY_TRACK TR_PLAY_BOTH TR_PLAY_VALUE "Belysning\0" TR_CFN_ADJUST_GVAR TR_CFN_TEST
|
||||
#endif
|
||||
|
||||
#define LEN_VFSWRESET "\011"
|
||||
#define LEN_VFSWRESET TR("\005", "\011")
|
||||
|
||||
#if defined(FRSKY)
|
||||
#define TR_FSW_RESET_TELEM "Telemetri"
|
||||
#define TR_FSW_RESET_TELEM TR("Telem", "Telemetri")
|
||||
#else
|
||||
#define TR_FSW_RESET_TELEM
|
||||
#endif
|
||||
|
||||
#if ROTARY_ENCODERS > 0
|
||||
#define TR_FSW_RESET_ROTENC "R.Enc"
|
||||
#if ROTARY_ENCODERS == 2
|
||||
#define TR_FSW_RESET_ROTENC TR("REa\0 ""REb\0 ", "RotEnc A\0""RotEnc B\0")
|
||||
#elif ROTARY_ENCODERS == 1
|
||||
#define TR_FSW_RESET_ROTENC TR("R.Enc", "RotEnc\0 ")
|
||||
#else
|
||||
#define TR_FSW_RESET_ROTENC
|
||||
#endif
|
||||
|
||||
#define TR_VFSWRESET "Timer1 ""Timer2 ""Allt " TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC
|
||||
#define TR_VFSWRESET TR("Tmr1\0""Tmr2\0""Allt\0" TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC, "Timer 1 ""Timer 2 ""Allt " TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC)
|
||||
|
||||
#define LEN_FUNCSOUNDS "\006"
|
||||
#define TR_FUNCSOUNDS "Pip1 ""Pip2 ""Pip3 ""Varn1 ""Varn2 ""F\200r ""Ring ""SciFi ""Robot ""F\200gel ""Tada ""Syrsa ""Siren ""Alarm ""Ratata""Tick "
|
||||
@@ -209,16 +227,23 @@
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2""Tx\0 ""Rx\0 ""A1\0 ""A2\0 ""H\202jd""Varv""Tank""T1\0 ""T2\0 ""Fart""Avst""GHjd""Batt""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VFrt""A1-\0""A2-\0""Hjd-""Hjd+""Rpm+""T1+\0""T2+\0""Frt+""Avs+""Cur+""Acc\0""Tid\0"
|
||||
|
||||
#ifdef IMPERIAL_UNITS
|
||||
#define LENGTH_UNIT "fot"
|
||||
#define SPEED_UNIT "knp"
|
||||
#if defined(CPUARM)
|
||||
#define LEN_VTELEMUNIT_NORM "\003"
|
||||
#define TR_VTELEMUNIT_NORM "v\0 ""A\0 ""m/s""-\0 ""kmh""m\0 ""@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#define LEN_VTELEMUNIT_IMP "\003"
|
||||
#define TR_VTELEMUNIT_IMP "v\0 ""A\0 ""m/s""-\0 ""kts""ft\0""@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#else
|
||||
#define LENGTH_UNIT "m\0 "
|
||||
#define SPEED_UNIT "kmh"
|
||||
#if defined(IMPERIAL_UNITS)
|
||||
#define LENGTH_UNIT "fot"
|
||||
#define SPEED_UNIT "knp"
|
||||
#else
|
||||
#define LENGTH_UNIT "m\0 "
|
||||
#define SPEED_UNIT "kmh"
|
||||
#endif
|
||||
#define LEN_VTELEMUNIT "\003"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""m/s""-\0 " SPEED_UNIT LENGTH_UNIT "@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#endif
|
||||
|
||||
#define LEN_VTELEMUNIT "\003"
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""m/s""-\0 " SPEED_UNIT LENGTH_UNIT "@\0 ""%\0 ""mA\0""mAh""W\0 "
|
||||
#define STR_V (STR_VTELEMUNIT+1)
|
||||
#define STR_A (STR_VTELEMUNIT+4)
|
||||
|
||||
@@ -229,7 +254,7 @@
|
||||
#define TR_VALARMFN "<>"
|
||||
|
||||
#define LEN_VTELPROTO "\007"
|
||||
#define TR_VTELPROTO "---\0 ""Hub\0 ""WSHH\202g."
|
||||
#define TR_VTELPROTO "---\0 ""Hub\0 ""WSHH\202g."
|
||||
|
||||
#define LEN_VOLTSRC "\003"
|
||||
#define TR_VOLTSRC "---""A1\0""A2\0""FAS""Cel"
|
||||
@@ -251,7 +276,7 @@
|
||||
#define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0"
|
||||
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS " MENU"" EXIT"" Ned"" Upp""H\202ger""V\201nst"
|
||||
#define TR_VKEYS TR(" Menu"" Exit"" Ned"" Upp""H\202ger""V\201nst", " Menu"" Exit""Enter"" Page"" Plus""Minus")
|
||||
|
||||
#define LEN_VRENCODERS "\003"
|
||||
#define TR_VRENCODERS "REa""REb"
|
||||
@@ -281,9 +306,9 @@
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#define TR_VSWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_CUSTOMSW " ON"
|
||||
#define TR_VSWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_CUSTOMSW " P\203"
|
||||
#else
|
||||
#define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_CUSTOMSW " ON"
|
||||
#define TR_VSWITCHES TR_9X_3POS_SWITCHES "GAS""SID""HJD""SKE""LAN""TRN" TR_CUSTOMSW " P\203"
|
||||
#endif
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
@@ -305,7 +330,7 @@
|
||||
#define TR_VSRCRAW "---\0""Rod\0""H\202j\0""Gas\0""Ske\0" TR_POTS_VSRCRAW TR_ROTARY_ENCODERS_VSRCRAW "MAX " TR_CYC_VSRCRAW "TrmR" "TrmH" "TrmG" "TrmS" TR_SW_VSRCRAW
|
||||
|
||||
#define LEN_VTMRMODES "\003"
|
||||
#define TR_VTMRMODES "AV ""ABS""THs""TH%""THt"
|
||||
#define TR_VTMRMODES "AV ""ABS""GAs""GA%""GAt"
|
||||
|
||||
// ZERO TERMINATED STRINGS
|
||||
#define INDENT "\001"
|
||||
@@ -338,8 +363,8 @@
|
||||
#define TR_ETRIMS TR("Trimmar++","Ut\202kade Trimmar")
|
||||
#define TR_TRIMINC TR("Trim\202kn.","Trim\202kning")
|
||||
#define TR_TTRACE "F\202lj Gas"
|
||||
#define TR_TTRIM "GasTrim"
|
||||
#define TR_BEEPCTR "Centerpip"
|
||||
#define TR_TTRIM TR("G-K\201lla","Gas-k\201lla")
|
||||
#define TR_BEEPCTR TR("Cent.pip", "Centerpip")
|
||||
#define TR_PROTO TR(INDENT"Proto",INDENT"Protokoll")
|
||||
#define TR_PPMFRAME "PPM-paket"
|
||||
#define TR_MS "ms"
|
||||
@@ -363,14 +388,14 @@
|
||||
#define TR_EDITMIX "Redigera Mix"
|
||||
#define TR_SOURCE INDENT"K\201lla"
|
||||
#define TR_WEIGHT "Vikt"
|
||||
#define TR_EXPO "Expo"
|
||||
#define TR_EXPO TR("Expo","Exponentiell")
|
||||
#define TR_SIDE "Sida"
|
||||
#define TR_DIFFERENTIAL "Diff."
|
||||
#define TR_OFFSET INDENT"Offset"
|
||||
#define TR_TRIM "Trim"
|
||||
#define TR_DREX "DRex"
|
||||
#define TR_CURVE "Kurvor"
|
||||
#define TR_FPHASE "FlFas"
|
||||
#define TR_CURVE "Kurva"
|
||||
#define TR_FPHASE TR("Fas","Faser")
|
||||
#define TR_MIXWARNING "Varning"
|
||||
#define TR_OFF "AV "
|
||||
#define TR_MULTPX "Multpx"
|
||||
@@ -382,7 +407,7 @@
|
||||
#define TR_CV "KU"
|
||||
#define TR_GV "GV"
|
||||
#define TR_ACHANNEL "A\004kanal "
|
||||
#define TR_RANGE INDENT"Omr\200de"
|
||||
#define TR_RANGE INDENT"MinMax"
|
||||
#define TR_BAR "Data"
|
||||
#define TR_ALARM INDENT"Alarm"
|
||||
#define TR_USRDATA "Anv\201ndardata"
|
||||
@@ -395,7 +420,7 @@
|
||||
#define TR_HAPTICSTRENGTH INDENT"Styrka"
|
||||
#define TR_CONTRAST "Kontrast"
|
||||
#define TR_ALARMS_LABEL "Alarm"
|
||||
#define TR_BATTERY_RANGE "Batteri range"
|
||||
#define TR_BATTERY_RANGE "Batteri-MinMax"
|
||||
#define TR_BATTERYWARNING INDENT"Batteri"
|
||||
#define TR_INACTIVITYALARM INDENT"Inaktivitet"
|
||||
#define TR_MEMORYWARNING INDENT"Lite Minne"
|
||||
@@ -404,11 +429,11 @@
|
||||
#define TR_THROTTLEREVERSE "Reverserad Gas"
|
||||
#define TR_MINUTEBEEP INDENT"Varje Minut"
|
||||
#define TR_BEEPCOUNTDOWN INDENT"R\201kna Ned"
|
||||
#define TR_PERSISTENT INDENT"Persist."
|
||||
#define TR_PERSISTENT TR("J\201mt p\200 ",INDENT"Alltid P\200")
|
||||
#define TR_BACKLIGHT_LABEL "Belysning"
|
||||
#define TR_BLDELAY INDENT"Av efter"
|
||||
#define TR_BLONBRIGHTNESS INDENT"ON Brightness"
|
||||
#define TR_BLOFFBRIGHTNESS INDENT"OFF Brightness"
|
||||
#define TR_BLONBRIGHTNESS INDENT"P\200 Ljusstyrka"
|
||||
#define TR_BLOFFBRIGHTNESS INDENT"AV Ljusstyrka"
|
||||
#define TR_SPLASHSCREEN "Bild vid start"
|
||||
#define TR_THROTTLEWARNING TR("Gasvarn.","Gasvarning")
|
||||
#define TR_SWITCHWARNING TR("Bryt.varn.","Brytarvarning")
|
||||
@@ -420,20 +445,14 @@
|
||||
#define TR_CAL "Kalib."
|
||||
#define TR_VTRIM "Trim- +"
|
||||
#define TR_BG "BG:"
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#define TR_MENUTOSTART CENTER"\006[ENTER] Startar "
|
||||
#else
|
||||
#define TR_MENUTOSTART CENTER"\006[MENU] Startar "
|
||||
#endif
|
||||
|
||||
#define TR_MENUTOSTART CENTER"\006"TR_ENTER" Startar "
|
||||
#define TR_SETMIDPOINT CENTER"\010Centrera Allt"
|
||||
#define TR_MOVESTICKSPOTS CENTER"\004R\202r Rattar/Spakar"
|
||||
#define TR_RXBATT "Rx Batt:"
|
||||
#define TR_TXnRX "Tx:\0Rx:"
|
||||
#define OFS_RX 4
|
||||
#define TR_ACCEL "Acc:"
|
||||
#define TR_NODATA "NO DATA"
|
||||
#define TR_NODATA CENTER"NO DATA"
|
||||
#define TR_TM1TM2 "TM1\032TM2"
|
||||
#define TR_THRTHP "THR\032TH%"
|
||||
#define TR_TOT "TOT"
|
||||
@@ -443,14 +462,14 @@
|
||||
#define TR_TMR1JITTERUS "Tmr1 Jitter\006us"
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define TR_TMIXMAXMS "Tmix max\012ms"
|
||||
#define TR_TMIXMAXMS "Tmix max\012ms"
|
||||
#else
|
||||
#define TR_TMIXMAXMS "Tmix max\014ms"
|
||||
#define TR_TMIXMAXMS "Tmix max\014ms"
|
||||
#endif
|
||||
|
||||
#define TR_T10MSUS "T10ms\016us"
|
||||
#define TR_FREESTACKMINB "Free Stack\010b"
|
||||
#define TR_MENUTORESET "[MENU] Nollar "
|
||||
#define TR_MENUTORESET CENTER TR_ENTER" Nollar"
|
||||
#define TR_PPM "PPM"
|
||||
#define TR_CH "KN"
|
||||
#define TR_MODEL "Modell"
|
||||
@@ -469,7 +488,7 @@
|
||||
#define TR_MENUDATEANDTIME "Dag och Tid"
|
||||
#define TR_MENUTRAINER "Trainer (PPM in)"
|
||||
#define TR_MENUVERSION "Version"
|
||||
#define TR_MENUDIAG "Diagnos"
|
||||
#define TR_MENUDIAG TR("Brytare","Test av Brytare")
|
||||
#define TR_MENUANA "Analoga V\201rden"
|
||||
#define TR_MENUCALIBRATION "Kalibrering"
|
||||
#define TR_TRIMS2OFFSETS "\004[Spara Trimv\201rden]"
|
||||
@@ -511,8 +530,8 @@
|
||||
#define TR_CURRENT INDENT"Str\202m"
|
||||
#define TR_SELECT_MODEL "V\201lj Modell"
|
||||
#define TR_CREATE_MODEL "Skapa Modell"
|
||||
#define TR_COPY_MODEL "Copy Model"
|
||||
#define TR_MOVE_MODEL "Move Model"
|
||||
#define TR_COPY_MODEL "Kopiera Modell"
|
||||
#define TR_MOVE_MODEL "Flytta Modell"
|
||||
#define TR_BACKUP_MODEL "Modell-backup"
|
||||
#define TR_DELETE_MODEL "Ta Bort Modell"
|
||||
#define TR_RESTORE_MODEL "\203terst\201ll Modell"
|
||||
@@ -569,8 +588,8 @@
|
||||
#define TR_DATE "Datum"
|
||||
#define TR_ROTARY_ENCODER "R.Enks"
|
||||
#define TR_CHANNELS_MONITOR "Kanal\205versikt"
|
||||
#define TR_INTERNALRF "Internal RF"
|
||||
#define TR_EXTERNALRF "External RF"
|
||||
#define TR_FAILSAFE "Failsafe mode"
|
||||
#define TR_FAILSAFESET "FAILSAFE SETTINGS"
|
||||
#define TR_COUNTRYCODE "Country Code"
|
||||
#define TR_INTERNALRF "Intern RF"
|
||||
#define TR_EXTERNALRF "Extern RF"
|
||||
#define TR_FAILSAFE "Failsafe-l\201ge"
|
||||
#define TR_FAILSAFESET "FailsafeInst\201llning"
|
||||
#define TR_COUNTRYCODE "Landskod"
|
||||
|
||||
+26
-15
@@ -101,21 +101,32 @@ enum CzechPrompts {
|
||||
PLAY_FUNCTION(pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
{
|
||||
if (number == 1)
|
||||
PUSH_PROMPT(unitprompt);
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
else if (number > 1 && number < 5)
|
||||
PUSH_PROMPT(unitprompt+1);
|
||||
PUSH_NUMBER_PROMPT(unitprompt+1);
|
||||
else
|
||||
PUSH_PROMPT(unitprompt+2);
|
||||
PUSH_NUMBER_PROMPT(unitprompt+2);
|
||||
}
|
||||
|
||||
PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_PROMPT(PROMPT_MINUS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_METERS) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
// we assume that we are PREC1
|
||||
@@ -123,11 +134,11 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, ZENSKY);
|
||||
if (qr.quot == 0)
|
||||
PUSH_PROMPT(PROMPT_CELA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_CELA);
|
||||
else
|
||||
PUSH_UNIT_PROMPT(qr.quot, PROMPT_CELA);
|
||||
PLAY_NUMBER(qr.rem, 0, ZENSKY);
|
||||
PUSH_PROMPT(PROMPT_UNITS_BASE+((unit-1)*4)+3);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UNITS_BASE+((unit-1)*4)+3);
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -158,17 +169,17 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
}
|
||||
|
||||
if ((number == 1) && (att == MUZSKY)) {
|
||||
PUSH_PROMPT(PROMPT_JEDEN);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_JEDEN);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number == 1) && (att == STREDNI)) {
|
||||
PUSH_PROMPT(PROMPT_JEDNO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_JEDNO);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number == 2) && ((att == ZENSKY) || (att == STREDNI))) {
|
||||
PUSH_PROMPT(PROMPT_DVE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_DVE);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
@@ -176,22 +187,22 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
if (number >= 2000)
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
if (number >= 2000 && number < 5000)
|
||||
PUSH_PROMPT(PROMPT_TISICE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_TISICE);
|
||||
else
|
||||
PUSH_PROMPT(PROMPT_TISIC);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_TISIC);
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_PROMPT(PROMPT_STO + (number/100)-1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_STO + (number/100)-1);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if (number >= 0) {
|
||||
PUSH_PROMPT(PROMPT_NULA+number);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_NULA+number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
@@ -202,7 +213,7 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_PROMPT(PROMPT_MINUS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
|
||||
+29
-17
@@ -89,7 +89,7 @@ enum GermanPrompts {
|
||||
|
||||
#if defined(VOICE)
|
||||
|
||||
PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
/* if digit >= 1000000000:
|
||||
temp_digit, digit = divmod(digit, 1000000000)
|
||||
@@ -102,17 +102,29 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
*/
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_PROMPT(PROMPT_MINUS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_METERS) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
div_t qr = div(number, (mode == 1 ? 10 : 100));
|
||||
if (qr.rem > 0) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_COMMA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_COMMA);
|
||||
if (mode==2 && qr.rem < 10)
|
||||
PUSH_PROMPT(PROMPT_NULL);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_NULL);
|
||||
PLAY_NUMBER(qr.rem, unit, 0);
|
||||
}
|
||||
else {
|
||||
@@ -124,9 +136,9 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
if (number >= 1000) {
|
||||
if (number >= 1100) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_TAUSEND);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_TAUSEND);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_TAUSEND);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_TAUSEND);
|
||||
}
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
@@ -134,23 +146,23 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
}
|
||||
if (number >= 100) {
|
||||
if (number >= 200)
|
||||
PUSH_PROMPT(PROMPT_NULL + number/100);
|
||||
PUSH_PROMPT(PROMPT_HUNDERT);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_NULL + number/100);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_HUNDERT);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
PUSH_PROMPT(PROMPT_NULL+number);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_NULL+number);
|
||||
|
||||
if (unit) {
|
||||
PUSH_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
}
|
||||
}
|
||||
|
||||
PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_PROMPT(PROMPT_MINUS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
@@ -159,7 +171,7 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
seconds %= 3600;
|
||||
if (tmp > 0) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_UHR);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UHR);
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
@@ -167,17 +179,17 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
if (tmp > 0 || ore >0) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
if (tmp != 1) {
|
||||
PUSH_PROMPT(PROMPT_MINUTEN);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUTEN);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_MINUTE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUTE);
|
||||
}
|
||||
PUSH_PROMPT(PROMPT_UND);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UND);
|
||||
}
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
if (seconds != 1) {
|
||||
PUSH_PROMPT(PROMPT_SECUNDEN);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_SECUNDEN);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_SECUNDE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_SECUNDE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+21
-10
@@ -81,25 +81,36 @@ enum EnglishPrompts {
|
||||
PLAY_FUNCTION(pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
{
|
||||
if (number == 1)
|
||||
PUSH_PROMPT(unitprompt);
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
else
|
||||
PUSH_PROMPT(unitprompt+1);
|
||||
PUSH_NUMBER_PROMPT(unitprompt+1);
|
||||
}
|
||||
|
||||
PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
if (number < 0) {
|
||||
PUSH_PROMPT(PROMPT_MINUS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_METERS) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
// we assume that we are PREC1
|
||||
div_t qr = div(number, 10);
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_POINT_BASE + qr.rem);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_POINT_BASE + qr.rem);
|
||||
number = -1;
|
||||
}
|
||||
else {
|
||||
@@ -111,19 +122,19 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
|
||||
if (number >= 1000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_THOUSAND);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_THOUSAND);
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_PROMPT(PROMPT_HUNDRED + (number/100)-1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_HUNDRED + (number/100)-1);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 0) {
|
||||
PUSH_PROMPT(PROMPT_ZERO + number);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO + number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
@@ -134,7 +145,7 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_PROMPT(PROMPT_MINUS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
@@ -149,7 +160,7 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
if (tmp > 0) {
|
||||
PLAY_NUMBER(tmp, UNIT_MINUTES+1 , 0);
|
||||
if (seconds > 0)
|
||||
PUSH_PROMPT(PROMPT_AND);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_AND);
|
||||
}
|
||||
|
||||
if (seconds > 0) {
|
||||
|
||||
+32
-20
@@ -113,7 +113,7 @@ enum SpanishPrompts {
|
||||
|
||||
#if defined(VOICE)
|
||||
|
||||
PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
/* if digit >= 1000000000:
|
||||
temp_digit, digit = divmod(digit, 1000000000)
|
||||
@@ -126,17 +126,29 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
*/
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_PROMPT(PROMPT_MENO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MENO);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_METERS) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
div_t qr = div(number, (mode == 1 ? 10 : 100));
|
||||
if (qr.rem > 0) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_VIRGOLA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_VIRGOLA);
|
||||
if (mode==2 && qr.rem < 10)
|
||||
PUSH_PROMPT(PROMPT_ZERO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO);
|
||||
PLAY_NUMBER(qr.rem, unit, 0);
|
||||
}
|
||||
else {
|
||||
@@ -148,31 +160,31 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
if (number >= 1000) {
|
||||
if (number >= 2000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_MIL);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MIL);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_MIL);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MIL);
|
||||
}
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_PROMPT(PROMPT_CIENTO + number/100);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_CIENTO + number/100);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
PUSH_PROMPT(PROMPT_ZERO+number);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO+number);
|
||||
|
||||
if (unit) {
|
||||
PUSH_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
}
|
||||
}
|
||||
|
||||
PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_PROMPT(PROMPT_MENO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MENO);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
@@ -183,10 +195,10 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
ore=tmp;
|
||||
if (tmp > 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_HORAS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_HORAS);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_UNA);
|
||||
PUSH_PROMPT(PROMPT_HORA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UNA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_HORA);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,20 +207,20 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
if (tmp > 0 || ore >0) {
|
||||
if (tmp != 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_MINUTOS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUTOS);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_UN);
|
||||
PUSH_PROMPT(PROMPT_MINUTO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUTO);
|
||||
}
|
||||
PUSH_PROMPT(PROMPT_Y);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_Y);
|
||||
}
|
||||
|
||||
if (seconds != 1) {
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_SEGUNDOS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_SEGUNDOS);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_UN);
|
||||
PUSH_PROMPT(PROMPT_SEGUNDO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_SEGUNDO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+25
-14
@@ -95,7 +95,7 @@ enum FrenchPrompts {
|
||||
|
||||
#define FEMININ 0x80
|
||||
|
||||
PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
/* if digit >= 1000000000:
|
||||
temp_digit, digit = divmod(digit, 1000000000)
|
||||
@@ -108,17 +108,28 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
*/
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_PROMPT(PROMPT_MOINS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MOINS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_METERS) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
// we assume that we are PREC1
|
||||
div_t qr = div(number, 10);
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_VIRGULE_BASE + qr.rem);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_VIRGULE_BASE + qr.rem);
|
||||
number = -1;
|
||||
}
|
||||
else {
|
||||
@@ -129,35 +140,35 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
if (number >= 1000) {
|
||||
if (number >= 2000)
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_MILLE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MILLE);
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
if (number >= 200)
|
||||
PUSH_PROMPT(PROMPT_ZERO + number/100);
|
||||
PUSH_PROMPT(PROMPT_CENT);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO + number/100);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_CENT);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (((number % 10) == 1) && number < 90 && (att & FEMININ)) {
|
||||
PUSH_PROMPT(PROMPT_UNE+(number/10));
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UNE+(number/10));
|
||||
}
|
||||
else if (number >= 0) {
|
||||
PUSH_PROMPT(PROMPT_ZERO+number);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO+number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
PUSH_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
}
|
||||
}
|
||||
|
||||
PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_PROMPT(PROMPT_MOINS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MOINS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
@@ -165,21 +176,21 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
seconds %= 3600;
|
||||
if (tmp > 0) {
|
||||
PLAY_NUMBER(tmp, 0, FEMININ);
|
||||
PUSH_PROMPT(PROMPT_HEURE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_HEURE);
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
if (tmp > 0) {
|
||||
PLAY_NUMBER(tmp, 0, FEMININ);
|
||||
PUSH_PROMPT(PROMPT_MINUTE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUTE);
|
||||
if (seconds > 0)
|
||||
PUSH_PROMPT(PROMPT_ET);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ET);
|
||||
}
|
||||
|
||||
if (seconds > 0) {
|
||||
PLAY_NUMBER(seconds, 0, FEMININ);
|
||||
PUSH_PROMPT(PROMPT_SECONDE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_SECONDE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+33
-21
@@ -85,7 +85,7 @@ enum ItalianPrompts {
|
||||
|
||||
#if defined(VOICE)
|
||||
|
||||
PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
/* if digit >= 1000000000:
|
||||
temp_digit, digit = divmod(digit, 1000000000)
|
||||
@@ -98,17 +98,29 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
*/
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_PROMPT(PROMPT_MENO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MENO);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_METERS) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
div_t qr = div(number, (mode == 1 ? 10 : 100));
|
||||
if (qr.rem > 0) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_VIRGOLA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_VIRGOLA);
|
||||
if (mode==2 && qr.rem < 10)
|
||||
PUSH_PROMPT(PROMPT_ZERO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO);
|
||||
PLAY_NUMBER(qr.rem, unit, 0);
|
||||
}
|
||||
else {
|
||||
@@ -120,9 +132,9 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
if (number >= 1000) {
|
||||
if (number >= 2000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_MILA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MILA);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_MILLE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MILLE);
|
||||
}
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
@@ -130,23 +142,23 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
}
|
||||
if (number >= 100) {
|
||||
if (number >= 200)
|
||||
PUSH_PROMPT(PROMPT_ZERO + number/100);
|
||||
PUSH_PROMPT(PROMPT_CENT);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO + number/100);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_CENT);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
PUSH_PROMPT(PROMPT_ZERO+number);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO+number);
|
||||
|
||||
if (unit) {
|
||||
PUSH_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
}
|
||||
}
|
||||
|
||||
PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_PROMPT(PROMPT_MENO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MENO);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
@@ -157,10 +169,10 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
ore=tmp;
|
||||
if (tmp > 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_ORE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ORE);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_UN);
|
||||
PUSH_PROMPT(PROMPT_ORA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ORA);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,20 +181,20 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
if (tmp > 0 || ore >0) {
|
||||
if (tmp != 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_MINUTI);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUTI);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_UN);
|
||||
PUSH_PROMPT(PROMPT_MINUTO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUTO);
|
||||
}
|
||||
PUSH_PROMPT(PROMPT_E);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_E);
|
||||
}
|
||||
|
||||
if (seconds != 1) {
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_SECONDI);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_SECONDI);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_UN);
|
||||
PUSH_PROMPT(PROMPT_SECONDO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_SECONDO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+34
-22
@@ -108,20 +108,32 @@ enum PortuguesePrompts {
|
||||
|
||||
#if defined(VOICE)
|
||||
|
||||
PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
if (number < 0) {
|
||||
PUSH_PROMPT(PROMPT_MENOS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MENOS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_METERS) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
div_t qr = div(number, (mode == 1 ? 10 : 100));
|
||||
if (qr.rem > 0) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_VIRGULA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_VIRGULA);
|
||||
if (mode==2 && qr.rem < 10)
|
||||
PUSH_PROMPT(PROMPT_ZERO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO);
|
||||
PLAY_NUMBER(qr.rem, unit, 0);
|
||||
}
|
||||
else {
|
||||
@@ -133,31 +145,31 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
if (number >= 1000) {
|
||||
if (number >= 2000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_MIL);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MIL);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_MIL);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MIL);
|
||||
}
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_PROMPT(PROMPT_CENTO + number/100);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_CENTO + number/100);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
PUSH_PROMPT(PROMPT_ZERO+number);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_ZERO+number);
|
||||
|
||||
if (unit) {
|
||||
PUSH_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UNITS_BASE+unit-1);
|
||||
}
|
||||
}
|
||||
|
||||
PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_PROMPT(PROMPT_MENOS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MENOS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
@@ -168,13 +180,13 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
ore=tmp;
|
||||
if (tmp > 2) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_HORAS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_HORAS);
|
||||
} else if (tmp==2) {
|
||||
PUSH_PROMPT(PROMPT_DUAS);
|
||||
PUSH_PROMPT(PROMPT_HORAS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_DUAS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_HORAS);
|
||||
} else if (tmp==1) {
|
||||
PUSH_PROMPT(PROMPT_UMA);
|
||||
PUSH_PROMPT(PROMPT_HORA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UMA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_HORA);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,20 +195,20 @@ PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
if (tmp > 0 || ore >0) {
|
||||
if (tmp != 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_MINUTOS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUTOS);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_NUMBERS_BASE+1);
|
||||
PUSH_PROMPT(PROMPT_MINUTO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_NUMBERS_BASE+1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUTO);
|
||||
}
|
||||
PUSH_PROMPT(PROMPT_E);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_E);
|
||||
}
|
||||
|
||||
if (seconds != 1) {
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
PUSH_PROMPT(PROMPT_SEGUNDOS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_SEGUNDOS);
|
||||
} else {
|
||||
PUSH_PROMPT(PROMPT_NUMBERS_BASE+1);
|
||||
PUSH_PROMPT(PROMPT_SEGUNDO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_NUMBERS_BASE+1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_SEGUNDO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+26
-15
@@ -116,21 +116,32 @@ enum SlovakPrompts {
|
||||
PLAY_FUNCTION(pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
{
|
||||
if (number == 1)
|
||||
PUSH_PROMPT(unitprompt);
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
else if (number > 1 && number < 5)
|
||||
PUSH_PROMPT(unitprompt+1);
|
||||
PUSH_NUMBER_PROMPT(unitprompt+1);
|
||||
else
|
||||
PUSH_PROMPT(unitprompt+2);
|
||||
PUSH_NUMBER_PROMPT(unitprompt+2);
|
||||
}
|
||||
|
||||
PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_PROMPT(PROMPT_MINUS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_METERS) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
// we assume that we are PREC1
|
||||
@@ -138,11 +149,11 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, ZENSKY);
|
||||
if (qr.quot == 0)
|
||||
PUSH_PROMPT(PROMPT_CELA);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_CELA);
|
||||
else
|
||||
PUSH_UNIT_PROMPT(qr.quot, PROMPT_CELA);
|
||||
PLAY_NUMBER(qr.rem, 0, ZENSKY);
|
||||
PUSH_PROMPT(PROMPT_UNITS_BASE+((unit-1)*4)+3);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_UNITS_BASE+((unit-1)*4)+3);
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -173,17 +184,17 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
}
|
||||
|
||||
if ((number == 1) && (att == MUZSKY)) {
|
||||
PUSH_PROMPT(PROMPT_JEDEN);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_JEDEN);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number == 1) && (att == STREDNI)) {
|
||||
PUSH_PROMPT(PROMPT_JEDNO);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_JEDNO);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number == 2) && ((att == ZENSKY) || (att == STREDNI))) {
|
||||
PUSH_PROMPT(PROMPT_DVE);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_DVE);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
@@ -191,23 +202,23 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
if (number >= 3000)
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
if (number >= 2000 && number < 3000)
|
||||
PUSH_PROMPT(PROMPT_DVETISIC);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_DVETISIC);
|
||||
else
|
||||
PUSH_PROMPT(PROMPT_TISIC);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_TISIC);
|
||||
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_PROMPT(PROMPT_STO + (number/100)-1);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_STO + (number/100)-1);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if (number >= 0) {
|
||||
PUSH_PROMPT(PROMPT_NULA+number);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_NULA+number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
@@ -218,7 +229,7 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
|
||||
PLAY_FUNCTION(playDuration, int16_t seconds)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_PROMPT(PROMPT_MINUS);
|
||||
PUSH_NUMBER_PROMPT(PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
|
||||
+58
-18
@@ -217,12 +217,12 @@ void displaySliders()
|
||||
#define BAR_VOLUME_X BAR_X+147
|
||||
#define BAR_TIME_X BAR_X+168
|
||||
|
||||
void displayTopBarGauge(xcoord_t x, uint8_t count, bool blinking=false)
|
||||
void displayTopBarGauge(xcoord_t x, int count, bool blinking=false)
|
||||
{
|
||||
if (!blinking || BLINK_ON_PHASE)
|
||||
lcd_filled_rect(x+1, BAR_Y+2, 11, 5, SOLID, ERASE);
|
||||
count = min((uint8_t)10, count);
|
||||
for (uint8_t i=0; i<count; i+=2)
|
||||
count = min(10, count);
|
||||
for (int i=0; i<count; i+=2)
|
||||
lcd_vline(x+2+i, BAR_Y+3, 3);
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ void displayTopBar()
|
||||
LCD_NOTIF_ICON(x, ICON_TRAINEE);
|
||||
x -= 12;
|
||||
}
|
||||
else if (1) {
|
||||
else if (0) {
|
||||
LCD_NOTIF_ICON(x, ICON_TRAINER);
|
||||
x -= 12;
|
||||
}
|
||||
@@ -302,7 +302,7 @@ void displayTopBar()
|
||||
lcd_filled_rect(BAR_X, BAR_Y, BAR_W, BAR_H, SOLID, FILL_WHITE|GREY_DEFAULT|ROUND);
|
||||
|
||||
/* The inside of the Batt gauge */
|
||||
uint8_t count = 10 * (g_vbat100mV - g_eeGeneral.vBatMin - 90) / (30 + g_eeGeneral.vBatMax - g_eeGeneral.vBatMin);
|
||||
int count = 10 * (g_vbat100mV - g_eeGeneral.vBatMin - 90) / (30 + g_eeGeneral.vBatMax - g_eeGeneral.vBatMin);
|
||||
displayTopBarGauge(BAR_BATT_X+FW, count, g_vbat100mV <= g_eeGeneral.vBatWarn);
|
||||
|
||||
/* The inside of the RSSI gauge */
|
||||
@@ -396,19 +396,20 @@ void displayVoltageOrAlarm()
|
||||
#define displayVoltageOrAlarm() displayBattVoltage()
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBACT)
|
||||
#if defined(PCBTARANIS)
|
||||
#define EVT_KEY_MODEL_MENU EVT_KEY_BREAK(KEY_MENU)
|
||||
#define EVT_KEY_GENERAL_MENU EVT_KEY_LONG(KEY_MENU)
|
||||
#define EVT_KEY_TELEMETRY EVT_KEY_LONG(KEY_PAGE)
|
||||
#define EVT_KEY_STATISTICS EVT_KEY_LONG(KEY_ENTER)
|
||||
#define EVT_KEY_CONTEXT_MENU EVT_KEY_LONG(KEY_ENTER)
|
||||
#else
|
||||
#define EVT_KEY_MODEL_MENU EVT_KEY_LONG(KEY_RIGHT)
|
||||
#define EVT_KEY_GENERAL_MENU EVT_KEY_LONG(KEY_LEFT)
|
||||
#define EVT_KEY_TELEMETRY EVT_KEY_LONG(KEY_DOWN)
|
||||
#define EVT_KEY_STATISTICS EVT_KEY_LONG(KEY_UP)
|
||||
#define EVT_KEY_CONTEXT_MENU EVT_KEY_BREAK(KEY_MENU)
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBACT)
|
||||
#if defined(PCBTARANIS)
|
||||
void menuMainViewChannelsMonitor(uint8_t event)
|
||||
{
|
||||
switch(event) {
|
||||
@@ -422,9 +423,32 @@ void menuMainViewChannelsMonitor(uint8_t event)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
void onMainViewMenu(const char *result)
|
||||
{
|
||||
if (result == STR_RESET_TIMER1) {
|
||||
resetTimer(0);
|
||||
}
|
||||
else if (result == STR_RESET_TIMER2) {
|
||||
resetTimer(1);
|
||||
}
|
||||
#if defined(FRSKY)
|
||||
else if (result == STR_RESET_TELEMETRY) {
|
||||
resetTelemetry();
|
||||
}
|
||||
#endif
|
||||
else if (result == STR_RESET_FLIGHT) {
|
||||
resetAll();
|
||||
}
|
||||
else if (result == STR_STATISTICS) {
|
||||
chainMenu(menuStatisticsView);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void menuMainView(uint8_t event)
|
||||
{
|
||||
#if !defined(PCBTARANIS) && !defined(PCBACT)
|
||||
#if !defined(PCBTARANIS)
|
||||
uint8_t view = g_eeGeneral.view;
|
||||
uint8_t view_base = view & 0x0f;
|
||||
#endif
|
||||
@@ -442,7 +466,7 @@ void menuMainView(uint8_t event)
|
||||
killEvents(KEY_DOWN);
|
||||
break;
|
||||
|
||||
#if !defined(PCBTARANIS) && !defined(PCBACT)
|
||||
#if !defined(PCBTARANIS)
|
||||
/* TODO if timer2 is OFF, it's possible to use this timer2 as in er9x...
|
||||
case EVT_KEY_BREAK(KEY_MENU):
|
||||
if (view_base == VIEW_TIMER2) {
|
||||
@@ -469,8 +493,22 @@ void menuMainView(uint8_t event)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
case EVT_KEY_CONTEXT_MENU:
|
||||
killEvents(event);
|
||||
MENU_ADD_ITEM(STR_RESET_FLIGHT);
|
||||
MENU_ADD_ITEM(STR_RESET_TIMER1);
|
||||
MENU_ADD_ITEM(STR_RESET_TIMER2);
|
||||
#if defined(FRSKY)
|
||||
MENU_ADD_ITEM(STR_RESET_TELEMETRY);
|
||||
#endif
|
||||
MENU_ADD_ITEM(STR_STATISTICS);
|
||||
menuHandler = onMainViewMenu;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if !defined(READONLY)
|
||||
#if !defined(PCBTARANIS) && !defined(PCBACT)
|
||||
#if !defined(PCBTARANIS)
|
||||
case EVT_KEY_LONG(KEY_MENU):// go to last menu
|
||||
pushMenu(lastPopMenu());
|
||||
killEvents(event);
|
||||
@@ -490,7 +528,7 @@ void menuMainView(uint8_t event)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBACT)
|
||||
#if defined(PCBTARANIS)
|
||||
case EVT_KEY_BREAK(KEY_PAGE):
|
||||
eeDirty(EE_GENERAL);
|
||||
g_eeGeneral.view += 1;
|
||||
@@ -509,10 +547,12 @@ void menuMainView(uint8_t event)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if !defined(PCBTARANIS)
|
||||
case EVT_KEY_STATISTICS:
|
||||
chainMenu(menuStatisticsView);
|
||||
killEvents(event);
|
||||
return;
|
||||
#endif
|
||||
|
||||
case EVT_KEY_TELEMETRY:
|
||||
#if defined(FRSKY)
|
||||
@@ -546,7 +586,7 @@ void menuMainView(uint8_t event)
|
||||
s_gvar_timer = 0;
|
||||
}
|
||||
#endif
|
||||
#if LCD_W < 212
|
||||
#if !defined(PCBTARANIS)
|
||||
else if (view == VIEW_TIMER2) {
|
||||
resetTimer(1);
|
||||
}
|
||||
@@ -594,8 +634,8 @@ void menuMainView(uint8_t event)
|
||||
|
||||
// Switches
|
||||
for (uint8_t i=0; i<8; i++) {
|
||||
uint8_t sw;
|
||||
int16_t val;
|
||||
getvalue_t sw;
|
||||
getvalue_t val;
|
||||
// TODO simplify this + reuse code in checkSwitches() + Menu MODELSETUP
|
||||
switch(i) {
|
||||
case 5:
|
||||
@@ -725,7 +765,7 @@ void menuMainView(uint8_t event)
|
||||
}
|
||||
#endif // PCBGRUVIN9X && ROTARY_ENCODERS
|
||||
|
||||
// Curstom Switches
|
||||
// Custom Switches
|
||||
#if defined(PCBSKY9X)
|
||||
for (uint8_t i=0; i<NUM_CSW; i++) {
|
||||
int8_t len = getSwitch(SWSRC_SW1+i, 0) ? BAR_HEIGHT : 1;
|
||||
@@ -739,7 +779,7 @@ void menuMainView(uint8_t event)
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
for (uint8_t i=0; i<NUM_CSW; i++)
|
||||
putsSwitches(2*FW-2 + (i/3)*(4*FW-2) + (i/3>1 ? 3*FW : 0), 4*FH+1 + (i%3)*FH, SWSRC_SW1+i, getSwitch(SWSRC_SW1+i, 0) ? INVERS : 0);
|
||||
#elif !defined(CPUM64)
|
||||
#elif !defined(PCBSTD)
|
||||
for (uint8_t i=0; i<NUM_CSW; i++)
|
||||
putsSwitches(2*FW-2 + (i/3)*(4*FW-1), 4*FH+1 + (i%3)*FH, SWSRC_SW1+i, getSwitch(SWSRC_SW1+i, 0) ? INVERS : 0);
|
||||
#else
|
||||
@@ -774,7 +814,7 @@ void menuMainView(uint8_t event)
|
||||
s_gvar_timer--;
|
||||
s_warning = PSTR("Global Variable");
|
||||
displayBox();
|
||||
#if defined(CPUM64)
|
||||
#if defined(PCBSTD)
|
||||
lcd_putsAtt(16+4*FW, 5*FH, PSTR("[\010]"), BOLD);
|
||||
lcd_outdezAtt(16+4*FW+4*FW+FW/2, 5*FH, GVAR_VALUE(s_gvar_last, s_perout_flight_phase), BOLD);
|
||||
#else
|
||||
|
||||
+32
-20
@@ -199,15 +199,15 @@ void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val,
|
||||
putsTelemetryValue(x, y, val, UNIT_RAW, att);
|
||||
break;
|
||||
|
||||
#if LCD_W >= 212
|
||||
#if defined(FRSKY_SPORT)
|
||||
case TELEM_ALT-1:
|
||||
putsTelemetryValue(x, y, val/10, UNIT_METERS, att|PREC1);
|
||||
break;
|
||||
#elif defined(IMPERIAL_UNITS)
|
||||
#elif defined(WS_HOW_HIGH)
|
||||
case TELEM_ALT-1:
|
||||
case TELEM_MIN_ALT-1:
|
||||
case TELEM_MAX_ALT-1:
|
||||
if (g_model.frsky.usrProto == USR_PROTO_WS_HOW_HIGH) {
|
||||
if (IS_IMPERIAL_ENABLE() && IS_USR_PROTO_WS_HOW_HIGH()) {
|
||||
putsTelemetryValue(x, y, val, UNIT_FEET, att);
|
||||
break;
|
||||
}
|
||||
@@ -242,7 +242,7 @@ enum FrskyViews {
|
||||
|
||||
static uint8_t s_frsky_view = e_frsky_custom_screen_1;
|
||||
|
||||
#if LCD_W == 212
|
||||
#if LCD_W >= 212
|
||||
void displayRssiLine()
|
||||
{
|
||||
if (frskyStreaming > 0) {
|
||||
@@ -337,7 +337,7 @@ NOINLINE uint8_t getRssiAlarmValue(uint8_t alarm)
|
||||
void displayVoltageScreenLine(uint8_t y, uint8_t index)
|
||||
{
|
||||
putsStrIdx(0, y, STR_A, index+1, 0);
|
||||
putsTelemetryChannel(3*FW+6*FW+4, y, index+TELEM_A1-1, frskyData.analog[index].value, DBLSIZE);
|
||||
putsTelemetryChannel(3*FW+6*FW+4, y-FH+1, index+TELEM_A1-1, frskyData.analog[index].value, DBLSIZE);
|
||||
lcd_putc(12*FW-1, y-FH, '<'); putsTelemetryChannel(17*FW, y-FH, index+TELEM_A1-1, frskyData.analog[index].min, NO_UNIT);
|
||||
lcd_putc(12*FW, y, '>'); putsTelemetryChannel(17*FW, y, index+TELEM_A1-1, frskyData.analog[index].max, NO_UNIT);
|
||||
}
|
||||
@@ -360,14 +360,26 @@ void menuTelemetryFrsky(uint8_t event)
|
||||
s_frsky_view = FRSKY_VIEW_MAX;
|
||||
break;
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
case EVT_KEY_BREAK(KEY_PAGE):
|
||||
#endif
|
||||
case EVT_KEY_BREAK(KEY_DOWN):
|
||||
if (s_frsky_view++ == FRSKY_VIEW_MAX)
|
||||
s_frsky_view = 0;
|
||||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_MENU):
|
||||
#if defined(PCBTARANIS)
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
killEvents(event);
|
||||
MENU_ADD_ITEM(STR_RESET_TELEMETRY);
|
||||
MENU_ADD_ITEM(STR_RESET_FLIGHT);
|
||||
menuHandler = onMainViewMenu;
|
||||
break;
|
||||
#else
|
||||
case EVT_KEY_FIRST(KEY_ENTER):
|
||||
resetTelemetry();
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
lcdDrawTelemetryTopBar();
|
||||
@@ -381,14 +393,14 @@ void menuTelemetryFrsky(uint8_t event)
|
||||
for (int8_t i=3; i>=0; i--) {
|
||||
FrSkyBarData & bar = screen.bars[i];
|
||||
uint8_t source = bar.source;
|
||||
int16_t barMin = convertTelemValue(source, bar.barMin);
|
||||
int16_t barMax = convertTelemValue(source, 255-bar.barMax);
|
||||
getvalue_t barMin = convertTelemValue(source, bar.barMin);
|
||||
getvalue_t barMax = convertTelemValue(source, 255-bar.barMax);
|
||||
if (source && barMax > barMin) {
|
||||
uint8_t y = barHeight+6+i*(barHeight+6);
|
||||
lcd_putsiAtt(0, y+barHeight-5, STR_VTELEMCHNS, source, 0);
|
||||
lcd_rect(25, y, 101, barHeight+2);
|
||||
int16_t value = getValue(MIXSRC_FIRST_TELEM+source-2);
|
||||
int16_t threshold = 0;
|
||||
getvalue_t value = getValue(MIXSRC_FIRST_TELEM+source-2);
|
||||
getvalue_t threshold = 0;
|
||||
uint8_t thresholdX = 0;
|
||||
if (source <= TELEM_TM2)
|
||||
threshold = 0;
|
||||
@@ -490,20 +502,20 @@ void menuTelemetryFrsky(uint8_t event)
|
||||
}
|
||||
else if (s_frsky_view == e_frsky_voltages) {
|
||||
// Volts / Amps / Watts / mAh
|
||||
uint8_t other = 0;
|
||||
uint8_t analog = 0;
|
||||
lcd_putsiAtt(0, 2*FH, STR_VOLTSRC, g_model.frsky.voltsSource+1, 0);
|
||||
switch(g_model.frsky.voltsSource) {
|
||||
case 0:
|
||||
case 1:
|
||||
displayVoltageScreenLine(2*FH, g_model.frsky.voltsSource);
|
||||
other = !g_model.frsky.voltsSource;
|
||||
analog = 1+g_model.frsky.voltsSource;
|
||||
break;
|
||||
#if defined(FRSKY_HUB)
|
||||
case 2:
|
||||
putsTelemetryChannel(3*FW+6*FW+4, 2*FH, TELEM_VFAS-1, frskyData.hub.vfas, DBLSIZE);
|
||||
putsTelemetryChannel(3*FW+6*FW+4, FH+1, TELEM_VFAS-1, frskyData.hub.vfas, DBLSIZE);
|
||||
break;
|
||||
case 3:
|
||||
putsTelemetryChannel(3*FW+6*FW+4, 2*FH, TELEM_CELLS_SUM-1, frskyData.hub.cellsSum, DBLSIZE);
|
||||
putsTelemetryChannel(3*FW+6*FW+4, FH+1, TELEM_CELLS_SUM-1, frskyData.hub.cellsSum, DBLSIZE);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
@@ -517,17 +529,17 @@ void menuTelemetryFrsky(uint8_t event)
|
||||
break;
|
||||
#if defined(FRSKY_HUB)
|
||||
case 3:
|
||||
putsTelemetryChannel(3*FW+6*FW+4, 4*FH, TELEM_CURRENT-1, frskyData.hub.current, DBLSIZE);
|
||||
putsTelemetryChannel(3*FW+6*FW+4, 3*FH+1, TELEM_CURRENT-1, frskyData.hub.current, DBLSIZE);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
putsTelemetryChannel(4, 6*FH, TELEM_POWER-1, frskyData.power, LEFT|DBLSIZE);
|
||||
putsTelemetryChannel(3*FW+4+4*FW+6*FW+FW, 6*FH, TELEM_CONSUMPTION-1, frskyData.currentConsumption, DBLSIZE);
|
||||
putsTelemetryChannel(4, 5*FH+1, TELEM_POWER-1, frskyData.power, LEFT|DBLSIZE);
|
||||
putsTelemetryChannel(3*FW+4+4*FW+6*FW+FW, 5*FH+1, TELEM_CONSUMPTION-1, frskyData.currentConsumption, DBLSIZE);
|
||||
}
|
||||
else {
|
||||
displayVoltageScreenLine(other ? 5*FH : 4*FH, other);
|
||||
if (!other) displayVoltageScreenLine(6*FH, 1);
|
||||
displayVoltageScreenLine(analog > 0 ? 5*FH : 4*FH, analog ? 2-analog : 0);
|
||||
if (analog == 0) displayVoltageScreenLine(6*FH, 1);
|
||||
}
|
||||
|
||||
#if defined(FRSKY_HUB)
|
||||
@@ -548,7 +560,7 @@ void menuTelemetryFrsky(uint8_t event)
|
||||
#if defined(FRSKY_HUB)
|
||||
else if (s_frsky_view == e_frsky_after_flight) {
|
||||
uint8_t line=1*FH+1;
|
||||
if (g_model.frsky.usrProto == USR_PROTO_FRSKY) {
|
||||
if (IS_USR_PROTO_FRSKY_HUB()) {
|
||||
// Latitude
|
||||
lcd_putsLeft(line, STR_LATITUDE);
|
||||
displayGpsCoord(line, frskyData.hub.gpsLatitudeNS, frskyData.hub.gpsLatitude_bp, frskyData.hub.gpsLatitude_ap);
|
||||
|
||||
+127
-121
@@ -24,10 +24,10 @@
|
||||
# Italian : Romolo Manfredini
|
||||
# Czeck : Martin Hotar
|
||||
|
||||
|
||||
|
||||
import os, sys, shutil, platform, subprocess, wave, zipfile
|
||||
|
||||
NO_ALTERNATE = 1024
|
||||
|
||||
def generate(str, idx, alternate=0):
|
||||
result = None
|
||||
if "speak" in sys.argv:
|
||||
@@ -43,7 +43,7 @@ def generate(str, idx, alternate=0):
|
||||
elif board == 'sky9x':
|
||||
result = idx + ".wav"
|
||||
else:
|
||||
if alternate == 0:
|
||||
if alternate >= NO_ALTERNATE:
|
||||
return []
|
||||
result = "%04d.wav" % alternate
|
||||
|
||||
@@ -122,10 +122,16 @@ if __name__ == "__main__":
|
||||
|
||||
if "sky9x" in sys.argv:
|
||||
board = "sky9x"
|
||||
PROMPT_CUSTOM_BASE = 256
|
||||
PROMPT_SYSTEM_BASE = 0
|
||||
elif "gruvin9x" in sys.argv:
|
||||
board = "gruvin9x"
|
||||
PROMPT_CUSTOM_BASE = 0
|
||||
PROMPT_SYSTEM_BASE = 256
|
||||
else:
|
||||
board = "stock"
|
||||
PROMPT_CUSTOM_BASE = 0
|
||||
PROMPT_SYSTEM_BASE = 256
|
||||
|
||||
if "sapi" in sys.argv:
|
||||
import pyTTS
|
||||
@@ -164,11 +170,11 @@ if __name__ == "__main__":
|
||||
voice = "english"
|
||||
|
||||
for i in range(100):
|
||||
systemSounds.extend(generate(str(i), i))
|
||||
systemSounds.extend(generate(str(i), PROMPT_SYSTEM_BASE+i))
|
||||
for i in range(9):
|
||||
systemSounds.extend(generate(str(100*(i+1)), 100+i))
|
||||
systemSounds.extend(generate(str(100*(i+1)), PROMPT_SYSTEM_BASE+100+i))
|
||||
for i, s in enumerate(["thousand", "and", "minus", "point"]):
|
||||
systemSounds.extend(generate(s, 109+i))
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+109+i))
|
||||
for i, s in enumerate(["volt", "volts",
|
||||
"amp", "amps",
|
||||
"meter per second", "meters per second",
|
||||
@@ -188,22 +194,22 @@ if __name__ == "__main__":
|
||||
"second", "seconds",
|
||||
"r p m", "r p m",
|
||||
"g", "g"]):
|
||||
systemSounds.extend(generate(s, 115+i))
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+115+i))
|
||||
for i, s in enumerate(["point zero", "point one", "point two", "point three",
|
||||
"point four", "point five", "point six",
|
||||
"point seven", "point eight", "point nine"]):
|
||||
systemSounds.extend(generate(s, 160+i))
|
||||
for s, f, a in [(u"trim center", "midtrim", 244),
|
||||
(u"maximum trim reached", "endtrim", 0),
|
||||
(u"transmitter battery low", "lowbatt", 231),
|
||||
(u"inactivity alarm", "inactiv", 230),
|
||||
(u"throttle warning", "thralert", 232),
|
||||
(u"switch warning", "swalert", 233),
|
||||
(u"Welcome to open nine ex!", "tada", 245),
|
||||
(u"tick. tock", "timerlt3", 250),
|
||||
(u"ten. seconds", "timer10", 251),
|
||||
(u"twenty. seconds", "timer20", 252),
|
||||
(u"thirty. seconds", "timer30", 253),
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+160+i))
|
||||
for s, f, a in [(u"trim center", "midtrim", 494),
|
||||
(u"maximum trim reached", "endtrim", NO_ALTERNATE),
|
||||
(u"transmitter battery low", "lowbatt", 481),
|
||||
(u"inactivity alarm", "inactiv", 480),
|
||||
(u"throttle warning", "thralert", 482),
|
||||
(u"switch warning", "swalert", 483),
|
||||
(u"Welcome to open nine ex!", "tada", 495),
|
||||
(u"tick. tock", "timerlt3", 500),
|
||||
(u"ten. seconds", "timer10", 501),
|
||||
(u"twenty. seconds", "timer20", 502),
|
||||
(u"thirty. seconds", "timer30", 503),
|
||||
]:
|
||||
systemSounds.extend(generate(s, f, a))
|
||||
for i, (s, f) in enumerate([
|
||||
@@ -244,7 +250,7 @@ if __name__ == "__main__":
|
||||
(u"flight mode!, normal", "fm-nrm"),
|
||||
(u"flight mode!, cruise", "fm-crs"),
|
||||
]):
|
||||
sounds.extend(generate(s, f, 256+i))
|
||||
sounds.extend(generate(s, f, PROMPT_CUSTOM_BASE+i))
|
||||
|
||||
|
||||
elif "fr" in sys.argv:
|
||||
@@ -257,22 +263,22 @@ if __name__ == "__main__":
|
||||
voice = "french"
|
||||
|
||||
for i in range(100):
|
||||
systemSounds.extend(generate(str(i), i))
|
||||
systemSounds.extend(generate(str(i), PROMPT_SYSTEM_BASE+i))
|
||||
for i in range(10):
|
||||
systemSounds.extend(generate(str(100*(i+1)), 100+i))
|
||||
systemSounds.extend(generate(str(100*(i+1)), PROMPT_SYSTEM_BASE+100+i))
|
||||
for i, s in enumerate(["une", "onze", "vingt et une", "trente et une", "quarante et une", "cinquante et une", "soixante et une", "soixante et onze", "quatre vingt une"]):
|
||||
systemSounds.extend(generate(s, 110+i))
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+110+i))
|
||||
for i, s in enumerate(["virgule", "et", "moins"]):
|
||||
systemSounds.extend(generate(s, 119+i))
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+119+i))
|
||||
for i, s in enumerate(["volts", u"ampères", u"mètres seconde", "", "km heure", u"mètres", u"degrés", "pourcents", u"milli ampères", u"milli ampères / heure", "watt", "db", "pieds", "knotts", "heure", "minute", "seconde", "tours par minute", "g"]):
|
||||
systemSounds.extend(generate(s, 125+i))
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+125+i))
|
||||
for i, s in enumerate(["timer", "", "tension", "tension", u"émission", u"réception", "altitude", "moteur",
|
||||
"essence", u"température", u"température", "vitesse", "distance", "altitude", u"élément lipo",
|
||||
"total lipo", "tension", "courant", "consommation", "puissance", u"accelération X", u"accelération Y", u"accelération Z",
|
||||
"orientation", "vario"]):
|
||||
systemSounds.extend(generate(s, 146+i))
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+146+i))
|
||||
for i, s in enumerate(["virgule 0", "virgule 1", "virgule 2", "virgule 3", "virgule 4", "virgule 5", "virgule 6", "virgule 7", "virgule 8", "virgule 9"]):
|
||||
systemSounds.extend(generate(s, 180+i))
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+180+i))
|
||||
for i, (s, f) in enumerate([
|
||||
(u"train rentré", "gearup"),
|
||||
(u"train sorti", "geardn"),
|
||||
@@ -283,7 +289,7 @@ if __name__ == "__main__":
|
||||
(u"fin écolage", "trnoff"),
|
||||
(u"moteur coupé", "engoff"),
|
||||
]):
|
||||
sounds.extend(generate(s, f, 256+i))
|
||||
sounds.extend(generate(s, f, PROMPT_CUSTOM_BASE+i))
|
||||
|
||||
|
||||
elif "it" in sys.argv:
|
||||
@@ -296,35 +302,35 @@ if __name__ == "__main__":
|
||||
voice = "italian"
|
||||
|
||||
for i in range(101):
|
||||
systemSounds.extend(generate(str(i), i))
|
||||
systemSounds.extend(generate("mila", 101))
|
||||
systemSounds.extend(generate("mille", 102))
|
||||
systemSounds.extend(generate(str(i), PROMPT_SYSTEM_BASE+i))
|
||||
systemSounds.extend(generate("mila", PROMPT_SYSTEM_BASE+101))
|
||||
systemSounds.extend(generate("mille", PROMPT_SYSTEM_BASE+102))
|
||||
for i, s in enumerate(["virgola", "un", "e", "meno", "ora", "ore", "minuto", "minuti", "secondo", "secondi"]):
|
||||
systemSounds.extend(generate(s, 103+i))
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+103+i))
|
||||
for i, s in enumerate(["volt", "amper", "meetri per secondo", "", "chilomeetri ora", "meetri", "gradi", "percento", "milliamper", "milliamper ora", "watt", "db", "piedi", "nodi", "ore", "minuti", "secondi", "R P M", "g"]):
|
||||
systemSounds.extend(generate(s, 113+i))
|
||||
for s, f, a in [(u"radio inattiva controllare", "inactiv", 230),
|
||||
(u"batteria della radio scarica", "lowbatt", 231),
|
||||
(u"controllo motore non in posizione, verificare", "thralert", 232),
|
||||
(u"interruttori non in posizione, verificare", "swalert", 233),
|
||||
(u"eeprom corrotta", "eebad", 0),
|
||||
(u"formattazone eeprom in corso", "eeformat", 0),
|
||||
(u"errore", "error", 0),
|
||||
(u"trim centrato", "midtrim", 244),
|
||||
(u"tada", "tada", 245),
|
||||
(u"potenziometro centrato", "midpot", 246),
|
||||
(u"massimo trim raggiunto", "endtrim", 0),
|
||||
(u"3 secondi al termine", "timerlt3", 250),
|
||||
(u"dieci secondi", "timer10", 251),
|
||||
(u"venti secondi", "timer20", 252),
|
||||
(u"trenta secondi", "timer30", 253),
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+113+i))
|
||||
for s, f, a in [(u"radio inattiva controllare", "inactiv", 480),
|
||||
(u"batteria della radio scarica", "lowbatt", 481),
|
||||
(u"controllo motore non in posizione, verificare", "thralert", 482),
|
||||
(u"interruttori non in posizione, verificare", "swalert", 483),
|
||||
(u"eeprom corrotta", "eebad", NO_ALTERNATE),
|
||||
(u"formattazone eeprom in corso", "eeformat", NO_ALTERNATE),
|
||||
(u"errore", "error", NO_ALTERNATE),
|
||||
(u"trim centrato", "midtrim", 494),
|
||||
(u"tada", "tada", 495),
|
||||
(u"potenziometro centrato", "midpot", 496),
|
||||
(u"massimo trim raggiunto", "endtrim", NO_ALTERNATE),
|
||||
(u"3 secondi al termine", "timerlt3", 500),
|
||||
(u"dieci secondi", "timer10", 501),
|
||||
(u"venti secondi", "timer20", 502),
|
||||
(u"trenta secondi", "timer30", 503),
|
||||
]:
|
||||
systemSounds.extend(generate(s, f, a))
|
||||
for i, s in enumerate(["timer", "timer", "trasmissione", "ricezione", "A1", "A2", "altitudine", "motore",
|
||||
"carburante", "temperatura", "temperatura", "velocita'", "distanza", "altitudine", "cella lipo",
|
||||
"totale lipo", "tensione", "corrente", "consumo", "potenza", "accelerazione X", "accellerazione Y", "accelerazione Z",
|
||||
"direzione", "variometro","minimo","massimo"]):
|
||||
systemSounds.extend(generate(s, 132+i))
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+132+i))
|
||||
for i, (s, f) in enumerate([
|
||||
(u"carrello chiuso", "gearup"),
|
||||
(u"carrello aperto", "geardn"),
|
||||
@@ -354,7 +360,7 @@ if __name__ == "__main__":
|
||||
(u"fase di volo 8", "fltmd8"),
|
||||
(u"fase di volo 9", "fltmd9"),
|
||||
]):
|
||||
sounds.extend(generate(s, f, 256+i))
|
||||
sounds.extend(generate(s, f, PROMPT_CUSTOM_BASE+i))
|
||||
|
||||
elif "de" in sys.argv:
|
||||
if "sapi" in sys.argv:
|
||||
@@ -367,33 +373,33 @@ if __name__ == "__main__":
|
||||
|
||||
for i in range(101):
|
||||
systemSounds.extend(generate(str(i), i))
|
||||
systemSounds.extend(generate("tausend", 101))
|
||||
systemSounds.extend(generate("tausend", PROMPT_SYSTEM_BASE+101))
|
||||
for i, s in enumerate(["comma", "und", "minus", "uhr", "minute", "minuten", "sekunde", "sekunden"]):
|
||||
systemSounds.extend(generate(s, 102+i))
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+102+i))
|
||||
for i, s in enumerate(["Volt", "Ampere", "Meter pro sekunde", "", "kilometer pro stunde", "Meter", "Grad", "Prozent", "Milliampere", "Milliampere pro stunde", "Watt", "db", "Fuesse", "Knoten", "Uhr", "Minuten", "Secunden", "R P M", "g"]):
|
||||
systemSounds.extend(generate(s, 110+i))
|
||||
for s, f, a in [(u"Sender ist inaktiv,bitte Ueberpruefen Sie", "inactiv", 230),
|
||||
(u"Senderakku niedrig", "lowbatt", 231),
|
||||
(u"Gaskanal nicht Null, bitte pruefen", "thralert", 232),
|
||||
(u"Schalten fehlpositioniert, bitte pruefen", "swalert", 233),
|
||||
(u"Das EEPROM ist fehlerhaft", "eebad", 0),
|
||||
(u"Das EEPROM ist immer formatiert", "eeformat", 0),
|
||||
(u"fehler", "error", 0),
|
||||
(u"Trim zentriert", "midtrim", 244),
|
||||
(u"tada", "tada", 245),
|
||||
(u"Poti zentriert", "midpot", 246),
|
||||
(u"Maximale trimmung erreicht", "endtrim", 0),
|
||||
(u"Noch drei sekunden", "timerlt3", 250),
|
||||
(u"10 sekunden", "timer10", 251),
|
||||
(u"20 sekunden", "timer20", 252),
|
||||
(u"30 sekunden", "timer30", 253),
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+110+i))
|
||||
for s, f, a in [(u"Sender ist inaktiv,bitte Ueberpruefen Sie", "inactiv", 480),
|
||||
(u"Senderakku niedrig", "lowbatt", 481),
|
||||
(u"Gaskanal nicht Null, bitte pruefen", "thralert", 482),
|
||||
(u"Schalten fehlpositioniert, bitte pruefen", "swalert", 483),
|
||||
(u"Das EEPROM ist fehlerhaft", "eebad", NO_ALTERNATE),
|
||||
(u"Das EEPROM ist immer formatiert", "eeformat", NO_ALTERNATE),
|
||||
(u"fehler", "error", NO_ALTERNATE),
|
||||
(u"Trim zentriert", "midtrim", 494),
|
||||
(u"tada", "tada", 495),
|
||||
(u"Poti zentriert", "midpot", 496),
|
||||
(u"Maximale trimmung erreicht", "endtrim", NO_ALTERNATE),
|
||||
(u"Noch drei sekunden", "timerlt3", 500),
|
||||
(u"10 sekunden", "timer10", 501),
|
||||
(u"20 sekunden", "timer20", 502),
|
||||
(u"30 sekunden", "timer30", 503),
|
||||
]:
|
||||
systemSounds.extend(generate(s, f, a))
|
||||
for i, s in enumerate(["Timer", "Timer", "Sendung", "Empfang", "A1", "A2", "Hoehe", "Motor",
|
||||
"Treibstoff", "Temperatur", "Temperatur", "Geschwindigkeit", "Ferne", "Hoehe", "Lipo-Zelle",
|
||||
"Zellen gesamt", "Spannung", "Strom", "Verbrauch", "Power", "Beschleunigung X", "Beschleunigung Y", "Beschleunigung Z",
|
||||
"Richtung", "Variometer","Minimum","Maximum"]):
|
||||
systemSounds.extend(generate(s, 129+i))
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+129+i))
|
||||
for i, (s, f) in enumerate([
|
||||
(u"Fahrwerk eingezogen", "gearup"),
|
||||
(u"Fahrwerk ausgefahren", "geardn"),
|
||||
@@ -423,7 +429,7 @@ if __name__ == "__main__":
|
||||
(u"Regime 8", "fltmd8"),
|
||||
(u"Regime 9", "fltmd9"),
|
||||
]):
|
||||
sounds.extend(generate(s, f, 256+i))
|
||||
sounds.extend(generate(s, f, PROMPT_CUSTOM_BASE+i))
|
||||
|
||||
elif "pt" in sys.argv:
|
||||
if "sapi" in sys.argv:
|
||||
@@ -435,43 +441,43 @@ if __name__ == "__main__":
|
||||
voice = "portuguese"
|
||||
|
||||
for i in range(101):
|
||||
systemSounds.extend(generate(str(i), i))
|
||||
systemSounds.extend(generate("cento", 101))
|
||||
systemSounds.extend(generate("duzentos", 102))
|
||||
systemSounds.extend(generate("trezentos", 103))
|
||||
systemSounds.extend(generate("quatrocentos", 104))
|
||||
systemSounds.extend(generate("quinhentos", 105))
|
||||
systemSounds.extend(generate("seiscentos", 106))
|
||||
systemSounds.extend(generate("setecentos", 107))
|
||||
systemSounds.extend(generate("oitocentos", 108))
|
||||
systemSounds.extend(generate("novecentos", 109))
|
||||
systemSounds.extend(generate("mil", 110))
|
||||
systemSounds.extend(generate(str(i), PROMPT_SYSTEM_BASE+i))
|
||||
systemSounds.extend(generate("cento", PROMPT_SYSTEM_BASE+101))
|
||||
systemSounds.extend(generate("duzentos", PROMPT_SYSTEM_BASE+102))
|
||||
systemSounds.extend(generate("trezentos", PROMPT_SYSTEM_BASE+103))
|
||||
systemSounds.extend(generate("quatrocentos", PROMPT_SYSTEM_BASE+104))
|
||||
systemSounds.extend(generate("quinhentos", PROMPT_SYSTEM_BASE+105))
|
||||
systemSounds.extend(generate("seiscentos", PROMPT_SYSTEM_BASE+106))
|
||||
systemSounds.extend(generate("setecentos", PROMPT_SYSTEM_BASE+107))
|
||||
systemSounds.extend(generate("oitocentos", PROMPT_SYSTEM_BASE+108))
|
||||
systemSounds.extend(generate("novecentos", PROMPT_SYSTEM_BASE+109))
|
||||
systemSounds.extend(generate("mil", PROMPT_SYSTEM_BASE+110))
|
||||
for i, s in enumerate(["virgula", "uma", "duas", "e", "menos", "hora", "horas", "minuto", "minutos", "segundo", "segundos"]):
|
||||
systemSounds.extend(generate(s, 111+i))
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+111+i))
|
||||
for i, s in enumerate([u"Volt", u"ampére", u"metros por segundo", u"", u"quilômetros por hora", u"metros", u"graus", u"cento", u"miliamperes", u"miliamperes por hora", u"watt", u"db", u"pés", u"nós", u"horas", u"minutos", u"segundos", u"RPM", u"g"]):
|
||||
systemSounds.extend(generate(s, 122+i))
|
||||
for s, f, a in [(u"atenção, o rádio foi esquecido ligado, por favor desligue-o", "inactiv", 230),
|
||||
(u"bateria do rádio fraca", "lowbatt", 231),
|
||||
(u"atenção,acelerador não está no mínimo", "thralert", 232),
|
||||
(u"atenção, certifique-se que os interruptores estão na posição certa", "swalert", 233),
|
||||
(u"eeprom corrompida", "eebad", 0),
|
||||
(u"formatação da eeprom em curso", "eeformat", 0),
|
||||
(u"erro", "error", 0),
|
||||
(u"trim centrado", "midtrim", 244),
|
||||
(u"tada", "tada", 245),
|
||||
(u"potenciómetro centrado", "midpot", 246),
|
||||
(u"trim no máximo", "endtrim", 0),
|
||||
(u"3 segundos", "timerlt3", 250),
|
||||
(u"10 segundos", "timer10", 251),
|
||||
(u"20 segundos", "timer20", 252),
|
||||
(u"30 segundos", "timer30", 253),
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+122+i))
|
||||
for s, f, a in [(u"atenção, o rádio foi esquecido ligado, por favor desligue-o", "inactiv", 480),
|
||||
(u"bateria do rádio fraca", "lowbatt", 481),
|
||||
(u"atenção,acelerador não está no mínimo", "thralert", 482),
|
||||
(u"atenção, certifique-se que os interruptores estão na posição certa", "swalert", 483),
|
||||
(u"eeprom corrompida", "eebad", NO_ALTERNATE),
|
||||
(u"formatação da eeprom em curso", "eeformat", NO_ALTERNATE),
|
||||
(u"erro", "error", NO_ALTERNATE),
|
||||
(u"trim centrado", "midtrim", 494),
|
||||
(u"tada", "tada", 495),
|
||||
(u"potenciómetro centrado", "midpot", 496),
|
||||
(u"trim no máximo", "endtrim", NO_ALTERNATE),
|
||||
(u"3 segundos", "timerlt3", 500),
|
||||
(u"10 segundos", "timer10", 501),
|
||||
(u"20 segundos", "timer20", 502),
|
||||
(u"30 segundos", "timer30", 503),
|
||||
]:
|
||||
systemSounds.extend(generate(s, f, a))
|
||||
for i, s in enumerate([u"cronómetro", u"cronómetro", u"transmissão", u"recepção", u"A1", u"A2", u"altitude", u"motor",
|
||||
u"combustível", u"temperatura", u"temperatura", u"velocidade", u"distância", u"altitude", u"célula lipo"
|
||||
u"Total lipo", u"tensão", u"corrente", u"consumo", u"potência", u"aceleração X", u"aceleração Y", u"aceleração Z"
|
||||
u"Direcção", u"variómetro", u"mínimo", u"máximo"]):
|
||||
systemSounds.extend(generate(s, 141+i))
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+141+i))
|
||||
for i, (s, f) in enumerate([
|
||||
(u"trem, em cima.", "gearup"),
|
||||
(u"trem, em baixo.", "geardn"),
|
||||
@@ -501,7 +507,7 @@ if __name__ == "__main__":
|
||||
(u"fase de voo 8", "fltmd8"),
|
||||
(u"fase de voo 9", "fltmd9"),
|
||||
]):
|
||||
sounds.extend(generate(s, f, 256+i))
|
||||
sounds.extend(generate(s, f, PROMPT_CUSTOM_BASE+i))
|
||||
|
||||
elif "cz" in sys.argv:
|
||||
if "sapi" in sys.argv:
|
||||
@@ -513,14 +519,14 @@ if __name__ == "__main__":
|
||||
voice = "czech"
|
||||
|
||||
for i, s in enumerate(["nula", "jedna", "dva"]):
|
||||
systemSounds.extend(generate(s, i))
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+i))
|
||||
for i in range(97):
|
||||
systemSounds.extend(generate(str(3+i), 3+i))
|
||||
systemSounds.extend(generate(str(3+i), PROMPT_SYSTEM_BASE+3+i))
|
||||
for i, s in enumerate(["sto", u"dvěsta", u"třista", u"čtyřista", u"pětset", u"šestset", "sedmset", "osmset",
|
||||
u"devětset", u"tisíc"]):
|
||||
systemSounds.extend(generate(s, 100+i))
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+100+i))
|
||||
for i, s in enumerate([u"tisíce", "jeden", "jedno", u"dvě", u"celá", u"celé", u"celých", u"mínus"]):
|
||||
systemSounds.extend(generate(s, 110+i))
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+110+i))
|
||||
|
||||
for i, s in enumerate(["volt", "volty", u"voltů", "voltu",
|
||||
u"ampér", u"ampéry", u"ampérů", u"ampéru",
|
||||
@@ -541,19 +547,19 @@ if __name__ == "__main__":
|
||||
"sekunda", "sekundy", "sekund", "sekundy",
|
||||
u"otáčka za minutu", u"otáčky za minutu", u"otáček za minutu", u"otáčky za minutu",
|
||||
u"gé", u"gé", u"gé", u"gé"]):
|
||||
systemSounds.extend(generate(s, 118+i))
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+118+i))
|
||||
|
||||
for s, f, a in [(u"střed trimu", "midtrim", 244),
|
||||
(u"maximum trimu", "endtrim", 0),
|
||||
(u"baterie rádia je vybitá", "lowbatt", 231),
|
||||
(u"zapoměl jsi na mě!", "inactiv", 230),
|
||||
(u"plyn není na nule", "thralert", 232),
|
||||
(u"přepínače nejsou ve výchozí poloze", "swalert", 233),
|
||||
(u"tadá", "tada", 245),
|
||||
(u"ťik ťak", "timerlt3", 250),
|
||||
(u"deset sekund", "timer10", 251),
|
||||
(u"dvacet sekund", "timer20", 252),
|
||||
(u"třicet sekund", "timer30", 253),
|
||||
for s, f, a in [(u"střed trimu", "midtrim", 494),
|
||||
(u"maximum trimu", "endtrim", NO_ALTERNATE),
|
||||
(u"baterie rádia je vybitá", "lowbatt", 481),
|
||||
(u"zapoměl jsi na mě!", "inactiv", 480),
|
||||
(u"plyn není na nule", "thralert", 482),
|
||||
(u"přepínače nejsou ve výchozí poloze", "swalert", 483),
|
||||
(u"tadá", "tada", 495),
|
||||
(u"ťik ťak", "timerlt3", 500),
|
||||
(u"deset sekund", "timer10", 501),
|
||||
(u"dvacet sekund", "timer20", 502),
|
||||
(u"třicet sekund", "timer30", 503),
|
||||
]:
|
||||
systemSounds.extend(generate(s, f, a))
|
||||
for i, (s, f) in enumerate([
|
||||
@@ -585,7 +591,7 @@ if __name__ == "__main__":
|
||||
(u"režim osm", "fltmd8"),
|
||||
(u"režim devět", "fltmd9"),
|
||||
]):
|
||||
sounds.extend(generate(s, f, 256+i))
|
||||
sounds.extend(generate(s, f, PROMPT_CUSTOM_BASE+i))
|
||||
|
||||
|
||||
voice += "-" + board
|
||||
@@ -595,13 +601,13 @@ if __name__ == "__main__":
|
||||
for f, s in systemSounds:
|
||||
l = u""
|
||||
if board == "sky9x":
|
||||
l += u"9XSOUNDS/SYSTEM;"
|
||||
l += u"SOUNDS/SYSTEM;"
|
||||
l += f + u";" + s + u"\n"
|
||||
csvFile.write(l.encode("latin-1"))
|
||||
for f, s in sounds:
|
||||
l = u""
|
||||
if board == "sky9x":
|
||||
l += u"9XSOUNDS;"
|
||||
l += u"SOUNDS;"
|
||||
l += f + u";" + s + u"\n"
|
||||
csvFile.write(l.encode("latin-1"))
|
||||
csvFile.close()
|
||||
@@ -611,13 +617,13 @@ if __name__ == "__main__":
|
||||
zip = zipfile.ZipFile(zip_name, "w", zipfile.ZIP_DEFLATED)
|
||||
for f, s in systemSounds:
|
||||
if board == "sky9x":
|
||||
zip.write(f, "9XSOUNDS/SYSTEM/" + f)
|
||||
zip.write(f, "SOUNDS/SYSTEM/" + f)
|
||||
else:
|
||||
zip.write(f, f)
|
||||
os.remove(f)
|
||||
for f, s in sounds:
|
||||
if board == "sky9x":
|
||||
zip.write(f, "9XSOUNDS/" + f)
|
||||
zip.write(f, "SOUNDS/" + f)
|
||||
else:
|
||||
zip.write(f, f)
|
||||
os.remove(f)
|
||||
|
||||
Reference in New Issue
Block a user