[Taranis] SWR implemented with popup when SWR > 0x33 (Tx antenna problem)
[Taranis] RSSI/A1/A2 alarms [Taranis] Better code when no pulses sent (internal or external module). Thanks Mike! [Taranis] Correction on DEBUG serial code
This commit is contained in:
+49
-13
@@ -56,8 +56,10 @@ uint16_t Sine_values[] =
|
|||||||
const char * audioFilenames[] = {
|
const char * audioFilenames[] = {
|
||||||
"inactiv",
|
"inactiv",
|
||||||
"lowbatt",
|
"lowbatt",
|
||||||
|
#if defined(PCBSKY9X)
|
||||||
"highmah",
|
"highmah",
|
||||||
"hightemp",
|
"hightemp",
|
||||||
|
#endif
|
||||||
"thralert",
|
"thralert",
|
||||||
"swalert",
|
"swalert",
|
||||||
"eebad",
|
"eebad",
|
||||||
@@ -80,10 +82,18 @@ const char * audioFilenames[] = {
|
|||||||
"timerlt3",
|
"timerlt3",
|
||||||
"timer10",
|
"timer10",
|
||||||
"timer20",
|
"timer20",
|
||||||
"timer30"
|
"timer30",
|
||||||
|
#if defined(PCBTARANIS)
|
||||||
|
"a1_org",
|
||||||
|
"a1_red",
|
||||||
|
"a2_org",
|
||||||
|
"a2_red",
|
||||||
|
"rssi_org",
|
||||||
|
"rssi_red",
|
||||||
|
"swr_red",
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
uint32_t sdAvailableSystemAudioFiles = 0;
|
uint32_t sdAvailableSystemAudioFiles = 0;
|
||||||
uint8_t sdAvailablePhaseAudioFiles[MAX_PHASES] = { 0 };
|
uint8_t sdAvailablePhaseAudioFiles[MAX_PHASES] = { 0 };
|
||||||
uint8_t sdAvailableMixerAudioFiles[MAX_MIXERS] = { 0 };
|
uint8_t sdAvailableMixerAudioFiles[MAX_MIXERS] = { 0 };
|
||||||
@@ -740,6 +750,7 @@ void audioEvent(uint8_t e, uint8_t f)
|
|||||||
audioQueue.play(160, 40, 6, 2, -1);
|
audioQueue.play(160, 40, 6, 2, -1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#if defined(PCBSKY9X)
|
||||||
case AU_TX_MAH_HIGH:
|
case AU_TX_MAH_HIGH:
|
||||||
if (!audioQueue.busy()) {
|
if (!audioQueue.busy()) {
|
||||||
// TODO Rob something better here?
|
// TODO Rob something better here?
|
||||||
@@ -754,7 +765,7 @@ void audioEvent(uint8_t e, uint8_t f)
|
|||||||
audioQueue.play(160, 40, 6, 2, -1);
|
audioQueue.play(160, 40, 6, 2, -1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
// error
|
#endif
|
||||||
#if defined(VOICE)
|
#if defined(VOICE)
|
||||||
case AU_THROTTLE_ALERT:
|
case AU_THROTTLE_ALERT:
|
||||||
case AU_SWITCH_ALERT:
|
case AU_SWITCH_ALERT:
|
||||||
@@ -814,22 +825,47 @@ void audioEvent(uint8_t e, uint8_t f)
|
|||||||
case AU_MIX_WARNING_3:
|
case AU_MIX_WARNING_3:
|
||||||
audioQueue.play(BEEP_DEFAULT_FREQ+112, 12, 8, PLAY_REPEAT(2));
|
audioQueue.play(BEEP_DEFAULT_FREQ+112, 12, 8, PLAY_REPEAT(2));
|
||||||
break;
|
break;
|
||||||
// time 30 seconds left
|
// time <3 seconds left
|
||||||
case AU_TIMER_30:
|
case AU_TIMER_LT3:
|
||||||
audioQueue.play(BEEP_DEFAULT_FREQ, 30, 6, PLAY_REPEAT(2)|PLAY_NOW);
|
audioQueue.play(BEEP_DEFAULT_FREQ+10, 30, 6, PLAY_NOW);
|
||||||
break;
|
|
||||||
// time 20 seconds left
|
|
||||||
case AU_TIMER_20:
|
|
||||||
audioQueue.play(BEEP_DEFAULT_FREQ, 30, 6, PLAY_REPEAT(1)|PLAY_NOW);
|
|
||||||
break;
|
break;
|
||||||
// time 10 seconds left
|
// time 10 seconds left
|
||||||
case AU_TIMER_10:
|
case AU_TIMER_10:
|
||||||
audioQueue.play(BEEP_DEFAULT_FREQ, 30, 6, PLAY_NOW);
|
audioQueue.play(BEEP_DEFAULT_FREQ, 30, 6, PLAY_NOW);
|
||||||
break;
|
break;
|
||||||
// time <3 seconds left
|
// time 20 seconds left
|
||||||
case AU_TIMER_LT3:
|
case AU_TIMER_20:
|
||||||
audioQueue.play(BEEP_DEFAULT_FREQ+10, 30, 6, PLAY_NOW);
|
audioQueue.play(BEEP_DEFAULT_FREQ, 30, 6, PLAY_REPEAT(1)|PLAY_NOW);
|
||||||
break;
|
break;
|
||||||
|
// time 30 seconds left
|
||||||
|
case AU_TIMER_30:
|
||||||
|
audioQueue.play(BEEP_DEFAULT_FREQ, 30, 6, PLAY_REPEAT(2)|PLAY_NOW);
|
||||||
|
break;
|
||||||
|
#if defined(PCBTARANIS)
|
||||||
|
case AU_A1_ORANGE:
|
||||||
|
audioQueue.play(BEEP_DEFAULT_FREQ+40, 30, 6, PLAY_NOW);
|
||||||
|
break;
|
||||||
|
case AU_A1_RED:
|
||||||
|
audioQueue.play(BEEP_DEFAULT_FREQ+40, 30, 6, PLAY_REPEAT(1)|PLAY_NOW);
|
||||||
|
break;
|
||||||
|
case AU_A2_ORANGE:
|
||||||
|
audioQueue.play(BEEP_DEFAULT_FREQ+80, 30, 6, PLAY_NOW);
|
||||||
|
break;
|
||||||
|
case AU_A2_RED:
|
||||||
|
audioQueue.play(BEEP_DEFAULT_FREQ+80, 30, 6, PLAY_REPEAT(1)|PLAY_NOW);
|
||||||
|
break;
|
||||||
|
case AU_RSSI_ORANGE:
|
||||||
|
audioQueue.play(BEEP_DEFAULT_FREQ+120, 30, 6, PLAY_NOW);
|
||||||
|
break;
|
||||||
|
case AU_RSSI_RED:
|
||||||
|
audioQueue.play(BEEP_DEFAULT_FREQ+120, 30, 6, PLAY_REPEAT(1)|PLAY_NOW);
|
||||||
|
break;
|
||||||
|
case AU_SWR_RED:
|
||||||
|
// siren
|
||||||
|
audioQueue.play(20, 40, 10, 2, 1);
|
||||||
|
audioQueue.pause(200);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case AU_FRSKY_BEEP1:
|
case AU_FRSKY_BEEP1:
|
||||||
audioQueue.play(BEEP_DEFAULT_FREQ, 15, 2);
|
audioQueue.play(BEEP_DEFAULT_FREQ, 15, 2);
|
||||||
audioQueue.pause(200);
|
audioQueue.pause(200);
|
||||||
|
|||||||
@@ -174,8 +174,10 @@ void audioStart();
|
|||||||
#define AUDIO_WARNING1() AUDIO_BUZZER(audioEvent(AU_WARNING1), beep(3))
|
#define AUDIO_WARNING1() AUDIO_BUZZER(audioEvent(AU_WARNING1), beep(3))
|
||||||
#define AUDIO_WARNING2() AUDIO_BUZZER(audioEvent(AU_WARNING2), beep(2))
|
#define AUDIO_WARNING2() AUDIO_BUZZER(audioEvent(AU_WARNING2), beep(2))
|
||||||
#define AUDIO_TX_BATTERY_LOW() AUDIO_BUZZER(audioEvent(AU_TX_BATTERY_LOW), beep(4))
|
#define AUDIO_TX_BATTERY_LOW() AUDIO_BUZZER(audioEvent(AU_TX_BATTERY_LOW), beep(4))
|
||||||
|
#if defined(PCBSKY9X)
|
||||||
#define AUDIO_TX_MAH_HIGH() audioEvent(AU_TX_MAH_HIGH)
|
#define AUDIO_TX_MAH_HIGH() audioEvent(AU_TX_MAH_HIGH)
|
||||||
#define AUDIO_TX_TEMP_HIGH() audioEvent(AU_TX_TEMP_HIGH)
|
#define AUDIO_TX_TEMP_HIGH() audioEvent(AU_TX_TEMP_HIGH)
|
||||||
|
#endif
|
||||||
#define AUDIO_ERROR() AUDIO_BUZZER(audioEvent(AU_ERROR), beep(4))
|
#define AUDIO_ERROR() AUDIO_BUZZER(audioEvent(AU_ERROR), beep(4))
|
||||||
#define AUDIO_TIMER_30() AUDIO_BUZZER(audioEvent(AU_TIMER_30), { beepAgain=2; beep(2); })
|
#define AUDIO_TIMER_30() AUDIO_BUZZER(audioEvent(AU_TIMER_30), { beepAgain=2; beep(2); })
|
||||||
#define AUDIO_TIMER_20() AUDIO_BUZZER(audioEvent(AU_TIMER_20), { beepAgain=1; beep(2); })
|
#define AUDIO_TIMER_20() AUDIO_BUZZER(audioEvent(AU_TIMER_20), { beepAgain=1; beep(2); })
|
||||||
@@ -192,6 +194,16 @@ void audioStart();
|
|||||||
#define AUDIO_PLAY(p) audioEvent(p)
|
#define AUDIO_PLAY(p) audioEvent(p)
|
||||||
#define AUDIO_VARIO(f, t) audioQueue.play(f, t, 0, PLAY_BACKGROUND)
|
#define AUDIO_VARIO(f, t) audioQueue.play(f, t, 0, PLAY_BACKGROUND)
|
||||||
|
|
||||||
|
#if defined(PCBTARANIS)
|
||||||
|
#define AUDIO_A1_ORANGE() audioEvent(AU_A1_ORANGE)
|
||||||
|
#define AUDIO_A1_RED() audioEvent(AU_A1_RED)
|
||||||
|
#define AUDIO_A2_ORANGE() audioEvent(AU_A2_ORANGE)
|
||||||
|
#define AUDIO_A2_RED() audioEvent(AU_A2_RED)
|
||||||
|
#define AUDIO_RSSI_ORANGE() audioEvent(AU_RSSI_ORANGE)
|
||||||
|
#define AUDIO_RSSI_RED() audioEvent(AU_RSSI_RED)
|
||||||
|
#define AUDIO_SWR_RED() audioEvent(AU_SWR_RED)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define AUDIO_HEARTBEAT()
|
#define AUDIO_HEARTBEAT()
|
||||||
|
|
||||||
#define SYSTEM_AUDIO_CATEGORY 0
|
#define SYSTEM_AUDIO_CATEGORY 0
|
||||||
|
|||||||
+26
-14
@@ -4338,20 +4338,16 @@ enum menuModelTelemetryItems {
|
|||||||
ITEM_TELEMETRY_A1_LABEL,
|
ITEM_TELEMETRY_A1_LABEL,
|
||||||
ITEM_TELEMETRY_A1_RANGE,
|
ITEM_TELEMETRY_A1_RANGE,
|
||||||
ITEM_TELEMETRY_A1_OFFSET,
|
ITEM_TELEMETRY_A1_OFFSET,
|
||||||
#if !defined(PCBTARANIS)
|
|
||||||
ITEM_TELEMETRY_A1_ALARM1,
|
ITEM_TELEMETRY_A1_ALARM1,
|
||||||
ITEM_TELEMETRY_A1_ALARM2,
|
ITEM_TELEMETRY_A1_ALARM2,
|
||||||
#endif
|
|
||||||
ITEM_TELEMETRY_A2_LABEL,
|
ITEM_TELEMETRY_A2_LABEL,
|
||||||
ITEM_TELEMETRY_A2_RANGE,
|
ITEM_TELEMETRY_A2_RANGE,
|
||||||
ITEM_TELEMETRY_A2_OFFSET,
|
ITEM_TELEMETRY_A2_OFFSET,
|
||||||
#if !defined(PCBTARANIS)
|
|
||||||
ITEM_TELEMETRY_A2_ALARM1,
|
ITEM_TELEMETRY_A2_ALARM1,
|
||||||
ITEM_TELEMETRY_A2_ALARM2,
|
ITEM_TELEMETRY_A2_ALARM2,
|
||||||
ITEM_TELEMETRY_RSSI_LABEL,
|
ITEM_TELEMETRY_RSSI_LABEL,
|
||||||
ITEM_TELEMETRY_RSSI_ALARM1,
|
ITEM_TELEMETRY_RSSI_ALARM1,
|
||||||
ITEM_TELEMETRY_RSSI_ALARM2,
|
ITEM_TELEMETRY_RSSI_ALARM2,
|
||||||
#endif
|
|
||||||
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
|
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
|
||||||
ITEM_TELEMETRY_USR_LABEL,
|
ITEM_TELEMETRY_USR_LABEL,
|
||||||
#if !defined(PCBTARANIS)
|
#if !defined(PCBTARANIS)
|
||||||
@@ -4395,10 +4391,11 @@ enum menuModelTelemetryItems {
|
|||||||
#if defined(FRSKY)
|
#if defined(FRSKY)
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
#define TELEM_COL1 (1*FW)
|
#define TELEM_COL1 (1*FW)
|
||||||
#define TELEM_COL2 (13*FW)
|
#define TELEM_COL2 (16*FW)
|
||||||
#define TELEM_COL3 (25*FW)
|
#define TELEM_COL3 (28*FW)
|
||||||
#define TELEM_BARS_COLMIN (3*FW+56)
|
#define TELEM_BARS_COLMIN (3*FW+56)
|
||||||
#define TELEM_BARS_COLMAX (20*FW-3)
|
#define TELEM_BARS_COLMAX (20*FW-3)
|
||||||
|
#define TELEM_SCRTYPE_COL (10*FW)
|
||||||
#else
|
#else
|
||||||
#define TELEM_COL1 INDENT_WIDTH
|
#define TELEM_COL1 INDENT_WIDTH
|
||||||
#if defined(TRANSLATIONS_FR) || defined(TRANSLATIONS_CZ)
|
#if defined(TRANSLATIONS_FR) || defined(TRANSLATIONS_CZ)
|
||||||
@@ -4408,11 +4405,12 @@ enum menuModelTelemetryItems {
|
|||||||
#endif
|
#endif
|
||||||
#define TELEM_BARS_COLMIN (56-3*FW)
|
#define TELEM_BARS_COLMIN (56-3*FW)
|
||||||
#define TELEM_BARS_COLMAX (14*FW-3)
|
#define TELEM_BARS_COLMAX (14*FW-3)
|
||||||
|
#define TELEM_SCRTYPE_COL (10*FW)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define CHANNEL_ROWS (uint8_t)-1, 1, 0,
|
#define CHANNEL_ROWS (uint8_t)-1, 1, 0, 0, 0,
|
||||||
#define RSSI_ROWS
|
#define RSSI_ROWS (uint8_t)-1, 0, 0,
|
||||||
#else
|
#else
|
||||||
#define CHANNEL_ROWS (uint8_t)-1, 1, 0, 2, 2,
|
#define CHANNEL_ROWS (uint8_t)-1, 1, 0, 2, 2,
|
||||||
#define RSSI_ROWS (uint8_t)-1, 1, 1,
|
#define RSSI_ROWS (uint8_t)-1, 1, 1,
|
||||||
@@ -4424,17 +4422,17 @@ void menuModelTelemetry(uint8_t event)
|
|||||||
|
|
||||||
uint8_t sub = m_posVert - 1;
|
uint8_t sub = m_posVert - 1;
|
||||||
|
|
||||||
|
#if !defined(PCBTARANIS)
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case EVT_KEY_BREAK(KEY_DOWN):
|
case EVT_KEY_BREAK(KEY_DOWN):
|
||||||
case EVT_KEY_BREAK(KEY_UP):
|
case EVT_KEY_BREAK(KEY_UP):
|
||||||
#if !defined(PCBTARANIS)
|
|
||||||
case EVT_KEY_BREAK(KEY_LEFT):
|
case EVT_KEY_BREAK(KEY_LEFT):
|
||||||
case EVT_KEY_BREAK(KEY_RIGHT):
|
case EVT_KEY_BREAK(KEY_RIGHT):
|
||||||
if (s_editMode>0 && sub<=ITEM_TELEMETRY_RSSI_ALARM2)
|
if (s_editMode>0 && sub<=ITEM_TELEMETRY_RSSI_ALARM2)
|
||||||
frskySendAlarms(); // update FrSky module when edit mode exited
|
frskySendAlarms(); // update FrSky module when edit mode exited
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
uint8_t y = 1 + 1*FH + i*FH;
|
uint8_t y = 1 + 1*FH + i*FH;
|
||||||
@@ -4485,13 +4483,19 @@ void menuModelTelemetry(uint8_t event)
|
|||||||
if (attr) channel.offset = checkIncDec(event, channel.offset, -256, 256, EE_MODEL);
|
if (attr) channel.offset = checkIncDec(event, channel.offset, -256, 256, EE_MODEL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if !defined(PCBTARANIS)
|
|
||||||
case ITEM_TELEMETRY_A1_ALARM1:
|
case ITEM_TELEMETRY_A1_ALARM1:
|
||||||
case ITEM_TELEMETRY_A1_ALARM2:
|
case ITEM_TELEMETRY_A1_ALARM2:
|
||||||
case ITEM_TELEMETRY_A2_ALARM1:
|
case ITEM_TELEMETRY_A2_ALARM1:
|
||||||
case ITEM_TELEMETRY_A2_ALARM2:
|
case ITEM_TELEMETRY_A2_ALARM2:
|
||||||
{
|
{
|
||||||
uint8_t j = ((k==ITEM_TELEMETRY_A1_ALARM1 || k==ITEM_TELEMETRY_A2_ALARM1) ? 0 : 1);
|
uint8_t j = ((k==ITEM_TELEMETRY_A1_ALARM1 || k==ITEM_TELEMETRY_A2_ALARM1) ? 0 : 1);
|
||||||
|
#if defined(PCBTARANIS)
|
||||||
|
lcd_putsLeft(y, (j==0 ? INDENT "Low Alarm" : INDENT "Critical Alarm"));
|
||||||
|
putsTelemetryChannel(TELEM_COL2, y, dest, channel.alarms_value[j], LEFT|attr);
|
||||||
|
if (attr && (s_editMode>0 || p1valdiff)) {
|
||||||
|
channel.alarms_value[j] = checkIncDec(event, channel.alarms_value[j], 0, 255, EE_MODEL);
|
||||||
|
}
|
||||||
|
#else
|
||||||
lcd_putsLeft(y, STR_ALARM);
|
lcd_putsLeft(y, STR_ALARM);
|
||||||
lcd_putsiAtt(TELEM_COL2, y, STR_VALARM, ALARM_LEVEL(ch, j), m_posHorz<=0 ? attr : 0);
|
lcd_putsiAtt(TELEM_COL2, y, STR_VALARM, ALARM_LEVEL(ch, j), m_posHorz<=0 ? attr : 0);
|
||||||
lcd_putsiAtt(TELEM_COL2+4*FW, y, STR_VALARMFN, ALARM_GREATER(ch, j), (m_posHorz<0 || m_posHorz==1) ? attr : 0);
|
lcd_putsiAtt(TELEM_COL2+4*FW, y, STR_VALARMFN, ALARM_GREATER(ch, j), (m_posHorz<0 || m_posHorz==1) ? attr : 0);
|
||||||
@@ -4516,6 +4520,7 @@ void menuModelTelemetry(uint8_t event)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4526,6 +4531,13 @@ void menuModelTelemetry(uint8_t event)
|
|||||||
case ITEM_TELEMETRY_RSSI_ALARM1:
|
case ITEM_TELEMETRY_RSSI_ALARM1:
|
||||||
case ITEM_TELEMETRY_RSSI_ALARM2: {
|
case ITEM_TELEMETRY_RSSI_ALARM2: {
|
||||||
uint8_t j = k-ITEM_TELEMETRY_RSSI_ALARM1;
|
uint8_t j = k-ITEM_TELEMETRY_RSSI_ALARM1;
|
||||||
|
#if defined(PCBTARANIS)
|
||||||
|
lcd_putsLeft(y, (j==0 ? INDENT "Low Alarm" : INDENT "Critical Alarm"));
|
||||||
|
lcd_outdezNAtt(TELEM_COL2, y, getRssiAlarmValue(j), LEFT|attr, 3);
|
||||||
|
if (attr && (s_editMode>0 || p1valdiff)) {
|
||||||
|
CHECK_INCDEC_MODELVAR(event, g_model.frsky.rssiAlarms[j].value, -30, 30);
|
||||||
|
}
|
||||||
|
#else
|
||||||
lcd_putsLeft(y, STR_ALARM);
|
lcd_putsLeft(y, STR_ALARM);
|
||||||
lcd_putsiAtt(TELEM_COL2, y, STR_VALARM, ((2+j+g_model.frsky.rssiAlarms[j].level)%4), m_posHorz<=0 ? attr : 0);
|
lcd_putsiAtt(TELEM_COL2, y, STR_VALARM, ((2+j+g_model.frsky.rssiAlarms[j].level)%4), m_posHorz<=0 ? attr : 0);
|
||||||
lcd_putc(TELEM_COL2+4*FW, y, '<');
|
lcd_putc(TELEM_COL2+4*FW, y, '<');
|
||||||
@@ -4541,9 +4553,9 @@ void menuModelTelemetry(uint8_t event)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
|
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
|
||||||
case ITEM_TELEMETRY_USR_LABEL:
|
case ITEM_TELEMETRY_USR_LABEL:
|
||||||
@@ -4624,7 +4636,7 @@ void menuModelTelemetry(uint8_t event)
|
|||||||
uint8_t screenIndex = (k < ITEM_TELEMETRY_SCREEN_LABEL2 ? 0 : (k < ITEM_TELEMETRY_SCREEN_LABEL3 ? 1 : 2));
|
uint8_t screenIndex = (k < ITEM_TELEMETRY_SCREEN_LABEL2 ? 0 : (k < ITEM_TELEMETRY_SCREEN_LABEL3 ? 1 : 2));
|
||||||
bool screenType = IS_BARS_SCREEN(screenIndex);
|
bool screenType = IS_BARS_SCREEN(screenIndex);
|
||||||
putsStrIdx(0*FW, y, STR_SCREEN, screenIndex+1);
|
putsStrIdx(0*FW, y, STR_SCREEN, screenIndex+1);
|
||||||
if (screenType != selectMenuItem(10*FW, y, PSTR(""), STR_VSCREEN, screenType, 0, 1, attr, event))
|
if (screenType != selectMenuItem(TELEM_SCRTYPE_COL, y, PSTR(""), STR_VSCREEN, screenType, 0, 1, attr, event))
|
||||||
g_model.frsky.screensType ^= (1 << screenIndex);
|
g_model.frsky.screensType ^= (1 << screenIndex);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -4633,7 +4645,7 @@ void menuModelTelemetry(uint8_t event)
|
|||||||
uint8_t screenIndex = (k < ITEM_TELEMETRY_SCREEN_LABEL2 ? 1 : 2);
|
uint8_t screenIndex = (k < ITEM_TELEMETRY_SCREEN_LABEL2 ? 1 : 2);
|
||||||
bool screenType = g_model.frsky.screensType & screenIndex;
|
bool screenType = g_model.frsky.screensType & screenIndex;
|
||||||
putsStrIdx(0*FW, y, STR_SCREEN, screenIndex);
|
putsStrIdx(0*FW, y, STR_SCREEN, screenIndex);
|
||||||
if (screenType != selectMenuItem(10*FW, y, PSTR(""), STR_VSCREEN, screenType, 0, 1, attr, event))
|
if (screenType != selectMenuItem(TELEM_SCRTYPE_COL, y, PSTR(""), STR_VSCREEN, screenType, 0, 1, attr, event))
|
||||||
g_model.frsky.screensType ^= screenIndex;
|
g_model.frsky.screensType ^= screenIndex;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ static uint8_t s_frsky_view = e_frsky_custom_screen_1;
|
|||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
void displayRssiLine()
|
void displayRssiLine()
|
||||||
{
|
{
|
||||||
if (frskyStreaming > 0) {
|
if (TELEMETRY_STREAMING()) {
|
||||||
lcd_hline(0, 55, 212, 0); // separator
|
lcd_hline(0, 55, 212, 0); // separator
|
||||||
uint8_t rssi = min((uint8_t)99, frskyData.rssi[1].value);
|
uint8_t rssi = min((uint8_t)99, frskyData.rssi[1].value);
|
||||||
lcd_putsLeft(7*FH+1, STR_TX); lcd_outdezNAtt(4*FW, 7*FH+1, rssi, LEADING0, 2);
|
lcd_putsLeft(7*FH+1, STR_TX); lcd_outdezNAtt(4*FW, 7*FH+1, rssi, LEADING0, 2);
|
||||||
@@ -74,7 +74,7 @@ void displayRssiLine()
|
|||||||
#else
|
#else
|
||||||
void displayRssiLine()
|
void displayRssiLine()
|
||||||
{
|
{
|
||||||
if (frskyStreaming > 0) {
|
if (TELEMETRY_STREAMING()) {
|
||||||
lcd_hline(0, 55, 128, 0); // separator
|
lcd_hline(0, 55, 128, 0); // separator
|
||||||
uint8_t rssi = min((uint8_t)99, frskyData.rssi[1].value);
|
uint8_t rssi = min((uint8_t)99, frskyData.rssi[1].value);
|
||||||
lcd_putsLeft(7*FH+1, STR_TX); lcd_outdezNAtt(4*FW, 7*FH+1, rssi, LEADING0, 2);
|
lcd_putsLeft(7*FH+1, STR_TX); lcd_outdezNAtt(4*FW, 7*FH+1, rssi, LEADING0, 2);
|
||||||
@@ -97,7 +97,7 @@ void displayRssiLine()
|
|||||||
void displayGpsTime()
|
void displayGpsTime()
|
||||||
{
|
{
|
||||||
#define TIME_LINE (7*FH+1)
|
#define TIME_LINE (7*FH+1)
|
||||||
uint8_t att = (frskyStreaming > 0 ? LEFT|LEADING0 : LEFT|LEADING0|BLINK);
|
uint8_t att = (TELEMETRY_STREAMING() ? LEFT|LEADING0 : LEFT|LEADING0|BLINK);
|
||||||
lcd_outdezNAtt(6*FW+5, TIME_LINE, frskyData.hub.hour, att, 2);
|
lcd_outdezNAtt(6*FW+5, TIME_LINE, frskyData.hub.hour, att, 2);
|
||||||
lcd_putcAtt(8*FW+2, TIME_LINE, ':', att);
|
lcd_putcAtt(8*FW+2, TIME_LINE, ':', att);
|
||||||
lcd_outdezNAtt(9*FW+2, TIME_LINE, frskyData.hub.min, att, 2);
|
lcd_outdezNAtt(9*FW+2, TIME_LINE, frskyData.hub.min, att, 2);
|
||||||
@@ -193,7 +193,6 @@ void menuTelemetryFrsky(uint8_t event)
|
|||||||
|
|
||||||
lcdDrawTelemetryTopBar();
|
lcdDrawTelemetryTopBar();
|
||||||
|
|
||||||
if (frskyStreaming >= 0) {
|
|
||||||
if (s_frsky_view < MAX_FRSKY_SCREENS) {
|
if (s_frsky_view < MAX_FRSKY_SCREENS) {
|
||||||
FrSkyScreenData & screen = g_model.frsky.screens[s_frsky_view];
|
FrSkyScreenData & screen = g_model.frsky.screens[s_frsky_view];
|
||||||
if (g_model.frsky.screensType & (1<<s_frsky_view)) {
|
if (g_model.frsky.screensType & (1<<s_frsky_view)) {
|
||||||
@@ -264,7 +263,7 @@ void menuTelemetryFrsky(uint8_t event)
|
|||||||
#else
|
#else
|
||||||
lcd_vline(63, 8, 48);
|
lcd_vline(63, 8, 48);
|
||||||
#endif
|
#endif
|
||||||
if (frskyStreaming > 0) {
|
if (TELEMETRY_STREAMING()) {
|
||||||
#if defined(FRSKY_HUB)
|
#if defined(FRSKY_HUB)
|
||||||
if (field == TELEM_ACC) {
|
if (field == TELEM_ACC) {
|
||||||
lcd_putsLeft(7*FH+1, STR_ACCEL);
|
lcd_putsLeft(7*FH+1, STR_ACCEL);
|
||||||
@@ -389,7 +388,3 @@ void menuTelemetryFrsky(uint8_t event)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
lcd_putsAtt(22, 40, STR_NODATA, DBLSIZE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
+9
-2
@@ -105,7 +105,9 @@ const pm_char * openLogs()
|
|||||||
f_puts("Date,Time,", &g_oLogFile);
|
f_puts("Date,Time,", &g_oLogFile);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(FRSKY)
|
#if defined(FRSKY_SPORT)
|
||||||
|
f_puts("SWR,RSSI,A1,A2,", &g_oLogFile);
|
||||||
|
#elif defined(FRSKY)
|
||||||
f_puts("Buffer,RX,TX,A1,A2,", &g_oLogFile);
|
f_puts("Buffer,RX,TX,A1,A2,", &g_oLogFile);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -170,8 +172,13 @@ void writeLogs()
|
|||||||
f_printf(&g_oLogFile, "%4d-%02d-%02d,%02d:%02d:%02d,", utm.tm_year+1900, utm.tm_mon+1, utm.tm_mday, utm.tm_hour, utm.tm_min, utm.tm_sec);
|
f_printf(&g_oLogFile, "%4d-%02d-%02d,%02d:%02d:%02d,", utm.tm_year+1900, utm.tm_mon+1, utm.tm_mday, utm.tm_hour, utm.tm_min, utm.tm_sec);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(FRSKY)
|
#if defined(FRSKY_SPORT)
|
||||||
|
f_printf(&g_oLogFile, "%d,%d,", frskyData.rssi[1].value, frskyData.rssi[0].value);
|
||||||
|
#elif defined(FRSKY)
|
||||||
f_printf(&g_oLogFile, "%d,%d,%d,", frskyStreaming, frskyData.rssi[0].value, frskyData.rssi[1].value);
|
f_printf(&g_oLogFile, "%d,%d,%d,", frskyStreaming, frskyData.rssi[0].value, frskyData.rssi[1].value);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(FRSKY)
|
||||||
for (uint8_t i=0; i<2; i++) {
|
for (uint8_t i=0; i<2; i++) {
|
||||||
int16_t converted_value = applyChannelRatio(i, frskyData.analog[i].value);
|
int16_t converted_value = applyChannelRatio(i, frskyData.analog[i].value);
|
||||||
f_printf(&g_oLogFile, "%d.%02d,", converted_value/100, converted_value%100);
|
f_printf(&g_oLogFile, "%d.%02d,", converted_value/100, converted_value%100);
|
||||||
|
|||||||
+2
-9
@@ -1025,13 +1025,8 @@ bool __getSwitch(int8_t swtch)
|
|||||||
#if defined(FRSKY)
|
#if defined(FRSKY)
|
||||||
// Telemetry
|
// Telemetry
|
||||||
if (cs->v1 >= MIXSRC_FIRST_TELEM) {
|
if (cs->v1 >= MIXSRC_FIRST_TELEM) {
|
||||||
#if defined(PCBTARANIS)
|
if (!TELEMETRY_STREAMING() && cs->v1 >= MIXSRC_FIRST_TELEM+TELEM_TM2)
|
||||||
if (frskyData.rssi[0].value == 0 && cs->v1 >= MIXSRC_FIRST_TELEM+TELEM_TM2)
|
|
||||||
return swtch > 0 ? false : true;
|
return swtch > 0 ? false : true;
|
||||||
#else
|
|
||||||
if (frskyStreaming <= 0 && cs->v1 >= MIXSRC_FIRST_TELEM+TELEM_TM2)
|
|
||||||
return swtch > 0 ? false : true;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
y = convertCswTelemValue(cs);
|
y = convertCswTelemValue(cs);
|
||||||
|
|
||||||
@@ -3718,12 +3713,10 @@ void perMain()
|
|||||||
if (g_vbat100mV <= g_eeGeneral.vBatWarn && g_vbat100mV>50) {
|
if (g_vbat100mV <= g_eeGeneral.vBatWarn && g_vbat100mV>50) {
|
||||||
AUDIO_TX_BATTERY_LOW();
|
AUDIO_TX_BATTERY_LOW();
|
||||||
}
|
}
|
||||||
#if defined(CPUARM)
|
#if defined(PCBSKY9X)
|
||||||
else if (g_eeGeneral.temperatureWarn && getTemperature() >= g_eeGeneral.temperatureWarn) {
|
else if (g_eeGeneral.temperatureWarn && getTemperature() >= g_eeGeneral.temperatureWarn) {
|
||||||
AUDIO_TX_TEMP_HIGH();
|
AUDIO_TX_TEMP_HIGH();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#if defined(PCBSKY9X)
|
|
||||||
else if (g_eeGeneral.mAhWarn && (g_eeGeneral.mAhUsed + Current_used * (488 + g_eeGeneral.currentCalib)/8192/36) / 500 >= g_eeGeneral.mAhWarn) {
|
else if (g_eeGeneral.mAhWarn && (g_eeGeneral.mAhUsed + Current_used * (488 + g_eeGeneral.currentCalib)/8192/36) / 500 >= g_eeGeneral.mAhWarn) {
|
||||||
AUDIO_TX_MAH_HIGH();
|
AUDIO_TX_MAH_HIGH();
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-1
@@ -1190,7 +1190,7 @@ inline bool isFunctionActive(uint8_t func)
|
|||||||
enum AUDIO_SOUNDS {
|
enum AUDIO_SOUNDS {
|
||||||
AU_INACTIVITY,
|
AU_INACTIVITY,
|
||||||
AU_TX_BATTERY_LOW,
|
AU_TX_BATTERY_LOW,
|
||||||
#if defined(CPUARM)
|
#if defined(PCBSKY9X)
|
||||||
AU_TX_MAH_HIGH,
|
AU_TX_MAH_HIGH,
|
||||||
AU_TX_TEMP_HIGH,
|
AU_TX_TEMP_HIGH,
|
||||||
#endif
|
#endif
|
||||||
@@ -1221,6 +1221,15 @@ enum AUDIO_SOUNDS {
|
|||||||
AU_TIMER_10,
|
AU_TIMER_10,
|
||||||
AU_TIMER_20,
|
AU_TIMER_20,
|
||||||
AU_TIMER_30,
|
AU_TIMER_30,
|
||||||
|
#if defined(PCBTARANIS)
|
||||||
|
AU_A1_ORANGE,
|
||||||
|
AU_A1_RED,
|
||||||
|
AU_A2_ORANGE,
|
||||||
|
AU_A2_RED,
|
||||||
|
AU_RSSI_ORANGE,
|
||||||
|
AU_RSSI_RED,
|
||||||
|
AU_SWR_RED,
|
||||||
|
#endif
|
||||||
AU_FRSKY_FIRST,
|
AU_FRSKY_FIRST,
|
||||||
AU_FRSKY_BEEP1 = AU_FRSKY_FIRST,
|
AU_FRSKY_BEEP1 = AU_FRSKY_FIRST,
|
||||||
AU_FRSKY_BEEP2,
|
AU_FRSKY_BEEP2,
|
||||||
|
|||||||
@@ -76,59 +76,43 @@ void setupPulses(unsigned int port)
|
|||||||
|
|
||||||
switch (s_current_protocol[port]) { // stop existing protocol hardware
|
switch (s_current_protocol[port]) { // stop existing protocol hardware
|
||||||
case PROTO_PXX:
|
case PROTO_PXX:
|
||||||
#if defined(PCBTARANIS)
|
|
||||||
disable_pxx(port);
|
disable_pxx(port);
|
||||||
#else
|
|
||||||
disable_pxx();
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
#if defined(DSM2)
|
#if defined(DSM2)
|
||||||
case PROTO_DSM2_LP45:
|
case PROTO_DSM2_LP45:
|
||||||
case PROTO_DSM2_DSM2:
|
case PROTO_DSM2_DSM2:
|
||||||
case PROTO_DSM2_DSMX:
|
case PROTO_DSM2_DSMX:
|
||||||
disable_ssc();
|
disable_dsm2();
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
case PROTO_PPM:
|
||||||
#if defined(PCBTARANIS)
|
|
||||||
disable_ppm(port);
|
disable_ppm(port);
|
||||||
#else
|
break;
|
||||||
disable_main_ppm();
|
default:
|
||||||
#endif
|
disable_no_pulses(port);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
s_current_protocol[port] = required_protocol;
|
s_current_protocol[port] = required_protocol;
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
switch (required_protocol) { // Start new protocol hardware here
|
||||||
switch (required_protocol) {
|
|
||||||
case PROTO_PXX:
|
case PROTO_PXX:
|
||||||
init_pxx(port);
|
init_pxx(port);
|
||||||
break;
|
break;
|
||||||
case PROTO_PPM:
|
#if defined(DSM2)
|
||||||
init_ppm(port);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#elif defined(PCBSKY9X)
|
|
||||||
switch (required_protocol) { // Start new protocol hardware here
|
|
||||||
case PROTO_PXX:
|
|
||||||
init_main_ppm(5000, 0); // Initial period 2.5 mS, output off
|
|
||||||
init_ssc();
|
|
||||||
break;
|
|
||||||
case PROTO_DSM2_LP45:
|
case PROTO_DSM2_LP45:
|
||||||
case PROTO_DSM2_DSM2:
|
case PROTO_DSM2_DSM2:
|
||||||
case PROTO_DSM2_DSMX:
|
case PROTO_DSM2_DSMX:
|
||||||
init_main_ppm(5000, 0); // Initial period 2.5 mS, output off
|
init_dsm2(port);
|
||||||
init_ssc();
|
|
||||||
break;
|
break;
|
||||||
case PROTO_NONE:
|
#endif
|
||||||
init_main_ppm(3000, 0); // Initial period 1.5 mS, output off
|
case PROTO_PPM:
|
||||||
|
init_ppm(port);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
init_main_ppm(3000, 1); // Initial period 1.5 mS, output on
|
init_no_pulses(port);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up output data here
|
// Set up output data here
|
||||||
@@ -143,12 +127,10 @@ void setupPulses(unsigned int port)
|
|||||||
setupPulsesDsm2(6);
|
setupPulsesDsm2(6);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if defined(PCBTARANIS)
|
|
||||||
case PROTO_PPM:
|
case PROTO_PPM:
|
||||||
#else
|
setupPulsesPPM(port);
|
||||||
|
break ;
|
||||||
default:
|
default:
|
||||||
#endif
|
|
||||||
setupPulsesPPM(port); // Don't enable interrupts through here
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,12 +64,7 @@ inline void startPulses()
|
|||||||
|
|
||||||
inline bool pulsesStarted() { return s_current_protocol[0] != 255; }
|
inline bool pulsesStarted() { return s_current_protocol[0] != 255; }
|
||||||
inline void pausePulses() { s_pulses_paused = true; }
|
inline void pausePulses() { s_pulses_paused = true; }
|
||||||
inline void resumePulses() {
|
inline void resumePulses() { s_pulses_paused = false; }
|
||||||
s_pulses_paused = false;
|
|
||||||
#if defined(PCBTARANIS)
|
|
||||||
startPulses(); //TODO delete
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#define SEND_FAILSAFE_NOW(idx) failsafeCounter[idx] = 1
|
#define SEND_FAILSAFE_NOW(idx) failsafeCounter[idx] = 1
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -380,7 +380,7 @@ int main(int argc,char **argv)
|
|||||||
th9xSim->show(); // Otherwise the main window gets centred across my two monitors, split down the middle.
|
th9xSim->show(); // Otherwise the main window gets centred across my two monitors, split down the middle.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FRSKY
|
#if defined(FRSKY) && !defined(FRSKY_SPORT)
|
||||||
frskyStreaming = 1;
|
frskyStreaming = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -758,8 +758,8 @@ void usbBootloader()
|
|||||||
PWM->PWM_DIS = PWM_DIS_CHID0 | PWM_DIS_CHID1 | PWM_DIS_CHID2 | PWM_DIS_CHID3 ; // Disable all
|
PWM->PWM_DIS = PWM_DIS_CHID0 | PWM_DIS_CHID1 | PWM_DIS_CHID2 | PWM_DIS_CHID3 ; // Disable all
|
||||||
NVIC_DisableIRQ(TC2_IRQn) ;
|
NVIC_DisableIRQ(TC2_IRQn) ;
|
||||||
|
|
||||||
disable_main_ppm() ;
|
disable_ppm(0);
|
||||||
disable_ppm2();
|
disable_ppm(1);
|
||||||
|
|
||||||
// PWM->PWM_IDR1 = PWM_IDR1_CHID3 ;
|
// PWM->PWM_IDR1 = PWM_IDR1_CHID3 ;
|
||||||
// NVIC_DisableIRQ(PWM_IRQn) ;
|
// NVIC_DisableIRQ(PWM_IRQn) ;
|
||||||
|
|||||||
@@ -162,13 +162,17 @@ extern uint32_t readKeys();
|
|||||||
#define DBLKEYS_PRESSED_LFT_DWN(i) ((in & (0x40 + 0x08)) == (0x40 + 0x08))
|
#define DBLKEYS_PRESSED_LFT_DWN(i) ((in & (0x40 + 0x08)) == (0x40 + 0x08))
|
||||||
|
|
||||||
// Pulses driver
|
// Pulses driver
|
||||||
|
#define init_no_pulses(port) init_main_ppm(3000, 0)
|
||||||
|
#define disable_no_pulses(port) disable_ppm(0)
|
||||||
void init_main_ppm(uint32_t period, uint32_t out_enable);
|
void init_main_ppm(uint32_t period, uint32_t out_enable);
|
||||||
void disable_main_ppm();
|
#define init_ppm(port) init_main_ppm(3000, 1)
|
||||||
void disable_ppm2();
|
void disable_ppm(uint32_t port);
|
||||||
void init_ssc();
|
void init_ssc();
|
||||||
void disable_ssc();
|
void disable_ssc();
|
||||||
#define disable_pxx() disable_ssc()
|
#define init_pxx(port) init_main_ppm(5000, 0); init_ssc()
|
||||||
void setupPulsesPPM(unsigned int port);
|
#define disable_pxx(port) disable_ssc()
|
||||||
|
#define init_dsm2(port) init_main_ppm(5000, 0); init_ssc()
|
||||||
|
#define disable_dsm2(port) disable_ssc()
|
||||||
|
|
||||||
// SD driver
|
// SD driver
|
||||||
#if !defined(SIMU)
|
#if !defined(SIMU)
|
||||||
|
|||||||
@@ -91,26 +91,23 @@ void init_main_ppm( uint32_t period, uint32_t out_enable )
|
|||||||
NVIC_EnableIRQ(PWM_IRQn) ;
|
NVIC_EnableIRQ(PWM_IRQn) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void disable_main_ppm()
|
void disable_ppm(uint32_t port)
|
||||||
{
|
{
|
||||||
register Pio *pioptr ;
|
register Pio *pioptr ;
|
||||||
|
|
||||||
|
if (port == 0) {
|
||||||
pioptr = PIOA ;
|
pioptr = PIOA ;
|
||||||
pioptr->PIO_PER = PIO_PA17 ; // Assign A17 to PIO
|
pioptr->PIO_PER = PIO_PA17 ; // Assign A17 to PIO
|
||||||
|
|
||||||
PWM->PWM_IDR1 = PWM_IDR1_CHID3 ;
|
PWM->PWM_IDR1 = PWM_IDR1_CHID3 ;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
void disable_ppm2()
|
|
||||||
{
|
|
||||||
register Pio *pioptr ;
|
|
||||||
|
|
||||||
pioptr = PIOC ;
|
pioptr = PIOC ;
|
||||||
pioptr->PIO_PER = PIO_PC17 ; // Assign A17 to PIO
|
pioptr->PIO_PER = PIO_PC17 ; // Assign A17 to PIO
|
||||||
|
|
||||||
PWM->PWM_IDR1 = PWM_IDR1_CHID1 ;
|
PWM->PWM_IDR1 = PWM_IDR1_CHID1 ;
|
||||||
NVIC_DisableIRQ(PWM_IRQn) ;
|
NVIC_DisableIRQ(PWM_IRQn) ;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Initialise the SSC to allow PXX output.
|
// Initialise the SSC to allow PXX output.
|
||||||
// TD is on PA17, peripheral A
|
// TD is on PA17, peripheral A
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ uint8_t usbPlugged(void);
|
|||||||
|
|
||||||
void delaysInit();
|
void delaysInit();
|
||||||
|
|
||||||
#define DEBUG_UART_BAUDRATE 115200
|
#define DEBUG_UART_BAUDRATE 9600
|
||||||
#define SPORT_BAUDRATE 57600
|
#define SPORT_BAUDRATE 57600
|
||||||
|
|
||||||
void uartInit(uint32_t baudrate);
|
void uartInit(uint32_t baudrate);
|
||||||
|
|||||||
@@ -110,7 +110,6 @@ static void init_pa10_none()
|
|||||||
INTERNAL_RF_OFF();
|
INTERNAL_RF_OFF();
|
||||||
|
|
||||||
// Timer1, channel 3
|
// Timer1, channel 3
|
||||||
|
|
||||||
GPIO_InitTypeDef GPIO_InitStructure;
|
GPIO_InitTypeDef GPIO_InitStructure;
|
||||||
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIO_INTPPM, ENABLE);
|
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIO_INTPPM, ENABLE);
|
||||||
|
|
||||||
@@ -170,7 +169,7 @@ static void init_pa7_none()
|
|||||||
|
|
||||||
RCC->APB2ENR |= RCC_APB2ENR_TIM8EN ; // Enable clock
|
RCC->APB2ENR |= RCC_APB2ENR_TIM8EN ; // Enable clock
|
||||||
|
|
||||||
TIM1->CR1 &= ~TIM_CR1_CEN ;
|
TIM8->CR1 &= ~TIM_CR1_CEN ;
|
||||||
TIM8->ARR = 36000 ; // 18mS
|
TIM8->ARR = 36000 ; // 18mS
|
||||||
TIM8->CCR2 = 32000 ; // Update time
|
TIM8->CCR2 = 32000 ; // Update time
|
||||||
TIM8->PSC = (PERI2_FREQUENCY * TIMER_MULT_APB2) / 2000000 - 1 ; // 0.5uS from 30MHz
|
TIM8->PSC = (PERI2_FREQUENCY * TIMER_MULT_APB2) / 2000000 - 1 ; // 0.5uS from 30MHz
|
||||||
@@ -326,12 +325,15 @@ extern "C" void TIM1_CC_IRQHandler()
|
|||||||
TIM1->CCR3 = pxxStream[INTERNAL_MODULE][0];
|
TIM1->CCR3 = pxxStream[INTERNAL_MODULE][0];
|
||||||
TIM1->DIER |= TIM_DIER_CC2IE ; // Enable this interrupt
|
TIM1->DIER |= TIM_DIER_CC2IE ; // Enable this interrupt
|
||||||
}
|
}
|
||||||
else {
|
else if (s_current_protocol[INTERNAL_MODULE] == PROTO_PPM) {
|
||||||
ppmStreamPtr[INTERNAL_MODULE] = ppmStream[INTERNAL_MODULE];
|
ppmStreamPtr[INTERNAL_MODULE] = ppmStream[INTERNAL_MODULE];
|
||||||
TIM1->DIER |= TIM_DIER_UDE ;
|
TIM1->DIER |= TIM_DIER_UDE ;
|
||||||
TIM1->SR &= ~TIM_SR_UIF ; // Clear this flag
|
TIM1->SR &= ~TIM_SR_UIF ; // Clear this flag
|
||||||
TIM1->DIER |= TIM_DIER_UIE ; // Enable this interrupt
|
TIM1->DIER |= TIM_DIER_UIE ; // Enable this interrupt
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
TIM1->DIER |= TIM_DIER_CC2IE ; // Enable this interrupt
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void TIM1_UP_TIM10_IRQHandler()
|
extern "C" void TIM1_UP_TIM10_IRQHandler()
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ void uartInit(uint32_t baudrate)
|
|||||||
USART_InitStructure.USART_StopBits = USART_StopBits_1;
|
USART_InitStructure.USART_StopBits = USART_StopBits_1;
|
||||||
USART_InitStructure.USART_Parity = USART_Parity_No;
|
USART_InitStructure.USART_Parity = USART_Parity_No;
|
||||||
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
|
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
|
||||||
USART_InitStructure.USART_Mode = USART_Mode_Tx;
|
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
|
||||||
|
|
||||||
USART_Init(UART3, &USART_InitStructure);
|
USART_Init(UART3, &USART_InitStructure);
|
||||||
USART_Cmd(UART3, ENABLE);
|
USART_Cmd(UART3, ENABLE);
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ uint8_t frskyTxBuffer[FRSKY_TX_PACKET_SIZE]; // Ditto for transmit buffer
|
|||||||
#if !defined(CPUARM)
|
#if !defined(CPUARM)
|
||||||
uint8_t frskyTxBufferCount = 0;
|
uint8_t frskyTxBufferCount = 0;
|
||||||
#endif
|
#endif
|
||||||
int8_t frskyStreaming = -1;
|
uint8_t frskyStreaming = 0;
|
||||||
#if defined(WS_HOW_HIGH)
|
#if defined(WS_HOW_HIGH)
|
||||||
uint8_t frskyUsrStreaming = 0;
|
uint8_t frskyUsrStreaming = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -179,7 +179,8 @@ struct FrskyData {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Global Fr-Sky telemetry data variables
|
// Global Fr-Sky telemetry data variables
|
||||||
extern int8_t frskyStreaming; // >0 (true) == data is streaming in. 0 = nodata detected for some time
|
extern uint8_t frskyStreaming; // >0 (true) == data is streaming in. 0 = nodata detected for some time
|
||||||
|
|
||||||
#if defined(WS_HOW_HIGH)
|
#if defined(WS_HOW_HIGH)
|
||||||
extern uint8_t frskyUsrStreaming;
|
extern uint8_t frskyUsrStreaming;
|
||||||
#endif
|
#endif
|
||||||
@@ -213,5 +214,7 @@ void resetTelemetry();
|
|||||||
#define TELEMETRY_GPS_SPEED_BP frskyData.hub.gpsSpeed_bp
|
#define TELEMETRY_GPS_SPEED_BP frskyData.hub.gpsSpeed_bp
|
||||||
#define TELEMETRY_GPS_SPEED_AP frskyData.hub.gpsSpeed_ap
|
#define TELEMETRY_GPS_SPEED_AP frskyData.hub.gpsSpeed_ap
|
||||||
|
|
||||||
|
#define TELEMETRY_STREAMING() (frskyStreaming > 0)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -225,7 +225,14 @@
|
|||||||
#define TR_FUNCSOUNDS "Beep1 ""Beep2 ""Beep3 ""Warn1 ""Warn2 ""Cheep ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""Siren ""AlmClk""Ratata""Tick "
|
#define TR_FUNCSOUNDS "Beep1 ""Beep2 ""Beep3 ""Warn1 ""Warn2 ""Cheep ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""Siren ""AlmClk""Ratata""Tick "
|
||||||
|
|
||||||
#define LEN_VTELEMCHNS "\004"
|
#define LEN_VTELEMCHNS "\004"
|
||||||
#define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2""Tx\0 ""Rx\0 ""A1\0 ""A2\0 ""Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+""Cur+""Acc\0""Time"
|
#if defined(PCBTARANIS)
|
||||||
|
#define TR_RSSI_0 "SWR\0"
|
||||||
|
#define TR_RSSI_1 "RSSI"
|
||||||
|
#else
|
||||||
|
#define TR_RSSI_0 "Tx\0 "
|
||||||
|
#define TR_RSSI_1 "Rx\0 "
|
||||||
|
#endif
|
||||||
|
#define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2" TR_RSSI_0 TR_RSSI_1 "A1\0 ""A2\0 ""Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+""Cur+""Acc\0""Time"
|
||||||
|
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
#define LEN_VTELEMUNIT_NORM "\003"
|
#define LEN_VTELEMUNIT_NORM "\003"
|
||||||
|
|||||||
Reference in New Issue
Block a user