mirror of
https://github.com/opentx/opentx.git
synced 2025-07-26 01:35:21 +03:00
Beeper mode is now splitted from beeper length. Haptic mode added. Haptic only sounds now ok on v4.
This commit is contained in:
parent
a021b66a9b
commit
c4147980c9
12 changed files with 159 additions and 135 deletions
150
src/audio.cpp
150
src/audio.cpp
|
@ -59,8 +59,10 @@ void audioQueue::heartbeat()
|
||||||
{
|
{
|
||||||
if (toneTimeLeft > 0) {
|
if (toneTimeLeft > 0) {
|
||||||
#if defined(PCBV4)
|
#if defined(PCBV4)
|
||||||
OCR0A = (5000 / toneFreq); // sticking with old values approx 20(abs. min) to 90, 60 being the default tone(?).
|
if (toneFreq) {
|
||||||
SPEAKER_ON;
|
OCR0A = (5000 / toneFreq); // sticking with old values approx 20(abs. min) to 90, 60 being the default tone(?).
|
||||||
|
SPEAKER_ON;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
toneTimeLeft--; //time gets counted down
|
toneTimeLeft--; //time gets counted down
|
||||||
toneFreq += toneFreqIncr;
|
toneFreq += toneFreqIncr;
|
||||||
|
@ -102,77 +104,94 @@ void audioQueue::heartbeat()
|
||||||
inline uint8_t audioQueue::getToneLength(uint8_t tLen)
|
inline uint8_t audioQueue::getToneLength(uint8_t tLen)
|
||||||
{
|
{
|
||||||
uint8_t result = tLen; // default
|
uint8_t result = tLen; // default
|
||||||
if (g_eeGeneral.beeperVal == 2) {
|
if (g_eeGeneral.beeperLength < 0) {
|
||||||
result /= 3;
|
result /= (1-g_eeGeneral.beeperLength);
|
||||||
}
|
}
|
||||||
else if (g_eeGeneral.beeperVal == 3) {
|
if (g_eeGeneral.beeperLength > 0) {
|
||||||
result /= 2;
|
result *= (1+g_eeGeneral.beeperLength);
|
||||||
}
|
|
||||||
else if (g_eeGeneral.beeperVal == 5) {
|
|
||||||
//long
|
|
||||||
result *= 2;
|
|
||||||
}
|
|
||||||
else if (g_eeGeneral.beeperVal == 6) {
|
|
||||||
//xlong
|
|
||||||
result *= 3;
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool s_beeper;
|
||||||
|
bool s_haptic;
|
||||||
|
|
||||||
void audioQueue::playNow(uint8_t tFreq, uint8_t tLen, uint8_t tPause,
|
void audioQueue::playNow(uint8_t tFreq, uint8_t tLen, uint8_t tPause,
|
||||||
uint8_t tRepeat, uint8_t tHaptic, int8_t tFreqIncr)
|
uint8_t tRepeat, uint8_t tHaptic, int8_t tFreqIncr)
|
||||||
{
|
{
|
||||||
if (g_eeGeneral.beeperVal) {
|
toneFreq = ((s_beeper && tFreq) ? tFreq + g_eeGeneral.speakerPitch + BEEP_OFFSET : 0); // add pitch compensator
|
||||||
toneFreq = (tFreq ? tFreq + g_eeGeneral.speakerPitch + BEEP_OFFSET : 0); // add pitch compensator
|
toneTimeLeft = getToneLength(tLen);
|
||||||
toneTimeLeft = getToneLength(tLen);
|
tonePause = tPause;
|
||||||
tonePause = tPause;
|
|
||||||
#if defined(HAPTIC)
|
#if defined(HAPTIC)
|
||||||
toneHaptic = tHaptic;
|
toneHaptic = s_haptic ? tHaptic : 0;
|
||||||
#endif
|
#endif
|
||||||
toneFreqIncr = tFreqIncr;
|
toneFreqIncr = tFreqIncr;
|
||||||
t_queueWidx = t_queueRidx;
|
t_queueWidx = t_queueRidx;
|
||||||
|
|
||||||
if (tRepeat) {
|
if (tRepeat) {
|
||||||
playASAP(tFreq, tLen, tPause, tRepeat-1, tHaptic, tFreqIncr);
|
playASAP(tFreq, tLen, tPause, tRepeat-1, tHaptic, tFreqIncr);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void audioQueue::playASAP(uint8_t tFreq, uint8_t tLen, uint8_t tPause,
|
void audioQueue::playASAP(uint8_t tFreq, uint8_t tLen, uint8_t tPause,
|
||||||
uint8_t tRepeat, uint8_t tHaptic, int8_t tFreqIncr)
|
uint8_t tRepeat, uint8_t tHaptic, int8_t tFreqIncr)
|
||||||
{
|
{
|
||||||
if (g_eeGeneral.beeperVal) {
|
uint8_t next_queueWidx = (t_queueWidx + 1) % AUDIO_QUEUE_LENGTH;
|
||||||
uint8_t next_queueWidx = (t_queueWidx + 1) % AUDIO_QUEUE_LENGTH;
|
if (next_queueWidx != t_queueRidx) {
|
||||||
if (next_queueWidx != t_queueRidx) {
|
queueToneFreq[t_queueWidx] = ((s_beeper && tFreq) ? tFreq + g_eeGeneral.speakerPitch + BEEP_OFFSET : 0); // add pitch compensator
|
||||||
queueToneFreq[t_queueWidx] = (tFreq ? tFreq + g_eeGeneral.speakerPitch + BEEP_OFFSET : 0); // add pitch compensator
|
queueToneLength[t_queueWidx] = getToneLength(tLen);
|
||||||
queueToneLength[t_queueWidx] = getToneLength(tLen);
|
queueTonePause[t_queueWidx] = tPause;
|
||||||
queueTonePause[t_queueWidx] = tPause;
|
|
||||||
#if defined(HAPTIC)
|
#if defined(HAPTIC)
|
||||||
queueToneHaptic[t_queueWidx] = tHaptic;
|
queueToneHaptic[t_queueWidx] = s_haptic ? tHaptic : 0;
|
||||||
#endif
|
#endif
|
||||||
queueToneRepeat[t_queueWidx] = tRepeat;
|
queueToneRepeat[t_queueWidx] = tRepeat;
|
||||||
queueToneFreqIncr[t_queueWidx] = tFreqIncr;
|
queueToneFreqIncr[t_queueWidx] = tFreqIncr;
|
||||||
t_queueWidx = next_queueWidx;
|
t_queueWidx = next_queueWidx;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO check
|
|
||||||
#define BEEP_NOKEYS 1
|
|
||||||
void audioQueue::event(uint8_t e, uint8_t f)
|
void audioQueue::event(uint8_t e, uint8_t f)
|
||||||
{
|
{
|
||||||
uint8_t beepVal = g_eeGeneral.beeperVal;
|
s_beeper = (g_eeGeneral.beeperMode>0 || (g_eeGeneral.beeperMode==0 && e>AU_MENUS) || (g_eeGeneral.beeperMode>=-1 && e<=AU_ERROR));
|
||||||
|
s_haptic = (g_eeGeneral.hapticMode>0 || (g_eeGeneral.hapticMode==0 && e>AU_MENUS) || (g_eeGeneral.hapticMode>=-1 && e<=AU_ERROR));
|
||||||
|
|
||||||
if (e < AU_FRSKY_FIRST || empty()) {
|
if (e < AU_FRSKY_FIRST || empty()) {
|
||||||
switch (e) {
|
switch (e) {
|
||||||
// startup tune
|
// inactivity timer alert
|
||||||
case AU_TADA:
|
case AU_INACTIVITY:
|
||||||
|
playNow(70, 10, 2, 2);
|
||||||
|
break;
|
||||||
|
// low battery in tx
|
||||||
|
case AU_TX_BATTERY_LOW:
|
||||||
if (empty()) {
|
if (empty()) {
|
||||||
playASAP(50, 10, 5);
|
playASAP(60, 20, 3, 2, 0, 1);
|
||||||
playASAP(90, 10, 5);
|
playASAP(80, 20, 3, 2, 1, -1);
|
||||||
playASAP(110, 5, 4, 2);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
// error
|
||||||
|
case AU_ERROR:
|
||||||
|
playNow(BEEP_DEFAULT_FREQ, 40, 1, 0, 1);
|
||||||
|
break;
|
||||||
|
// keypad up (seems to be used when going left/right through system menu options. 0-100 scales etc)
|
||||||
|
case AU_KEYPAD_UP:
|
||||||
|
playNow(BEEP_KEY_UP_FREQ, 10, 1);
|
||||||
|
break;
|
||||||
|
// keypad down (seems to be used when going left/right through system menu options. 0-100 scales etc)
|
||||||
|
case AU_KEYPAD_DOWN:
|
||||||
|
playNow(BEEP_KEY_DOWN_FREQ, 10, 1);
|
||||||
|
break;
|
||||||
|
// menu display (also used by a few generic beeps)
|
||||||
|
case AU_MENUS:
|
||||||
|
playNow(BEEP_DEFAULT_FREQ, 10, 2, 0, 0);
|
||||||
|
break;
|
||||||
|
// trim move
|
||||||
|
case AU_TRIM_MOVE:
|
||||||
|
playNow(f, 6, 1);
|
||||||
|
break;
|
||||||
|
// trim center
|
||||||
|
case AU_TRIM_MIDDLE:
|
||||||
|
playNow(BEEP_DEFAULT_FREQ, 10, 2, 0, 1);
|
||||||
|
break;
|
||||||
// warning one
|
// warning one
|
||||||
case AU_WARNING1:
|
case AU_WARNING1:
|
||||||
playNow(BEEP_DEFAULT_FREQ, 10, 1, 0, 1);
|
playNow(BEEP_DEFAULT_FREQ, 10, 1, 0, 1);
|
||||||
|
@ -185,35 +204,11 @@ void audioQueue::event(uint8_t e, uint8_t f)
|
||||||
case AU_WARNING3:
|
case AU_WARNING3:
|
||||||
playNow(BEEP_DEFAULT_FREQ, 30, 1, 0, 1);
|
playNow(BEEP_DEFAULT_FREQ, 30, 1, 0, 1);
|
||||||
break;
|
break;
|
||||||
// error
|
// startup tune
|
||||||
case AU_ERROR:
|
case AU_TADA:
|
||||||
playNow(BEEP_DEFAULT_FREQ, 40, 1, 0, 1);
|
playASAP(50, 10, 5);
|
||||||
break;
|
playASAP(90, 10, 5);
|
||||||
// keypad up (seems to be used when going left/right through system menu options. 0-100 scales etc)
|
playASAP(110, 5, 4, 2);
|
||||||
case AU_KEYPAD_UP:
|
|
||||||
if (beepVal != BEEP_NOKEYS) {
|
|
||||||
playNow(BEEP_KEY_UP_FREQ, 10, 1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
// keypad down (seems to be used when going left/right through system menu options. 0-100 scales etc)
|
|
||||||
case AU_KEYPAD_DOWN:
|
|
||||||
if (beepVal != BEEP_NOKEYS) {
|
|
||||||
playNow(BEEP_KEY_DOWN_FREQ, 10, 1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
// trim move
|
|
||||||
case AU_TRIM_MOVE:
|
|
||||||
playNow(f, 6, 1);
|
|
||||||
break;
|
|
||||||
// trim center
|
|
||||||
case AU_TRIM_MIDDLE:
|
|
||||||
playNow(BEEP_DEFAULT_FREQ, 10, 2, 0, 1);
|
|
||||||
break;
|
|
||||||
// menu display (also used by a few generic beeps)
|
|
||||||
case AU_MENUS:
|
|
||||||
if (beepVal != BEEP_NOKEYS) {
|
|
||||||
playNow(BEEP_DEFAULT_FREQ, 10, 2, 0, 0);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
// pot/stick center
|
// pot/stick center
|
||||||
case AU_POT_STICK_MIDDLE:
|
case AU_POT_STICK_MIDDLE:
|
||||||
|
@ -247,17 +242,6 @@ void audioQueue::event(uint8_t e, uint8_t f)
|
||||||
case AU_TIMER_LT3:
|
case AU_TIMER_LT3:
|
||||||
playNow(BEEP_DEFAULT_FREQ, 20, 25, 1, 1);
|
playNow(BEEP_DEFAULT_FREQ, 20, 25, 1, 1);
|
||||||
break;
|
break;
|
||||||
// inactivity timer alert
|
|
||||||
case AU_INACTIVITY:
|
|
||||||
playNow(70, 10, 2, 2);
|
|
||||||
break;
|
|
||||||
// low battery in tx
|
|
||||||
case AU_TX_BATTERY_LOW:
|
|
||||||
if (empty()) {
|
|
||||||
playASAP(60, 20, 3, 2, 0, 1);
|
|
||||||
playASAP(80, 20, 3, 2, 1, -1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case AU_FRSKY_WARN1:
|
case AU_FRSKY_WARN1:
|
||||||
playASAP(BEEP_DEFAULT_FREQ+20,15,5,2,1);
|
playASAP(BEEP_DEFAULT_FREQ+20,15,5,2,1);
|
||||||
break;
|
break;
|
||||||
|
|
14
src/audio.h
14
src/audio.h
|
@ -54,16 +54,18 @@
|
||||||
|
|
||||||
/* make sure the defines below always go in numeric order */
|
/* make sure the defines below always go in numeric order */
|
||||||
enum AUDIO_SOUNDS {
|
enum AUDIO_SOUNDS {
|
||||||
AU_TADA,
|
AU_INACTIVITY,
|
||||||
AU_WARNING1,
|
AU_TX_BATTERY_LOW,
|
||||||
AU_WARNING2,
|
|
||||||
AU_WARNING3,
|
|
||||||
AU_ERROR,
|
AU_ERROR,
|
||||||
AU_KEYPAD_UP,
|
AU_KEYPAD_UP,
|
||||||
AU_KEYPAD_DOWN,
|
AU_KEYPAD_DOWN,
|
||||||
|
AU_MENUS,
|
||||||
AU_TRIM_MOVE,
|
AU_TRIM_MOVE,
|
||||||
AU_TRIM_MIDDLE,
|
AU_TRIM_MIDDLE,
|
||||||
AU_MENUS,
|
AU_WARNING1,
|
||||||
|
AU_WARNING2,
|
||||||
|
AU_WARNING3,
|
||||||
|
AU_TADA,
|
||||||
AU_POT_STICK_MIDDLE,
|
AU_POT_STICK_MIDDLE,
|
||||||
AU_MIX_WARNING_1,
|
AU_MIX_WARNING_1,
|
||||||
AU_MIX_WARNING_2,
|
AU_MIX_WARNING_2,
|
||||||
|
@ -72,8 +74,6 @@ enum AUDIO_SOUNDS {
|
||||||
AU_TIMER_20,
|
AU_TIMER_20,
|
||||||
AU_TIMER_10,
|
AU_TIMER_10,
|
||||||
AU_TIMER_LT3,
|
AU_TIMER_LT3,
|
||||||
AU_INACTIVITY,
|
|
||||||
AU_TX_BATTERY_LOW,
|
|
||||||
AU_FRSKY_FIRST,
|
AU_FRSKY_FIRST,
|
||||||
AU_FRSKY_WARN1 = AU_FRSKY_FIRST,
|
AU_FRSKY_WARN1 = AU_FRSKY_FIRST,
|
||||||
AU_FRSKY_WARN2,
|
AU_FRSKY_WARN2,
|
||||||
|
|
|
@ -44,8 +44,7 @@ uint8_t hapticTick = 0;
|
||||||
|
|
||||||
// The various "beep" tone lengths
|
// The various "beep" tone lengths
|
||||||
static const pm_uint8_t beepTab[] PROGMEM = {
|
static const pm_uint8_t beepTab[] PROGMEM = {
|
||||||
// 0 1 2 3 4
|
// key, trim, warn2, warn1, error
|
||||||
0, 1, 8, 30, 100, //silent
|
|
||||||
1, 1, 8, 30, 100, //xShort
|
1, 1, 8, 30, 100, //xShort
|
||||||
1, 1, 8, 30, 100, //short
|
1, 1, 8, 30, 100, //short
|
||||||
1, 1, 8, 30, 100, //normal
|
1, 1, 8, 30, 100, //normal
|
||||||
|
@ -55,7 +54,7 @@ static const pm_uint8_t beepTab[] PROGMEM = {
|
||||||
|
|
||||||
void beep(uint8_t val)
|
void beep(uint8_t val)
|
||||||
{
|
{
|
||||||
if (g_eeGeneral.beeperVal>0) {
|
if (g_eeGeneral.beeperMode>0 || (g_eeGeneral.beeperMode==0 && val!=0) || (g_eeGeneral.beeperMode==-1 && val==4)) {
|
||||||
_beep(pgm_read_byte(beepTab+5*g_eeGeneral.beeperVal-5+val));
|
_beep(pgm_read_byte(beepTab+(5*2)+(5*g_eeGeneral.beeperLength)+val));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ extern void beep(uint8_t val);
|
||||||
#define AUDIO_TIMER_10() beep(2)
|
#define AUDIO_TIMER_10() beep(2)
|
||||||
#define AUDIO_TIMER_LT3() beep(2)
|
#define AUDIO_TIMER_LT3() beep(2)
|
||||||
#define AUDIO_MINUTE_BEEP() beep(2)
|
#define AUDIO_MINUTE_BEEP() beep(2)
|
||||||
#define AUDIO_INACTIVITY() beep(3)
|
#define AUDIO_INACTIVITY() AUDIO_ERROR()
|
||||||
#define AUDIO_MIX_WARNING_1() beep(1)
|
#define AUDIO_MIX_WARNING_1() beep(1)
|
||||||
#define AUDIO_MIX_WARNING_3() beep(1)
|
#define AUDIO_MIX_WARNING_3() beep(1)
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ const MenuFuncP_PROGMEM menuTabDiag[] PROGMEM = {
|
||||||
};
|
};
|
||||||
|
|
||||||
enum menuProcSetupItems {
|
enum menuProcSetupItems {
|
||||||
ITEM_SETUP_BASE=17,
|
ITEM_SETUP_BASE=18,
|
||||||
#ifdef SPLASH
|
#ifdef SPLASH
|
||||||
ITEM_SETUP_SPLASH,
|
ITEM_SETUP_SPLASH,
|
||||||
#endif
|
#endif
|
||||||
|
@ -79,7 +79,8 @@ enum menuProcSetupItems {
|
||||||
ITEM_SETUP_SPEAKER,
|
ITEM_SETUP_SPEAKER,
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAPTIC
|
#ifdef HAPTIC
|
||||||
ITEM_SETUP_HAPTIC,
|
ITEM_SETUP_HAPTIC_MODE,
|
||||||
|
ITEM_SETUP_HAPTIC_STRENGTH,
|
||||||
#endif
|
#endif
|
||||||
ITEM_SETUP_MAX
|
ITEM_SETUP_MAX
|
||||||
};
|
};
|
||||||
|
@ -101,9 +102,16 @@ void menuProcSetup(uint8_t event)
|
||||||
|
|
||||||
uint8_t subN = 1;
|
uint8_t subN = 1;
|
||||||
if(s_pgOfs<subN) {
|
if(s_pgOfs<subN) {
|
||||||
lcd_putsLeft( y, STR_BEEPER);
|
lcd_putsLeft( y, STR_BEEPERMODE);
|
||||||
lcd_putsnAtt(PARAM_OFS - 2*FW, y, STR_VBEEPER+LEN_VBEEPER*g_eeGeneral.beeperVal, LEN_VBEEPER, (sub==subN ? INVERS:0));
|
lcd_putsnAtt(PARAM_OFS - 2*FW, y, STR_VBEEPMODE+(LEN_VBEEPMODE*2)+(LEN_VBEEPMODE*g_eeGeneral.beeperMode), LEN_VBEEPMODE, (sub==subN ? INVERS:0));
|
||||||
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.beeperVal, 0, 6);
|
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.beeperMode, -2, 1);
|
||||||
|
if((y+=FH)>7*FH) return;
|
||||||
|
}subN++;
|
||||||
|
|
||||||
|
if(s_pgOfs<subN) {
|
||||||
|
lcd_putsLeft( y, STR_BEEPERLEN);
|
||||||
|
lcd_putsnAtt(PARAM_OFS - 2*FW, y, STR_VBEEPLEN+(LEN_VBEEPLEN*2)+(LEN_VBEEPLEN*g_eeGeneral.beeperLength), LEN_VBEEPLEN, (sub==subN ? INVERS:0));
|
||||||
|
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.beeperLength, -2, 2);
|
||||||
if((y+=FH)>7*FH) return;
|
if((y+=FH)>7*FH) return;
|
||||||
}subN++;
|
}subN++;
|
||||||
|
|
||||||
|
@ -119,6 +127,13 @@ void menuProcSetup(uint8_t event)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAPTIC
|
#ifdef HAPTIC
|
||||||
|
if(s_pgOfs<subN) {
|
||||||
|
lcd_putsLeft( y, STR_HAPTICMODE);
|
||||||
|
lcd_putsnAtt(PARAM_OFS - 2*FW, y, STR_VBEEPMODE+(LEN_VBEEPMODE*2)+(LEN_VBEEPMODE*g_eeGeneral.hapticMode), LEN_VBEEPMODE, (sub==subN ? INVERS:0));
|
||||||
|
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.hapticMode, -2, 1);
|
||||||
|
if((y+=FH)>7*FH) return;
|
||||||
|
}subN++;
|
||||||
|
|
||||||
if(s_pgOfs<subN) {
|
if(s_pgOfs<subN) {
|
||||||
lcd_putsLeft( y, STR_HAPTICSTRENGTH);
|
lcd_putsLeft( y, STR_HAPTICSTRENGTH);
|
||||||
lcd_outdezAtt(PARAM_OFS, y, g_eeGeneral.hapticStrength, (sub==subN ? INVERS : 0)|LEFT);
|
lcd_outdezAtt(PARAM_OFS, y, g_eeGeneral.hapticStrength, (sub==subN ? INVERS : 0)|LEFT);
|
||||||
|
|
|
@ -287,7 +287,7 @@ void menuProcModelSelect(uint8_t event)
|
||||||
m_posVert = eeFindEmptyModel(s_copySrcRow, _event==EVT_KEY_FIRST(KEY_DOWN));
|
m_posVert = eeFindEmptyModel(s_copySrcRow, _event==EVT_KEY_FIRST(KEY_DOWN));
|
||||||
if (m_posVert == (uint8_t)-1) {
|
if (m_posVert == (uint8_t)-1) {
|
||||||
// no free room for duplicating the model
|
// no free room for duplicating the model
|
||||||
AUDIO_WARNING1();
|
AUDIO_ERROR();
|
||||||
m_posVert = oldSub;
|
m_posVert = oldSub;
|
||||||
s_copyMode = 0; // TODO only this one?
|
s_copyMode = 0; // TODO only this one?
|
||||||
s_copyTgtOfs = 0;
|
s_copyTgtOfs = 0;
|
||||||
|
|
|
@ -84,7 +84,8 @@ PACK(typedef struct t_EEGeneral {
|
||||||
uint8_t view; //index of subview in main scrren
|
uint8_t view; //index of subview in main scrren
|
||||||
uint8_t disableThrottleWarning:1;
|
uint8_t disableThrottleWarning:1;
|
||||||
int8_t switchWarning:2; // -1=down, 0=off, 1=up
|
int8_t switchWarning:2; // -1=down, 0=off, 1=up
|
||||||
uint8_t beeperVal:3;
|
int8_t beeperMode:2; // -2=quiet, -1=only alarms, 0=no keys, 1=all
|
||||||
|
uint8_t spare1:1;
|
||||||
uint8_t disableMemoryWarning:1;
|
uint8_t disableMemoryWarning:1;
|
||||||
uint8_t disableAlarmWarning:1;
|
uint8_t disableAlarmWarning:1;
|
||||||
uint8_t stickMode;
|
uint8_t stickMode;
|
||||||
|
@ -95,14 +96,16 @@ PACK(typedef struct t_EEGeneral {
|
||||||
uint8_t flashBeep:1;
|
uint8_t flashBeep:1;
|
||||||
uint8_t disableSplashScreen:1;
|
uint8_t disableSplashScreen:1;
|
||||||
uint8_t enableTelemetryAlarm:1; // 0=no, 1=yes (Sound alarm when there's no telem. data coming in)
|
uint8_t enableTelemetryAlarm:1; // 0=no, 1=yes (Sound alarm when there's no telem. data coming in)
|
||||||
uint8_t spare:2;
|
int8_t hapticMode:2; // -2=quiet, -1=only alarms, 0=no keys, 1=all
|
||||||
uint8_t filterInput;
|
uint8_t filterInput;
|
||||||
uint8_t lightAutoOff;
|
uint8_t lightAutoOff;
|
||||||
uint8_t templateSetup; //RETA order according to chout_ar array
|
uint8_t templateSetup; //RETA order according to chout_ar array
|
||||||
int8_t PPM_Multiplier;
|
int8_t PPM_Multiplier;
|
||||||
FrSkyRSSIAlarm frskyRssiAlarms[2];
|
FrSkyRSSIAlarm frskyRssiAlarms[2];
|
||||||
|
int8_t beeperLength:3;
|
||||||
|
uint8_t hapticStrength:3;
|
||||||
|
uint8_t spare2:2;
|
||||||
uint8_t speakerPitch;
|
uint8_t speakerPitch;
|
||||||
uint8_t hapticStrength;
|
|
||||||
}) EEGeneral;
|
}) EEGeneral;
|
||||||
|
|
||||||
// eeprom modelspec
|
// eeprom modelspec
|
||||||
|
|
|
@ -37,7 +37,8 @@ const pm_char STR_OPEN9X[] PROGMEM =
|
||||||
TR_OFFON
|
TR_OFFON
|
||||||
TR_MMMINV
|
TR_MMMINV
|
||||||
TR_NCHANNELS
|
TR_NCHANNELS
|
||||||
TR_VBEEPER
|
TR_VBEEPMODE
|
||||||
|
TR_VBEEPLEN
|
||||||
TR_ADCFILTER
|
TR_ADCFILTER
|
||||||
TR_WARNSW
|
TR_WARNSW
|
||||||
TR_TRNMODE
|
TR_TRNMODE
|
||||||
|
@ -146,7 +147,15 @@ const pm_char STR_USRDATA[] PROGMEM = TR_USRDATA;
|
||||||
const pm_char STR_BLADES[] PROGMEM = TR_BLADES; // TODO check that it is optimized away when no FRSKY
|
const pm_char STR_BLADES[] PROGMEM = TR_BLADES; // TODO check that it is optimized away when no FRSKY
|
||||||
const pm_char STR_BARS[] PROGMEM = TR_BARS;
|
const pm_char STR_BARS[] PROGMEM = TR_BARS;
|
||||||
const pm_char STR_CLEARMIXMENU[] PROGMEM = TR_CLEARMIXMENU;
|
const pm_char STR_CLEARMIXMENU[] PROGMEM = TR_CLEARMIXMENU;
|
||||||
const pm_char STR_BEEPER[] PROGMEM = TR_BEEPER;
|
const pm_char STR_BEEPERMODE[] PROGMEM = TR_BEEPERMODE;
|
||||||
|
const pm_char STR_BEEPERLEN[] PROGMEM = TR_BEEPERLEN;
|
||||||
|
#if defined(AUDIO)
|
||||||
|
const pm_char STR_SPKRPITCH[] PROGMEM = TR_SPKRPITCH;
|
||||||
|
#endif
|
||||||
|
#if defined(HAPTIC)
|
||||||
|
const pm_char STR_HAPTICMODE[] PROGMEM = TR_HAPTICMODE;
|
||||||
|
const pm_char STR_HAPTICSTRENGTH[] PROGMEM = TR_HAPTICSTRENGTH;
|
||||||
|
#endif
|
||||||
const pm_char STR_CONTRAST[] PROGMEM = TR_CONTRAST;
|
const pm_char STR_CONTRAST[] PROGMEM = TR_CONTRAST;
|
||||||
const pm_char STR_BATTERYWARNING[] PROGMEM = TR_BATTERYWARNING;
|
const pm_char STR_BATTERYWARNING[] PROGMEM = TR_BATTERYWARNING;
|
||||||
const pm_char STR_INACTIVITYALARM[] PROGMEM = TR_INACTIVITYALARM;
|
const pm_char STR_INACTIVITYALARM[] PROGMEM = TR_INACTIVITYALARM;
|
||||||
|
@ -263,11 +272,3 @@ const pm_char STR_RXNUM[] PROGMEM = TR_RXNUM;
|
||||||
#if defined(PXX)
|
#if defined(PXX)
|
||||||
const pm_char STR_SYNCMENU[] PROGMEM = TR_SYNCMENU;
|
const pm_char STR_SYNCMENU[] PROGMEM = TR_SYNCMENU;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAPTIC)
|
|
||||||
const pm_char STR_HAPTICSTRENGTH[] PROGMEM = TR_HAPTICSTRENGTH;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(AUDIO)
|
|
||||||
const pm_char STR_SPKRPITCH[] PROGMEM = TR_SPKRPITCH;
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -50,8 +50,9 @@ extern const pm_char STR_OPEN9X[];
|
||||||
#define OFS_OFFON 0
|
#define OFS_OFFON 0
|
||||||
#define OFS_MMMINV (OFS_OFFON + PSIZE(TR_OFFON))
|
#define OFS_MMMINV (OFS_OFFON + PSIZE(TR_OFFON))
|
||||||
#define OFS_NCHANNELS (OFS_MMMINV + PSIZE(TR_MMMINV))
|
#define OFS_NCHANNELS (OFS_MMMINV + PSIZE(TR_MMMINV))
|
||||||
#define OFS_VBEEPER (OFS_NCHANNELS + PSIZE(TR_NCHANNELS))
|
#define OFS_VBEEPMODE (OFS_NCHANNELS + PSIZE(TR_NCHANNELS))
|
||||||
#define OFS_ADCFILTER (OFS_VBEEPER + PSIZE(TR_VBEEPER))
|
#define OFS_VBEEPLEN (OFS_VBEEPMODE + PSIZE(TR_VBEEPMODE))
|
||||||
|
#define OFS_ADCFILTER (OFS_VBEEPLEN + PSIZE(TR_VBEEPLEN))
|
||||||
#define OFS_WARNSW (OFS_ADCFILTER + PSIZE(TR_ADCFILTER))
|
#define OFS_WARNSW (OFS_ADCFILTER + PSIZE(TR_ADCFILTER))
|
||||||
#define OFS_TRNMODE (OFS_WARNSW + PSIZE(TR_WARNSW))
|
#define OFS_TRNMODE (OFS_WARNSW + PSIZE(TR_WARNSW))
|
||||||
#define OFS_TRNCHN (OFS_TRNMODE + PSIZE(TR_TRNMODE))
|
#define OFS_TRNCHN (OFS_TRNMODE + PSIZE(TR_TRNMODE))
|
||||||
|
@ -110,7 +111,8 @@ extern const pm_char STR_OPEN9X[];
|
||||||
#define STR_ONOFF (STR_OPEN9X + OFS_OFFON + LEN_OFFON)
|
#define STR_ONOFF (STR_OPEN9X + OFS_OFFON + LEN_OFFON)
|
||||||
#define STR_MMMINV (STR_OPEN9X + OFS_MMMINV)
|
#define STR_MMMINV (STR_OPEN9X + OFS_MMMINV)
|
||||||
#define STR_NCHANNELS (STR_OPEN9X + OFS_NCHANNELS)
|
#define STR_NCHANNELS (STR_OPEN9X + OFS_NCHANNELS)
|
||||||
#define STR_VBEEPER (STR_OPEN9X + OFS_VBEEPER)
|
#define STR_VBEEPMODE (STR_OPEN9X + OFS_VBEEPMODE)
|
||||||
|
#define STR_VBEEPLEN (STR_OPEN9X + OFS_VBEEPLEN)
|
||||||
#define STR_ADCFILTER (STR_OPEN9X + OFS_ADCFILTER)
|
#define STR_ADCFILTER (STR_OPEN9X + OFS_ADCFILTER)
|
||||||
#define STR_WARNSW (STR_OPEN9X + OFS_WARNSW)
|
#define STR_WARNSW (STR_OPEN9X + OFS_WARNSW)
|
||||||
#define STR_TRNMODE (STR_OPEN9X + OFS_TRNMODE)
|
#define STR_TRNMODE (STR_OPEN9X + OFS_TRNMODE)
|
||||||
|
@ -227,7 +229,11 @@ extern const pm_char STR_USRDATA[];
|
||||||
extern const pm_char STR_BLADES[];
|
extern const pm_char STR_BLADES[];
|
||||||
extern const pm_char STR_BARS[];
|
extern const pm_char STR_BARS[];
|
||||||
extern const pm_char STR_CLEARMIXMENU[];
|
extern const pm_char STR_CLEARMIXMENU[];
|
||||||
extern const pm_char STR_BEEPER[];
|
extern const pm_char STR_BEEPERMODE[];
|
||||||
|
extern const pm_char STR_BEEPERLEN[];
|
||||||
|
extern const pm_char STR_SPKRPITCH[];
|
||||||
|
extern const pm_char STR_HAPTICMODE[];
|
||||||
|
extern const pm_char STR_HAPTICSTRENGTH[];
|
||||||
extern const pm_char STR_CONTRAST[];
|
extern const pm_char STR_CONTRAST[];
|
||||||
extern const pm_char STR_BATTERYWARNING[];
|
extern const pm_char STR_BATTERYWARNING[];
|
||||||
extern const pm_char STR_INACTIVITYALARM[];
|
extern const pm_char STR_INACTIVITYALARM[];
|
||||||
|
@ -320,7 +326,5 @@ extern const pm_char STR_MENUSTAT[];
|
||||||
extern const pm_char STR_MENUDEBUG[];
|
extern const pm_char STR_MENUDEBUG[];
|
||||||
extern const pm_char STR_RXNUM[];
|
extern const pm_char STR_RXNUM[];
|
||||||
extern const pm_char STR_SYNCMENU[];
|
extern const pm_char STR_SYNCMENU[];
|
||||||
extern const pm_char STR_HAPTICSTRENGTH[];
|
|
||||||
extern const pm_char STR_SPKRPITCH[];
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -634,8 +634,8 @@ void checkTHR()
|
||||||
|
|
||||||
void checkAlarm() // added by Gohst
|
void checkAlarm() // added by Gohst
|
||||||
{
|
{
|
||||||
if(g_eeGeneral.disableAlarmWarning) return;
|
if (g_eeGeneral.disableAlarmWarning) return;
|
||||||
if(!g_eeGeneral.beeperVal) alert(STR_ALARMSDISABLED);
|
if (g_eeGeneral.beeperMode == -2/*TODO constant*/) alert(STR_ALARMSDISABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkSwitches()
|
void checkSwitches()
|
||||||
|
@ -1088,9 +1088,7 @@ void evalFunctions()
|
||||||
#if defined(AUDIO)
|
#if defined(AUDIO)
|
||||||
audioDefevent(AU_FRSKY_FIRST+sd->param);
|
audioDefevent(AU_FRSKY_FIRST+sd->param);
|
||||||
#else
|
#else
|
||||||
if (g_eeGeneral.beeperVal>0) {
|
beep(3);
|
||||||
_beep(10);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#if defined(SOMO)
|
#if defined(SOMO)
|
||||||
|
|
|
@ -8,8 +8,11 @@
|
||||||
#define LEN_NCHANNELS 4
|
#define LEN_NCHANNELS 4
|
||||||
#define TR_NCHANNELS "4CH 6CH 8CH 10CH12CH14CH16CH"
|
#define TR_NCHANNELS "4CH 6CH 8CH 10CH12CH14CH16CH"
|
||||||
|
|
||||||
#define LEN_VBEEPER 6
|
#define LEN_VBEEPMODE 6
|
||||||
#define TR_VBEEPER "Quiet ""NoKey ""xShort""Short ""Norm ""Long ""xLong "
|
#define TR_VBEEPMODE "Quiet ""Alarms""NoKey ""Normal"
|
||||||
|
|
||||||
|
#define LEN_VBEEPLEN 6
|
||||||
|
#define TR_VBEEPLEN "xShort""Short ""Normal""Long ""xLong "
|
||||||
|
|
||||||
#define LEN_ADCFILTER 4
|
#define LEN_ADCFILTER 4
|
||||||
#define TR_ADCFILTER "SING""OSMP""FILT"
|
#define TR_ADCFILTER "SING""OSMP""FILT"
|
||||||
|
@ -194,7 +197,16 @@
|
||||||
#define TR_BLADES "Blades"
|
#define TR_BLADES "Blades"
|
||||||
#define TR_BARS "Bars"
|
#define TR_BARS "Bars"
|
||||||
#define TR_CLEARMIXMENU "CLEAR MIXES [MENU]"
|
#define TR_CLEARMIXMENU "CLEAR MIXES [MENU]"
|
||||||
#define TR_BEEPER "Beeper"
|
#ifdef AUDIO
|
||||||
|
#define TR_BEEPERMODE "Speaker Mode"
|
||||||
|
#define TR_BEEPERLEN "Speaker Length"
|
||||||
|
#define TR_SPKRPITCH "Speaker Pitch"
|
||||||
|
#else
|
||||||
|
#define TR_BEEPERMODE "Beeper Mode"
|
||||||
|
#define TR_BEEPERLEN "Beeper Length"
|
||||||
|
#endif
|
||||||
|
#define TR_HAPTICMODE "Haptic Mode"
|
||||||
|
#define TR_HAPTICSTRENGTH "Haptic Strength"
|
||||||
#define TR_CONTRAST "Contrast"
|
#define TR_CONTRAST "Contrast"
|
||||||
#define TR_BATTERYWARNING "Battery warning"
|
#define TR_BATTERYWARNING "Battery warning"
|
||||||
#define TR_INACTIVITYALARM "Inactivity alarm"
|
#define TR_INACTIVITYALARM "Inactivity alarm"
|
||||||
|
@ -286,5 +298,3 @@
|
||||||
#define TR_MENUDEBUG "DEBUG"
|
#define TR_MENUDEBUG "DEBUG"
|
||||||
#define TR_RXNUM "RxNum"
|
#define TR_RXNUM "RxNum"
|
||||||
#define TR_SYNCMENU "Sync [MENU]"
|
#define TR_SYNCMENU "Sync [MENU]"
|
||||||
#define TR_HAPTICSTRENGTH "Haptic Strength"
|
|
||||||
#define TR_SPKRPITCH "Speaker Pitch"
|
|
||||||
|
|
|
@ -8,8 +8,11 @@
|
||||||
#define LEN_NCHANNELS 4
|
#define LEN_NCHANNELS 4
|
||||||
#define TR_NCHANNELS "4CH 6CH 8CH 10CH12CH14CH16CH"
|
#define TR_NCHANNELS "4CH 6CH 8CH 10CH12CH14CH16CH"
|
||||||
|
|
||||||
#define LEN_VBEEPER 6
|
#define LEN_VBEEPMODE 6
|
||||||
#define TR_VBEEPER "Quiet ""NoKey ""xShort""Court ""Norm ""Long ""xLong "
|
#define TR_VBEEPMODE "Quiet ""Alarms""NoKey ""Normal"
|
||||||
|
|
||||||
|
#define LEN_VBEEPLEN 6
|
||||||
|
#define TR_VBEEPLEN "xShort""Short ""Normal""Long ""xLong "
|
||||||
|
|
||||||
#define LEN_ADCFILTER 4
|
#define LEN_ADCFILTER 4
|
||||||
#define TR_ADCFILTER "SING""OSMP""FILT"
|
#define TR_ADCFILTER "SING""OSMP""FILT"
|
||||||
|
@ -194,7 +197,16 @@
|
||||||
#define TR_BLADES "Blades"
|
#define TR_BLADES "Blades"
|
||||||
#define TR_BARS "Bars"
|
#define TR_BARS "Bars"
|
||||||
#define TR_CLEARMIXMENU "EFFACER MIXAGES[MENU]"
|
#define TR_CLEARMIXMENU "EFFACER MIXAGES[MENU]"
|
||||||
#define TR_BEEPER "Bipeur"
|
#ifdef AUDIO
|
||||||
|
#define TR_BEEPERMODE "Speaker Mode"
|
||||||
|
#define TR_BEEPERLEN "Speaker Length"
|
||||||
|
#define TR_SPKRPITCH "Speaker Pitch"
|
||||||
|
#else
|
||||||
|
#define TR_BEEPERMODE "Beeper Mode"
|
||||||
|
#define TR_BEEPERLEN "Beeper Length"
|
||||||
|
#endif
|
||||||
|
#define TR_HAPTICMODE "Mode Vibreur"
|
||||||
|
#define TR_HAPTICSTRENGTH "Haptic Strength"
|
||||||
#define TR_CONTRAST "Contraste"
|
#define TR_CONTRAST "Contraste"
|
||||||
#define TR_BATTERYWARNING "Alarme Batterie"
|
#define TR_BATTERYWARNING "Alarme Batterie"
|
||||||
#define TR_INACTIVITYALARM "Alarme inactivite"
|
#define TR_INACTIVITYALARM "Alarme inactivite"
|
||||||
|
@ -286,5 +298,3 @@
|
||||||
#define TR_MENUDEBUG "DEBUG"
|
#define TR_MENUDEBUG "DEBUG"
|
||||||
#define TR_RXNUM "RxNum"
|
#define TR_RXNUM "RxNum"
|
||||||
#define TR_SYNCMENU "Sync [MENU]"
|
#define TR_SYNCMENU "Sync [MENU]"
|
||||||
#define TR_HAPTICSTRENGTH "Haptic Strength"
|
|
||||||
#define TR_SPKRPITCH "Speaker Pitch"
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue