[gruvin9x, sky9x] Issue 64 fixed. It's now possible to have AUDIO=YES and BEEPER=YES
[all] Issue 32 fixed (AUTOSOURCE option added) [all] Issue 226 fixed (Menu in main views / telemetry views) [all] Issue 226 fixed (Imperial bug with playValue) [sky9x] Issue 234 fixed (rotary encoder inverted) [sky9x / Taranis] Bug with AUDIO stopped when selecting Background Music without a file [all except M64] Shift in Telemetry sources when !GVARS
This commit is contained in:
+28
-6
@@ -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
|
||||
@@ -260,12 +264,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)
|
||||
@@ -310,12 +315,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 +355,28 @@ ifeq ($(PCB), GRUVIN9X)
|
||||
OPT = 2
|
||||
CPPDEFS += -DF_CPU=$(F_CPU)UL -DPCBGRUVIN9X -DEEPROM_VARIANT=0 -DAUDIO -DHAPTIC
|
||||
SDCARD = NO
|
||||
BEEPER = NO
|
||||
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)
|
||||
@@ -423,6 +435,7 @@ ifeq ($(PCB), SKY9X)
|
||||
MCU = cortex-m3
|
||||
OPT = 2
|
||||
SDCARD = YES
|
||||
BEEPER = NO
|
||||
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 +452,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
|
||||
@@ -604,6 +622,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)
|
||||
|
||||
+17
-6
@@ -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)) {
|
||||
|
||||
+9
-3
@@ -167,9 +167,15 @@ void audioQueue::event(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)) {
|
||||
|
||||
+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
|
||||
|
||||
+46
-40
@@ -59,53 +59,59 @@ inline void _beep(uint8_t b)
|
||||
}
|
||||
#endif
|
||||
|
||||
extern void beep(uint8_t val);
|
||||
|
||||
#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)
|
||||
#if defined(AUDIO)
|
||||
void beep();
|
||||
#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)
|
||||
void beep(uint8_t val);
|
||||
#endif
|
||||
|
||||
#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)
|
||||
#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 BEEPER_HEARTBEAT()
|
||||
{
|
||||
if(g_beepCnt) {
|
||||
if(!beepAgainOrig) {
|
||||
|
||||
+1
-1
@@ -812,7 +812,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(CPUM64)
|
||||
else if (idx <= MIXSRC_LAST_GVAR)
|
||||
putsStrIdx(x, y, STR_GV, idx-MIXSRC_GVAR1+1, att);
|
||||
#endif
|
||||
|
||||
+28
-9
@@ -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)
|
||||
@@ -165,7 +166,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) 0, LABEL(TX_MODE), CASE_PCBTARANIS(0) 1/*to force edit mode*/});
|
||||
|
||||
uint8_t sub = m_posVert - 1;
|
||||
|
||||
@@ -260,13 +261,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 +355,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 +377,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 +433,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:
|
||||
|
||||
+1
-1
@@ -2334,7 +2334,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);
|
||||
|
||||
@@ -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);
|
||||
@@ -648,6 +679,14 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
||||
else if (l_posVert-s_pgOfs<1) 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -102,6 +102,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 +135,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,6 +163,13 @@ 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)
|
||||
|
||||
|
||||
+9
-11
@@ -84,15 +84,11 @@ typedef char gvar_name_t[6];
|
||||
#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 {
|
||||
@@ -198,17 +194,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;
|
||||
@@ -1014,8 +1010,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,
|
||||
@@ -1024,7 +1022,7 @@ enum MixSources {
|
||||
MIXSRC_SG,
|
||||
MIXSRC_SH,
|
||||
#else
|
||||
MIXSRC_3POS,
|
||||
MIXSRC_3POS = MIXSRC_FIRST_SWITCH,
|
||||
#if defined(EXTRA_3POS)
|
||||
MIXSRC_3POS2,
|
||||
#endif
|
||||
|
||||
+48
-18
@@ -1119,10 +1119,9 @@ bool getSwitch(int8_t swtch, bool nc)
|
||||
}
|
||||
|
||||
swstate_t switches_states = 0;
|
||||
tmr10ms_t s_move_last_time = 0;
|
||||
int8_t getMovedSwitch()
|
||||
{
|
||||
static tmr10ms_t s_last_time = 0;
|
||||
|
||||
int8_t result = 0;
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
@@ -1166,14 +1165,41 @@ 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 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()
|
||||
{
|
||||
@@ -1353,17 +1379,17 @@ void setGVarValue(uint8_t idx, int16_t value, int8_t phase)
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY) || defined(CPUARM)
|
||||
void putsTelemetryValue(xcoord_t x, uint8_t y, lcdint_t val, uint8_t unit, uint8_t att)
|
||||
inline void convertUnit(getvalue_t & val, uint8_t & unit)
|
||||
{
|
||||
#if defined(IMPERIAL_UNITS)
|
||||
if (unit == UNIT_DEGREES) {
|
||||
val += 18 ;
|
||||
val *= 115 ;
|
||||
val >>= 6 ;
|
||||
val += 18;
|
||||
val *= 115;
|
||||
val >>= 6;
|
||||
}
|
||||
if (unit == UNIT_METERS) {
|
||||
// m to ft *105/32
|
||||
val = val * 3 + ( val >> 2 ) + (val >> 5) ;
|
||||
val = val * 3 + (val >> 2) + (val >> 5);
|
||||
}
|
||||
if (unit == UNIT_FEET) {
|
||||
unit = UNIT_METERS;
|
||||
@@ -1378,6 +1404,11 @@ void putsTelemetryValue(xcoord_t x, uint8_t y, lcdint_t val, uint8_t unit, uint8
|
||||
val = (val * 46) / 25;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void putsTelemetryValue(xcoord_t x, uint8_t y, lcdint_t val, uint8_t unit, uint8_t att)
|
||||
{
|
||||
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);
|
||||
@@ -1565,7 +1596,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()
|
||||
@@ -2263,13 +2294,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;
|
||||
}
|
||||
@@ -3614,7 +3638,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(BUZZER)
|
||||
BUZZER_HEARTBEAT();
|
||||
#endif
|
||||
|
||||
#if defined(HAPTIC)
|
||||
HAPTIC_HEARTBEAT();
|
||||
|
||||
+21
-1
@@ -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
|
||||
@@ -737,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();
|
||||
@@ -1223,7 +1232,9 @@ enum AUDIO_SOUNDS {
|
||||
#else
|
||||
#include "audio_avr.h"
|
||||
#endif
|
||||
#else
|
||||
#endif
|
||||
|
||||
#if defined(BEEPER)
|
||||
#include "beeper.h"
|
||||
#endif
|
||||
|
||||
@@ -1298,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)
|
||||
@@ -1362,5 +1376,11 @@ void getGpsPilotPosition();
|
||||
void getGpsDistance();
|
||||
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
|
||||
|
||||
#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 ;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -570,13 +570,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;
|
||||
@@ -620,7 +620,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;
|
||||
|
||||
@@ -135,6 +135,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;
|
||||
@@ -337,6 +341,11 @@ 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)
|
||||
|
||||
+13
-1
@@ -261,6 +261,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[];
|
||||
@@ -445,6 +452,11 @@ extern const pm_char STR_CURRENT[];
|
||||
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)
|
||||
@@ -523,7 +535,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
|
||||
|
||||
|
||||
@@ -462,7 +462,7 @@
|
||||
|
||||
#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"
|
||||
|
||||
@@ -108,7 +108,7 @@ PLAY_FUNCTION(pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -86,13 +86,15 @@ PLAY_FUNCTION(pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
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_NUMBER_PROMPT(PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
convertUnit(number, unit);
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
// we assume that we are PREC1
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -108,7 +108,7 @@ 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_NUMBER_PROMPT(PROMPT_MENOS);
|
||||
|
||||
@@ -123,7 +123,7 @@ PLAY_FUNCTION(pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
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) {
|
||||
|
||||
+48
-8
@@ -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);
|
||||
}
|
||||
|
||||
@@ -368,9 +368,18 @@ void menuTelemetryFrsky(uint8_t event)
|
||||
s_frsky_view = 0;
|
||||
break;
|
||||
|
||||
#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();
|
||||
|
||||
Reference in New Issue
Block a user