[all] Issue 4 fixed (Mixer menu)
[sky9x / Taranis] Issue 1 fixed (PlayFile/Play were called from an interrupt). To be tested and re-tested [all] FrSky alarms are not any more sent from the 10ms interrupt, but from the main loop. To be tested as well
This commit is contained in:
+8
-8
@@ -794,23 +794,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 +821,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:
|
||||
|
||||
+1
-3
@@ -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)
|
||||
|
||||
+43
-41
@@ -124,8 +124,7 @@ 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;
|
||||
@@ -133,6 +132,9 @@ void audioQueue::play(uint8_t tFreq, uint8_t tLen, uint8_t tPause,
|
||||
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,7 +167,7 @@ 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
|
||||
|
||||
@@ -179,13 +181,13 @@ void audioQueue::event(uint8_t e, uint8_t f)
|
||||
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 +232,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 +257,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:
|
||||
|
||||
+12
-14
@@ -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); }
|
||||
@@ -142,21 +142,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)
|
||||
|
||||
+1
-3
@@ -76,9 +76,7 @@ extern void beep(uint8_t val);
|
||||
#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_MIX_WARNING(x) beep(1)
|
||||
#define AUDIO_POT_STICK_MIDDLE() beep(2)
|
||||
#define AUDIO_VARIO_UP() _beep(1)
|
||||
#define AUDIO_VARIO_DOWN() _beep(1)
|
||||
|
||||
+1
-1
@@ -121,7 +121,7 @@ void getGpsDistance()
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY) && defined(VARIO)
|
||||
void varioPoll10ms()
|
||||
void varioWakeup()
|
||||
{
|
||||
static uint16_t s_varioTmr = 0;
|
||||
if (isFunctionActive(FUNC_VARIO)) {
|
||||
|
||||
+63
-8
@@ -89,7 +89,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,
|
||||
@@ -402,16 +402,16 @@ void menuModelSelect(uint8_t event)
|
||||
_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);
|
||||
@@ -2505,7 +2505,14 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||
|
||||
uint8_t chn = (expo ? expoaddress(s_currIdx)->chn+1 : mixaddress(s_currIdx)->destCh+1);
|
||||
|
||||
switch(event)
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
uint8_t _event = event;
|
||||
if (s_menu_count) {
|
||||
event = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (event)
|
||||
{
|
||||
case EVT_ENTRY:
|
||||
case EVT_ENTRY_UP:
|
||||
@@ -2559,6 +2566,25 @@ 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 = 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);
|
||||
}
|
||||
#else
|
||||
if (s_currCh) {
|
||||
if (reachExpoMixCountLimit(expo)) break;
|
||||
insertExpoMix(expo, s_currIdx);
|
||||
@@ -2566,6 +2592,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 +2600,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;
|
||||
@@ -2757,6 +2784,34 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||
}
|
||||
s_maxLines = cur;
|
||||
if (sub >= s_maxLines-1) m_posVert = s_maxLines-1;
|
||||
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
if (s_menu_count) {
|
||||
const char * result = displayMenu(_event);
|
||||
if (result) {
|
||||
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 = sub;
|
||||
}
|
||||
else if (result == STR_DELETE) {
|
||||
deleteExpoMix(expo, s_currIdx);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void menuModelExposAll(uint8_t event)
|
||||
@@ -3077,7 +3132,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});
|
||||
|
||||
+1
-5
@@ -261,11 +261,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
|
||||
|
||||
+27
-21
@@ -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();
|
||||
@@ -2013,12 +2010,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()
|
||||
@@ -2763,7 +2757,9 @@ void perOut(uint8_t mode, uint8_t tick10ms)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (md->mixWarn) lv_mixWarning |= 1 << (md->mixWarn - 1); // Mix warning
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -2956,7 +2952,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 +3034,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 +3246,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 +3254,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,8 +3447,8 @@ void perMain()
|
||||
|
||||
checkBacklight();
|
||||
|
||||
#if defined(CPUARM) && defined(FRSKY)
|
||||
telemetryPoll10ms();
|
||||
#if defined(FRSKY)
|
||||
telemetryWakeup();
|
||||
#endif
|
||||
|
||||
lcd_clear();
|
||||
|
||||
+25
-18
@@ -177,32 +177,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"
|
||||
@@ -1148,9 +1154,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 {
|
||||
@@ -1354,7 +1361,7 @@ void checkMinMaxAltitude();
|
||||
void evalVario(int16_t altitude_bp, uint16_t altitude_ap);
|
||||
void getGpsPilotPosition();
|
||||
void getGpsDistance();
|
||||
void varioPoll10ms();
|
||||
void varioWakeup();
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -306,7 +306,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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -109,6 +109,7 @@ void sdInit();
|
||||
void sdPoll10ms();
|
||||
#define sdMountPoll()
|
||||
uint32_t sdMounted();
|
||||
#define SD_CARD_PRESENT() (1)
|
||||
#endif
|
||||
|
||||
// Pulses driver
|
||||
|
||||
@@ -161,7 +161,7 @@ static void socket_cp_init(void)
|
||||
|
||||
static inline DWORD socket_is_empty(void)
|
||||
{
|
||||
return 0; /* fake inserted */
|
||||
return !SD_CARD_PRESENT(); /* fake inserted */
|
||||
}
|
||||
|
||||
static void card_power(BYTE on)
|
||||
|
||||
+12
-10
@@ -274,6 +274,8 @@
|
||||
#endif
|
||||
|
||||
// SD - SPI2
|
||||
#define SD_PRESENT_GPIO GPIOD->IDR
|
||||
#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 +295,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 +305,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 +326,4 @@
|
||||
#define I2C_EEPROM_ADDRESS 0xA2
|
||||
#define I2C_CAT5137_ADDRESS 0x5C //0101110
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -36,9 +36,6 @@ extern "C" {
|
||||
|
||||
#define STORAGE_LUN_NBR 1
|
||||
|
||||
// TODO ... perhaps something more adequate ;)
|
||||
#define SD_GetStatus() (0)
|
||||
|
||||
/* USB Mass storage Standard Inquiry Data */
|
||||
const unsigned char STORAGE_Inquirydata[] = {//36
|
||||
|
||||
@@ -123,7 +120,7 @@ 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 )
|
||||
if (!SD_CARD_PRESENT())
|
||||
return -1;
|
||||
|
||||
*block_size = 512;
|
||||
@@ -143,20 +140,7 @@ 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(SD_GetStatus() != 0)
|
||||
{
|
||||
last_status = -1;
|
||||
return (-1);
|
||||
}
|
||||
return (0);
|
||||
return SD_CARD_PRESENT() ? 0 : -1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -178,7 +162,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,
|
||||
@@ -193,10 +176,7 @@ int8_t STORAGE_Read (uint8_t lun,
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
#if 0
|
||||
SD_WaitReadOperation();
|
||||
while (SD_GetStatus() != SD_TRANSFER_OK);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
@@ -222,10 +202,7 @@ int8_t STORAGE_Write (uint8_t lun,
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
#if 0
|
||||
SD_WaitWriteOperation();
|
||||
while (SD_GetStatus() != SD_TRANSFER_OK);
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
+32
-29
@@ -621,35 +621,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 +660,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
|
||||
|
||||
@@ -607,7 +607,7 @@ void MAVLINK10mspoll(uint8_t count) {
|
||||
}
|
||||
}
|
||||
|
||||
void telemetryPoll10ms() {
|
||||
void telemetryWakeup() {
|
||||
uint16_t tmr10ms = get_tmr10ms();
|
||||
uint8_t count = tmr10ms & 0x0f; // 15*10ms
|
||||
if (!count) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -331,6 +331,12 @@ 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";
|
||||
#endif
|
||||
|
||||
#if defined(SDCARD)
|
||||
|
||||
@@ -439,6 +439,12 @@ 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[];
|
||||
#endif
|
||||
|
||||
#if defined(SDCARD)
|
||||
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user