mirror of
https://github.com/opentx/opentx.git
synced 2025-07-15 20:35:17 +03:00
More unneeded definitions removed
This commit is contained in:
parent
487a76e8ba
commit
2ce17f3b68
45 changed files with 37 additions and 197 deletions
|
@ -859,9 +859,7 @@ enum ResetFunctionParam {
|
||||||
FUNC_RESET_TIMER2,
|
FUNC_RESET_TIMER2,
|
||||||
FUNC_RESET_TIMER3,
|
FUNC_RESET_TIMER3,
|
||||||
FUNC_RESET_FLIGHT,
|
FUNC_RESET_FLIGHT,
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
FUNC_RESET_TELEMETRY,
|
FUNC_RESET_TELEMETRY,
|
||||||
#endif
|
|
||||||
FUNC_RESET_PARAM_FIRST_TELEM,
|
FUNC_RESET_PARAM_FIRST_TELEM,
|
||||||
FUNC_RESET_PARAM_LAST_TELEM = FUNC_RESET_PARAM_FIRST_TELEM + MAX_TELEMETRY_SENSORS,
|
FUNC_RESET_PARAM_LAST_TELEM = FUNC_RESET_PARAM_FIRST_TELEM + MAX_TELEMETRY_SENSORS,
|
||||||
FUNC_RESET_PARAMS_COUNT,
|
FUNC_RESET_PARAMS_COUNT,
|
||||||
|
|
|
@ -194,11 +194,9 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
|
||||||
mainRequestFlags |= (1 << REQUEST_FLIGHT_RESET); // on systems with threads flightReset() must not be called from the mixers thread!
|
mainRequestFlags |= (1 << REQUEST_FLIGHT_RESET); // on systems with threads flightReset() must not be called from the mixers thread!
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
case FUNC_RESET_TELEMETRY:
|
case FUNC_RESET_TELEMETRY:
|
||||||
telemetryReset();
|
telemetryReset();
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
if (CFN_PARAM(cfn)>=FUNC_RESET_PARAM_FIRST_TELEM) {
|
if (CFN_PARAM(cfn)>=FUNC_RESET_PARAM_FIRST_TELEM) {
|
||||||
uint8_t item = CFN_PARAM(cfn)-FUNC_RESET_PARAM_FIRST_TELEM;
|
uint8_t item = CFN_PARAM(cfn)-FUNC_RESET_PARAM_FIRST_TELEM;
|
||||||
|
@ -338,7 +336,7 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY) && defined(VARIO)
|
#if defined(VARIO)
|
||||||
case FUNC_VARIO:
|
case FUNC_VARIO:
|
||||||
newActiveFunctions |= (1 << FUNCTION_VARIO);
|
newActiveFunctions |= (1 << FUNCTION_VARIO);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -309,11 +309,7 @@ void showAlertBox(const char * title, const char * text, const char * action , u
|
||||||
#define LOAD_MODEL_BITMAP()
|
#define LOAD_MODEL_BITMAP()
|
||||||
|
|
||||||
#define IS_MAIN_VIEW_DISPLAYED() menuHandlers[0] == menuMainView
|
#define IS_MAIN_VIEW_DISPLAYED() menuHandlers[0] == menuMainView
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
#define IS_TELEMETRY_VIEW_DISPLAYED() menuHandlers[0] == menuViewTelemetryFrsky
|
#define IS_TELEMETRY_VIEW_DISPLAYED() menuHandlers[0] == menuViewTelemetryFrsky
|
||||||
#else
|
|
||||||
#define IS_TELEMETRY_VIEW_DISPLAYED() false
|
|
||||||
#endif
|
|
||||||
#define IS_OTHER_VIEW_DISPLAYED() false
|
#define IS_OTHER_VIEW_DISPLAYED() false
|
||||||
|
|
||||||
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, event_t event, LcdFlags flags);
|
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, event_t event, LcdFlags flags);
|
||||||
|
|
|
@ -101,7 +101,7 @@ enum MenuModelIndexes {
|
||||||
#if defined(LUA_MODEL_SCRIPTS)
|
#if defined(LUA_MODEL_SCRIPTS)
|
||||||
MENU_MODEL_CUSTOM_SCRIPTS,
|
MENU_MODEL_CUSTOM_SCRIPTS,
|
||||||
#endif
|
#endif
|
||||||
CASE_FRSKY(MENU_MODEL_TELEMETRY_FRSKY)
|
MENU_MODEL_TELEMETRY,
|
||||||
MENU_MODEL_DISPLAY,
|
MENU_MODEL_DISPLAY,
|
||||||
MENU_MODEL_PAGES_COUNT
|
MENU_MODEL_PAGES_COUNT
|
||||||
};
|
};
|
||||||
|
@ -124,7 +124,7 @@ void menuModelGVars(event_t event);
|
||||||
void menuModelLogicalSwitches(event_t event);
|
void menuModelLogicalSwitches(event_t event);
|
||||||
void menuModelSpecialFunctions(event_t event);
|
void menuModelSpecialFunctions(event_t event);
|
||||||
void menuModelCustomScripts(event_t event);
|
void menuModelCustomScripts(event_t event);
|
||||||
void menuModelTelemetryFrsky(event_t event);
|
void menuModelTelemetry(event_t event);
|
||||||
void menuModelSensor(event_t event);
|
void menuModelSensor(event_t event);
|
||||||
void menuModelDisplay(event_t event);
|
void menuModelDisplay(event_t event);
|
||||||
void menuModelTemplates(event_t event);
|
void menuModelTemplates(event_t event);
|
||||||
|
@ -144,7 +144,7 @@ static const MenuHandlerFunc menuTabModel[] = {
|
||||||
#if defined(LUA_MODEL_SCRIPTS)
|
#if defined(LUA_MODEL_SCRIPTS)
|
||||||
menuModelCustomScripts,
|
menuModelCustomScripts,
|
||||||
#endif
|
#endif
|
||||||
CASE_FRSKY(menuModelTelemetryFrsky)
|
menuModelTelemetry,
|
||||||
menuModelDisplay,
|
menuModelDisplay,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,6 @@ void menuModelLogicalSwitchOne(event_t event)
|
||||||
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
if (v1_val >= MIXSRC_FIRST_TELEM) {
|
if (v1_val >= MIXSRC_FIRST_TELEM) {
|
||||||
drawSourceCustomValue(CSWONE_2ND_COLUMN, y, v1_val, convertLswTelemValue(cs), attr|LEFT);
|
drawSourceCustomValue(CSWONE_2ND_COLUMN, y, v1_val, convertLswTelemValue(cs), attr|LEFT);
|
||||||
v2_max = maxTelemValue(v1_val - MIXSRC_FIRST_TELEM + 1);
|
v2_max = maxTelemValue(v1_val - MIXSRC_FIRST_TELEM + 1);
|
||||||
|
@ -171,7 +170,6 @@ void menuModelLogicalSwitchOne(event_t event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif // TELEMETRY_FRSKY
|
|
||||||
{
|
{
|
||||||
LcdFlags lf = attr | LEFT;
|
LcdFlags lf = attr | LEFT;
|
||||||
getMixSrcRange(v1_val, v2_min, v2_max, &lf);
|
getMixSrcRange(v1_val, v2_min, v2_max, &lf);
|
||||||
|
|
|
@ -118,9 +118,9 @@ void onDeleteAllSensorsConfirm(const char * result)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void menuModelTelemetryFrsky(event_t event)
|
void menuModelTelemetry(event_t event)
|
||||||
{
|
{
|
||||||
MENU(STR_MENUTELEMETRY, menuTabModel, MENU_MODEL_TELEMETRY_FRSKY, HEADER_LINE+ITEM_TELEMETRY_MAX, { HEADER_LINE_COLUMNS TELEMETRY_TYPE_ROWS RSSI_ROWS SENSORS_ROWS VARIO_ROWS });
|
MENU(STR_MENUTELEMETRY, menuTabModel, MENU_MODEL_TELEMETRY, HEADER_LINE+ITEM_TELEMETRY_MAX, { HEADER_LINE_COLUMNS TELEMETRY_TYPE_ROWS RSSI_ROWS SENSORS_ROWS VARIO_ROWS });
|
||||||
|
|
||||||
uint8_t sub = menuVerticalPosition - HEADER_LINE;
|
uint8_t sub = menuVerticalPosition - HEADER_LINE;
|
||||||
|
|
||||||
|
|
|
@ -529,7 +529,7 @@ void menuRadioSetup(event_t event)
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY) && defined(GPS)
|
#if defined(GPS)
|
||||||
case ITEM_RADIO_SETUP_TIMEZONE:
|
case ITEM_RADIO_SETUP_TIMEZONE:
|
||||||
lcdDrawTextAlignedLeft(y, STR_TIMEZONE);
|
lcdDrawTextAlignedLeft(y, STR_TIMEZONE);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.timezone, attr|LEFT);
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.timezone, attr|LEFT);
|
||||||
|
|
|
@ -47,15 +47,12 @@
|
||||||
#define TRIM_LH_POS (TRIM_LH_X-4*FW)
|
#define TRIM_LH_POS (TRIM_LH_X-4*FW)
|
||||||
#define TRIM_RH_NEG (TRIM_RH_X+1*FW)
|
#define TRIM_RH_NEG (TRIM_RH_X+1*FW)
|
||||||
#define TRIM_RH_POS (TRIM_RH_X-4*FW)
|
#define TRIM_RH_POS (TRIM_RH_X-4*FW)
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
#define RSSSI_X (30)
|
#define RSSSI_X (30)
|
||||||
#define RSSSI_Y (31)
|
#define RSSSI_Y (31)
|
||||||
#define RSSI_MAX 105
|
#define RSSI_MAX 105
|
||||||
#endif
|
|
||||||
|
|
||||||
#define TRIM_LEN 23
|
#define TRIM_LEN 23
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
void drawRSSIGauge()
|
void drawRSSIGauge()
|
||||||
{
|
{
|
||||||
uint8_t bar = (RSSI_MAX - g_model.rssiAlarms.getWarningRssi()) / 4;
|
uint8_t bar = (RSSI_MAX - g_model.rssiAlarms.getWarningRssi()) / 4;
|
||||||
|
@ -66,7 +63,6 @@ void drawRSSIGauge()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void drawPotsBars()
|
void drawPotsBars()
|
||||||
{
|
{
|
||||||
|
@ -276,15 +272,11 @@ void onMainViewMenu(const char *result)
|
||||||
POPUP_MENU_ADD_ITEM(STR_RESET_TIMER1);
|
POPUP_MENU_ADD_ITEM(STR_RESET_TIMER1);
|
||||||
POPUP_MENU_ADD_ITEM(STR_RESET_TIMER2);
|
POPUP_MENU_ADD_ITEM(STR_RESET_TIMER2);
|
||||||
POPUP_MENU_ADD_ITEM(STR_RESET_TIMER3);
|
POPUP_MENU_ADD_ITEM(STR_RESET_TIMER3);
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
POPUP_MENU_ADD_ITEM(STR_RESET_TELEMETRY);
|
POPUP_MENU_ADD_ITEM(STR_RESET_TELEMETRY);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
else if (result == STR_RESET_TELEMETRY) {
|
else if (result == STR_RESET_TELEMETRY) {
|
||||||
telemetryReset();
|
telemetryReset();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
else if (result == STR_RESET_FLIGHT) {
|
else if (result == STR_RESET_FLIGHT) {
|
||||||
flightReset();
|
flightReset();
|
||||||
}
|
}
|
||||||
|
@ -385,11 +377,7 @@ void menuMainView(event_t event)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case EVT_KEY_TELEMETRY:
|
case EVT_KEY_TELEMETRY:
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
chainMenu(menuViewTelemetryFrsky);
|
chainMenu(menuViewTelemetryFrsky);
|
||||||
#else
|
|
||||||
chainMenu(menuStatisticsDebug);
|
|
||||||
#endif
|
|
||||||
killEvents(event);
|
killEvents(event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -419,12 +407,10 @@ void menuMainView(event_t event)
|
||||||
// Trims sliders
|
// Trims sliders
|
||||||
displayTrims(mode);
|
displayTrims(mode);
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
// RSSI gauge
|
// RSSI gauge
|
||||||
if (TELEMETRY_RSSI() > 0) {
|
if (TELEMETRY_RSSI() > 0) {
|
||||||
drawRSSIGauge();
|
drawRSSIGauge();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (view_base < VIEW_INPUTS) {
|
if (view_base < VIEW_INPUTS) {
|
||||||
|
|
|
@ -37,7 +37,7 @@ const MenuHandlerFunc menuTabModel[] = {
|
||||||
#if defined(LUA_MODEL_SCRIPTS)
|
#if defined(LUA_MODEL_SCRIPTS)
|
||||||
menuModelCustomScripts,
|
menuModelCustomScripts,
|
||||||
#endif
|
#endif
|
||||||
CASE_FRSKY(menuModelTelemetryFrsky)
|
menuModelTelemetry,
|
||||||
menuModelDisplay
|
menuModelDisplay
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ enum MenuModelIndexes {
|
||||||
#if defined(LUA_MODEL_SCRIPTS)
|
#if defined(LUA_MODEL_SCRIPTS)
|
||||||
MENU_MODEL_CUSTOM_SCRIPTS,
|
MENU_MODEL_CUSTOM_SCRIPTS,
|
||||||
#endif
|
#endif
|
||||||
MENU_MODEL_TELEMETRY_FRSKY,
|
MENU_MODEL_TELEMETRY,
|
||||||
MENU_MODEL_DISPLAY,
|
MENU_MODEL_DISPLAY,
|
||||||
MENU_MODEL_PAGES_COUNT
|
MENU_MODEL_PAGES_COUNT
|
||||||
};
|
};
|
||||||
|
@ -117,7 +117,7 @@ void menuModelGVars(event_t event);
|
||||||
void menuModelLogicalSwitches(event_t event);
|
void menuModelLogicalSwitches(event_t event);
|
||||||
void menuModelSpecialFunctions(event_t event);
|
void menuModelSpecialFunctions(event_t event);
|
||||||
void menuModelCustomScripts(event_t event);
|
void menuModelCustomScripts(event_t event);
|
||||||
void menuModelTelemetryFrsky(event_t event);
|
void menuModelTelemetry(event_t event);
|
||||||
void menuModelSensor(event_t event);
|
void menuModelSensor(event_t event);
|
||||||
void menuModelDisplay(event_t event);
|
void menuModelDisplay(event_t event);
|
||||||
|
|
||||||
|
|
|
@ -99,9 +99,9 @@ void onDeleteAllSensorsConfirm(const char * result)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void menuModelTelemetryFrsky(event_t event)
|
void menuModelTelemetry(event_t event)
|
||||||
{
|
{
|
||||||
MENU(STR_MENUTELEMETRY, menuTabModel, MENU_MODEL_TELEMETRY_FRSKY, HEADER_LINE+ITEM_TELEMETRY_MAX, { HEADER_LINE_COLUMNS TELEMETRY_TYPE_ROWS RSSI_ROWS SENSORS_ROWS VARIO_ROWS });
|
MENU(STR_MENUTELEMETRY, menuTabModel, MENU_MODEL_TELEMETRY, HEADER_LINE+ITEM_TELEMETRY_MAX, { HEADER_LINE_COLUMNS TELEMETRY_TYPE_ROWS RSSI_ROWS SENSORS_ROWS VARIO_ROWS });
|
||||||
|
|
||||||
uint8_t sub = menuVerticalPosition - HEADER_LINE;
|
uint8_t sub = menuVerticalPosition - HEADER_LINE;
|
||||||
|
|
||||||
|
|
|
@ -484,7 +484,7 @@ void menuRadioSetup(event_t event)
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY) && defined(GPS)
|
#if defined(GPS)
|
||||||
case ITEM_RADIO_SETUP_LABEL_GPS:
|
case ITEM_RADIO_SETUP_LABEL_GPS:
|
||||||
lcdDrawTextAlignedLeft(y, STR_GPS);
|
lcdDrawTextAlignedLeft(y, STR_GPS);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -36,7 +36,7 @@ const MenuHandlerFunc menuTabModel[] = {
|
||||||
#if defined(LUA_MODEL_SCRIPTS)
|
#if defined(LUA_MODEL_SCRIPTS)
|
||||||
menuModelCustomScripts,
|
menuModelCustomScripts,
|
||||||
#endif
|
#endif
|
||||||
CASE_FRSKY(menuModelTelemetryFrsky)
|
menuModelTelemetry
|
||||||
};
|
};
|
||||||
|
|
||||||
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, event_t event, LcdFlags attr);
|
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, event_t event, LcdFlags attr);
|
||||||
|
|
|
@ -123,7 +123,7 @@ enum EnumTabModel {
|
||||||
#if defined(LUA_MODEL_SCRIPTS)
|
#if defined(LUA_MODEL_SCRIPTS)
|
||||||
MENU_MODEL_CUSTOM_SCRIPTS,
|
MENU_MODEL_CUSTOM_SCRIPTS,
|
||||||
#endif
|
#endif
|
||||||
CASE_FRSKY(MENU_MODEL_TELEMETRY_FRSKY)
|
MENU_MODEL_TELEMETRY,
|
||||||
MENU_MODEL_PAGES_COUNT
|
MENU_MODEL_PAGES_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ bool menuModelGVars(event_t event);
|
||||||
bool menuModelLogicalSwitches(event_t event);
|
bool menuModelLogicalSwitches(event_t event);
|
||||||
bool menuModelSpecialFunctions(event_t event);
|
bool menuModelSpecialFunctions(event_t event);
|
||||||
bool menuModelCustomScripts(event_t event);
|
bool menuModelCustomScripts(event_t event);
|
||||||
bool menuModelTelemetryFrsky(event_t event);
|
bool menuModelTelemetry(event_t event);
|
||||||
bool menuModelSensor(event_t event);
|
bool menuModelSensor(event_t event);
|
||||||
bool menuModelExpoOne(event_t event);
|
bool menuModelExpoOne(event_t event);
|
||||||
bool menuModelModuleOptions(event_t event);
|
bool menuModelModuleOptions(event_t event);
|
||||||
|
|
|
@ -103,9 +103,9 @@ void onDeleteAllSensorsConfirm(const char * result)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool menuModelTelemetryFrsky(event_t event)
|
bool menuModelTelemetry(event_t event)
|
||||||
{
|
{
|
||||||
MENU(STR_MENUTELEMETRY, MODEL_ICONS, menuTabModel, MENU_MODEL_TELEMETRY_FRSKY, ITEM_TELEMETRY_MAX, { TELEMETRY_TYPE_ROWS RSSI_ROWS SENSORS_ROWS VARIO_ROWS });
|
MENU(STR_MENUTELEMETRY, MODEL_ICONS, menuTabModel, MENU_MODEL_TELEMETRY, ITEM_TELEMETRY_MAX, { TELEMETRY_TYPE_ROWS RSSI_ROWS SENSORS_ROWS VARIO_ROWS });
|
||||||
|
|
||||||
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
|
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
|
||||||
coord_t y = MENU_CONTENT_TOP + i*FH;
|
coord_t y = MENU_CONTENT_TOP + i*FH;
|
||||||
|
|
|
@ -581,7 +581,7 @@ void menuRadioHardware(event_t event)
|
||||||
lcdDrawTextAlignedLeft(y, STR_DEBUG);
|
lcdDrawTextAlignedLeft(y, STR_DEBUG);
|
||||||
lcdDrawText(HW_SETTINGS_COLUMN2, y, STR_ANALOGS_BTN, menuHorizontalPosition == 0 ? attr : 0);
|
lcdDrawText(HW_SETTINGS_COLUMN2, y, STR_ANALOGS_BTN, menuHorizontalPosition == 0 ? attr : 0);
|
||||||
lcdDrawText(lcdLastRightPos + 2, y, STR_KEYS_BTN, menuHorizontalPosition == 1 ? attr : 0);
|
lcdDrawText(lcdLastRightPos + 2, y, STR_KEYS_BTN, menuHorizontalPosition == 1 ? attr : 0);
|
||||||
if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) {
|
if (attr && event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||||
if (menuHorizontalPosition == 0)
|
if (menuHorizontalPosition == 0)
|
||||||
pushMenu(menuRadioDiagAnalogs);
|
pushMenu(menuRadioDiagAnalogs);
|
||||||
else
|
else
|
||||||
|
@ -591,7 +591,7 @@ void menuRadioHardware(event_t event)
|
||||||
|
|
||||||
case ITEM_RADIO_BACKUP_EEPROM:
|
case ITEM_RADIO_BACKUP_EEPROM:
|
||||||
lcdDrawText(LCD_W / 2, y, BUTTON(STR_EEBACKUP), attr | CENTERED);
|
lcdDrawText(LCD_W / 2, y, BUTTON(STR_EEBACKUP), attr | CENTERED);
|
||||||
if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) {
|
if (attr && event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||||
s_editMode = EDIT_SELECT_FIELD;
|
s_editMode = EDIT_SELECT_FIELD;
|
||||||
eepromBackup();
|
eepromBackup();
|
||||||
}
|
}
|
||||||
|
@ -599,7 +599,7 @@ void menuRadioHardware(event_t event)
|
||||||
|
|
||||||
case ITEM_RADIO_FACTORY_RESET:
|
case ITEM_RADIO_FACTORY_RESET:
|
||||||
lcdDrawText(LCD_W / 2, y, BUTTON(STR_FACTORYRESET), attr | CENTERED);
|
lcdDrawText(LCD_W / 2, y, BUTTON(STR_FACTORYRESET), attr | CENTERED);
|
||||||
if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) {
|
if (attr && event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||||
s_editMode = EDIT_SELECT_FIELD;
|
s_editMode = EDIT_SELECT_FIELD;
|
||||||
POPUP_CONFIRMATION(STR_CONFIRMRESET, onFactoryResetConfirm);
|
POPUP_CONFIRMATION(STR_CONFIRMRESET, onFactoryResetConfirm);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,6 @@
|
||||||
|
|
||||||
constexpr uint8_t COLUMN2_X = 10 * FW;
|
constexpr uint8_t COLUMN2_X = 10 * FW;
|
||||||
|
|
||||||
|
|
||||||
void menuRadioFirmwareOptions(event_t event)
|
void menuRadioFirmwareOptions(event_t event)
|
||||||
{
|
{
|
||||||
title(STR_MENU_FIRM_OPTIONS);
|
title(STR_MENU_FIRM_OPTIONS);
|
||||||
|
|
|
@ -233,12 +233,10 @@ bool isSourceAvailableInCustomSwitches(int source)
|
||||||
{
|
{
|
||||||
bool result = isSourceAvailable(source);
|
bool result = isSourceAvailable(source);
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
if (result && source >= MIXSRC_FIRST_TELEM && source <= MIXSRC_LAST_TELEM) {
|
if (result && source >= MIXSRC_FIRST_TELEM && source <= MIXSRC_LAST_TELEM) {
|
||||||
div_t qr = div(source - MIXSRC_FIRST_TELEM, 3);
|
div_t qr = div(source - MIXSRC_FIRST_TELEM, 3);
|
||||||
result = isTelemetryFieldComparisonAvailable(qr.quot);
|
result = isTelemetryFieldComparisonAvailable(qr.quot);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
|
|
||||||
#include "dataconstants.h"
|
#include "dataconstants.h"
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY_SPORT)
|
|
||||||
PACK(union SportTelemetryPacket
|
PACK(union SportTelemetryPacket
|
||||||
{
|
{
|
||||||
struct {
|
struct {
|
||||||
|
@ -34,7 +33,6 @@ PACK(union SportTelemetryPacket
|
||||||
};
|
};
|
||||||
uint8_t raw[8];
|
uint8_t raw[8];
|
||||||
});
|
});
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(STM32)
|
#if defined(STM32)
|
||||||
bool isBootloader(const char * filename);
|
bool isBootloader(const char * filename);
|
||||||
|
|
|
@ -134,7 +134,6 @@ void writeHeader()
|
||||||
f_puts("Time,", &g_oLogFile);
|
f_puts("Time,", &g_oLogFile);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
|
|
||||||
char label[TELEM_LABEL_LEN+7];
|
char label[TELEM_LABEL_LEN+7];
|
||||||
for (int i=0; i<MAX_TELEMETRY_SENSORS; i++) {
|
for (int i=0; i<MAX_TELEMETRY_SENSORS; i++) {
|
||||||
|
@ -155,7 +154,6 @@ void writeHeader()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(PCBTARANIS) || defined(PCBHORUS)
|
#if defined(PCBTARANIS) || defined(PCBHORUS)
|
||||||
for (uint8_t i=1; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS+1; i++) {
|
for (uint8_t i=1; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS+1; i++) {
|
||||||
|
@ -229,7 +227,6 @@ void logsWrite()
|
||||||
f_printf(&g_oLogFile, "%d,", tmr10ms);
|
f_printf(&g_oLogFile, "%d,", tmr10ms);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
for (int i=0; i<MAX_TELEMETRY_SENSORS; i++) {
|
for (int i=0; i<MAX_TELEMETRY_SENSORS; i++) {
|
||||||
if (isTelemetryFieldAvailable(i)) {
|
if (isTelemetryFieldAvailable(i)) {
|
||||||
TelemetrySensor & sensor = g_model.telemetrySensors[i];
|
TelemetrySensor & sensor = g_model.telemetrySensors[i];
|
||||||
|
@ -267,7 +264,6 @@ void logsWrite()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
|
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
|
||||||
f_printf(&g_oLogFile, "%d,", calibratedAnalogs[i]);
|
f_printf(&g_oLogFile, "%d,", calibratedAnalogs[i]);
|
||||||
|
|
|
@ -196,11 +196,9 @@ void per10ms()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY) || defined(TELEMETRY_JETI)
|
|
||||||
if (!IS_DSM2_SERIAL_PROTOCOL(s_current_protocol[0])) {
|
if (!IS_DSM2_SERIAL_PROTOCOL(s_current_protocol[0])) {
|
||||||
telemetryInterrupt10ms();
|
telemetryInterrupt10ms();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// These moved here from evalFlightModeMixes() to improve beep trigger reliability.
|
// These moved here from evalFlightModeMixes() to improve beep trigger reliability.
|
||||||
#if defined(PWM_BACKLIGHT)
|
#if defined(PWM_BACKLIGHT)
|
||||||
|
@ -674,7 +672,6 @@ getvalue_t convert16bitsTelemValue(source_t channel, ls_telemetry_value_t value)
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
ls_telemetry_value_t minTelemValue(source_t channel)
|
ls_telemetry_value_t minTelemValue(source_t channel)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -684,7 +681,6 @@ ls_telemetry_value_t maxTelemValue(source_t channel)
|
||||||
{
|
{
|
||||||
return 30000;
|
return 30000;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#define INAC_STICKS_SHIFT 6
|
#define INAC_STICKS_SHIFT 6
|
||||||
#define INAC_SWITCHES_SHIFT 8
|
#define INAC_SWITCHES_SHIFT 8
|
||||||
|
@ -1330,9 +1326,7 @@ void flightReset(uint8_t check)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
telemetryReset();
|
telemetryReset();
|
||||||
#endif
|
|
||||||
|
|
||||||
s_mixer_first_run_done = false;
|
s_mixer_first_run_done = false;
|
||||||
|
|
||||||
|
@ -1580,9 +1574,7 @@ void opentxClose(uint8_t shutdown)
|
||||||
watchdogSuspend(2000/*20s*/);
|
watchdogSuspend(2000/*20s*/);
|
||||||
pausePulses(); // stop mixer task to disable trims processing while in shutdown
|
pausePulses(); // stop mixer task to disable trims processing while in shutdown
|
||||||
AUDIO_BYE();
|
AUDIO_BYE();
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
// TODO needed? telemetryEnd();
|
// TODO needed? telemetryEnd();
|
||||||
#endif
|
|
||||||
#if defined(LUA)
|
#if defined(LUA)
|
||||||
luaClose(&lsScripts);
|
luaClose(&lsScripts);
|
||||||
#if defined(COLORLCD)
|
#if defined(COLORLCD)
|
||||||
|
|
|
@ -103,7 +103,7 @@
|
||||||
#define CASE_PWM_BACKLIGHT(x)
|
#define CASE_PWM_BACKLIGHT(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY) && defined(GPS)
|
#if defined(GPS)
|
||||||
#define CASE_GPS(x) x,
|
#define CASE_GPS(x) x,
|
||||||
#else
|
#else
|
||||||
#define CASE_GPS(x)
|
#define CASE_GPS(x)
|
||||||
|
@ -133,12 +133,6 @@
|
||||||
#define CASE_PWR_BUTTON_PRESS(x)
|
#define CASE_PWR_BUTTON_PRESS(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
#define CASE_FRSKY(x) x,
|
|
||||||
#else
|
|
||||||
#define CASE_FRSKY(x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(PXX1)
|
#if defined(PXX1)
|
||||||
#define CASE_PXX1(x) x,
|
#define CASE_PXX1(x) x,
|
||||||
#else
|
#else
|
||||||
|
@ -1238,13 +1232,8 @@ char * strcat_zchar(char *dest, const char *name, uint8_t size, const char *defa
|
||||||
// Stick tolerance varies between transmitters, Higher is better
|
// Stick tolerance varies between transmitters, Higher is better
|
||||||
#define STICK_TOLERANCE 64
|
#define STICK_TOLERANCE 64
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
ls_telemetry_value_t minTelemValue(source_t channel);
|
ls_telemetry_value_t minTelemValue(source_t channel);
|
||||||
ls_telemetry_value_t maxTelemValue(source_t channel);
|
ls_telemetry_value_t maxTelemValue(source_t channel);
|
||||||
#else
|
|
||||||
#define minTelemValue(channel) 255
|
|
||||||
#define maxTelemValue(channel) 255
|
|
||||||
#endif
|
|
||||||
|
|
||||||
getvalue_t convert16bitsTelemValue(source_t channel, ls_telemetry_value_t value);
|
getvalue_t convert16bitsTelemValue(source_t channel, ls_telemetry_value_t value);
|
||||||
getvalue_t convertLswTelemValue(LogicalSwitchData * cs);
|
getvalue_t convertLswTelemValue(LogicalSwitchData * cs);
|
||||||
|
@ -1277,7 +1266,6 @@ inline bool IS_TXBATT_WARNING()
|
||||||
return g_vbat100mV <= g_eeGeneral.vBatWarn;
|
return g_vbat100mV <= g_eeGeneral.vBatWarn;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
enum TelemetryViews {
|
enum TelemetryViews {
|
||||||
TELEMETRY_CUSTOM_SCREEN_1,
|
TELEMETRY_CUSTOM_SCREEN_1,
|
||||||
TELEMETRY_CUSTOM_SCREEN_2,
|
TELEMETRY_CUSTOM_SCREEN_2,
|
||||||
|
@ -1287,7 +1275,6 @@ enum TelemetryViews {
|
||||||
};
|
};
|
||||||
|
|
||||||
extern uint8_t s_frsky_view;
|
extern uint8_t s_frsky_view;
|
||||||
#endif
|
|
||||||
|
|
||||||
constexpr uint32_t EARTH_RADIUS = 6371009;
|
constexpr uint32_t EARTH_RADIUS = 6371009;
|
||||||
|
|
||||||
|
|
|
@ -505,9 +505,6 @@ int main(int argc, char ** argv)
|
||||||
opentxSim->show(); // Otherwise the main window gets centred across my two monitors, split down the middle.
|
opentxSim->show(); // Otherwise the main window gets centred across my two monitors, split down the middle.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY) && !defined(TELEMETRY_FRSKY_SPORT)
|
|
||||||
telemetryStreaming = 1;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
printf("Model size = %d\n", (int)sizeof(g_model));
|
printf("Model size = %d\n", (int)sizeof(g_model));
|
||||||
|
|
||||||
|
|
|
@ -285,7 +285,6 @@ bool getLogicalSwitch(uint8_t idx)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mixsrc_t v1 = ls->v1;
|
mixsrc_t v1 = ls->v1;
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
// Telemetry
|
// Telemetry
|
||||||
if (v1 >= MIXSRC_FIRST_TELEM) {
|
if (v1 >= MIXSRC_FIRST_TELEM) {
|
||||||
if (!TELEMETRY_STREAMING() || IS_FAI_FORBIDDEN(v1-1)) {
|
if (!TELEMETRY_STREAMING() || IS_FAI_FORBIDDEN(v1-1)) {
|
||||||
|
@ -303,17 +302,6 @@ bool getLogicalSwitch(uint8_t idx)
|
||||||
else {
|
else {
|
||||||
y = calc100toRESX(ls->v2);
|
y = calc100toRESX(ls->v2);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
if (v1 >= MIXSRC_FIRST_TELEM) {
|
|
||||||
y = (int16_t)3 * (128+ls->v2); // it's a Timer
|
|
||||||
}
|
|
||||||
else if (v1 >= MIXSRC_GVAR1) {
|
|
||||||
y = ls->v2; // it's a GVAR
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
y = calc100toRESX(ls->v2);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
switch (ls->func) {
|
switch (ls->func) {
|
||||||
case LS_FUNC_VEQUAL:
|
case LS_FUNC_VEQUAL:
|
||||||
|
@ -370,9 +358,7 @@ bool getLogicalSwitch(uint8_t idx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
DurationAndDelayProcessing:
|
DurationAndDelayProcessing:
|
||||||
#endif
|
|
||||||
|
|
||||||
if (ls->delay || ls->duration) {
|
if (ls->delay || ls->duration) {
|
||||||
LogicalSwitchContext &context = lswFm[mixerCurrentFlightMode].lsw[idx];
|
LogicalSwitchContext &context = lswFm[mixerCurrentFlightMode].lsw[idx];
|
||||||
|
|
|
@ -169,10 +169,10 @@ if(CROSSFIRE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_definitions(-DCPUARM)
|
add_definitions(-DCPUARM)
|
||||||
add_definitions(-DTELEMETRY_FRSKY -DTELEMETRY_FRSKY_SPORT -DGPS)
|
add_definitions(-DGPS)
|
||||||
|
|
||||||
add_definitions(-DBOLD_FONT -DBATTGRAPH -DTHRTRACE)
|
add_definitions(-DBOLD_FONT -DBATTGRAPH -DTHRTRACE)
|
||||||
add_definitions(-DREQUIRED_SDCARD_VERSION="${SDCARD_VERSION}")
|
add_definitions(-DREQUIRED_SDCARD_VERSION="${SDCARD_VERSION}")
|
||||||
|
|
||||||
include_directories(${COOS_DIR} ${COOS_DIR}/kernel ${COOS_DIR}/portable)
|
include_directories(${COOS_DIR} ${COOS_DIR}/kernel ${COOS_DIR}/portable)
|
||||||
foreach(LANGUAGE ${TTS_LANGUAGES})
|
foreach(LANGUAGE ${TTS_LANGUAGES})
|
||||||
string(TOLOWER ${LANGUAGE} lang_lower)
|
string(TOLOWER ${LANGUAGE} lang_lower)
|
||||||
|
|
|
@ -316,17 +316,12 @@ void OpenTxSimulator::setTrainerTimeout(uint16_t ms)
|
||||||
|
|
||||||
void OpenTxSimulator::sendTelemetry(const QByteArray data)
|
void OpenTxSimulator::sendTelemetry(const QByteArray data)
|
||||||
{
|
{
|
||||||
#if defined(TELEMETRY_FRSKY_SPORT)
|
|
||||||
//OTXS_DBG << data;
|
//OTXS_DBG << data;
|
||||||
sportProcessTelemetryPacket((uint8_t *)data.constData());
|
sportProcessTelemetryPacket((uint8_t *)data.constData());
|
||||||
#else
|
|
||||||
Q_UNUSED(data)
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t OpenTxSimulator::getSensorInstance(uint16_t id, uint8_t defaultValue)
|
uint8_t OpenTxSimulator::getSensorInstance(uint16_t id, uint8_t defaultValue)
|
||||||
{
|
{
|
||||||
#if defined(TELEMETRY_FRSKY_SPORT)
|
|
||||||
for (int i = 0; i < MAX_TELEMETRY_SENSORS; i++) {
|
for (int i = 0; i < MAX_TELEMETRY_SENSORS; i++) {
|
||||||
if (isTelemetryFieldAvailable(i)) {
|
if (isTelemetryFieldAvailable(i)) {
|
||||||
TelemetrySensor * sensor = &g_model.telemetrySensors[i];
|
TelemetrySensor * sensor = &g_model.telemetrySensors[i];
|
||||||
|
@ -335,15 +330,11 @@ uint8_t OpenTxSimulator::getSensorInstance(uint16_t id, uint8_t defaultValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
Q_UNUSED(id)
|
|
||||||
#endif
|
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t OpenTxSimulator::getSensorRatio(uint16_t id)
|
uint16_t OpenTxSimulator::getSensorRatio(uint16_t id)
|
||||||
{
|
{
|
||||||
#if defined(TELEMETRY_FRSKY_SPORT)
|
|
||||||
for (int i = 0; i < MAX_TELEMETRY_SENSORS; i++) {
|
for (int i = 0; i < MAX_TELEMETRY_SENSORS; i++) {
|
||||||
if (isTelemetryFieldAvailable(i)) {
|
if (isTelemetryFieldAvailable(i)) {
|
||||||
TelemetrySensor * sensor = &g_model.telemetrySensors[i];
|
TelemetrySensor * sensor = &g_model.telemetrySensors[i];
|
||||||
|
@ -352,9 +343,6 @@ uint16_t OpenTxSimulator::getSensorRatio(uint16_t id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
Q_UNUSED(id)
|
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -378,9 +366,7 @@ const int OpenTxSimulator::getCapability(Capability cap)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CAP_TELEM_FRSKY_SPORT :
|
case CAP_TELEM_FRSKY_SPORT :
|
||||||
#ifdef TELEMETRY_FRSKY_SPORT
|
|
||||||
ret = 1;
|
ret = 1;
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -109,7 +109,6 @@ extern "C" void UART0_IRQHandler()
|
||||||
#define SECOND_UART_Configure(...)
|
#define SECOND_UART_Configure(...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
void auxSerialTelemetryInit(unsigned int /*protocol*/)
|
void auxSerialTelemetryInit(unsigned int /*protocol*/)
|
||||||
{
|
{
|
||||||
SECOND_UART_Configure(FRSKY_D_BAUDRATE, Master_frequency);
|
SECOND_UART_Configure(FRSKY_D_BAUDRATE, Master_frequency);
|
||||||
|
@ -119,7 +118,6 @@ bool telemetrySecondPortReceive(uint8_t & data)
|
||||||
{
|
{
|
||||||
return auxSerialRxFifo.pop(data);
|
return auxSerialRxFifo.pop(data);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(DEBUG) && !defined(SIMU)
|
#if defined(DEBUG) && !defined(SIMU)
|
||||||
void serialPrintf(const char*, ... ) {}
|
void serialPrintf(const char*, ... ) {}
|
||||||
|
|
|
@ -180,11 +180,9 @@ TASK_FUNCTION(mixerTask)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
DEBUG_TIMER_START(debugTimerTelemetryWakeup);
|
DEBUG_TIMER_START(debugTimerTelemetryWakeup);
|
||||||
telemetryWakeup();
|
telemetryWakeup();
|
||||||
DEBUG_TIMER_STOP(debugTimerTelemetryWakeup);
|
DEBUG_TIMER_STOP(debugTimerTelemetryWakeup);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (heartbeat == HEART_WDT_CHECK) {
|
if (heartbeat == HEART_WDT_CHECK) {
|
||||||
wdt_reset();
|
wdt_reset();
|
||||||
|
|
|
@ -100,13 +100,11 @@ bool pushFrskyTelemetryData(uint8_t data)
|
||||||
|
|
||||||
} // switch
|
} // switch
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY_SPORT)
|
|
||||||
if (IS_FRSKY_SPORT_PROTOCOL() && telemetryRxBufferCount >= FRSKY_SPORT_PACKET_SIZE) {
|
if (IS_FRSKY_SPORT_PROTOCOL() && telemetryRxBufferCount >= FRSKY_SPORT_PACKET_SIZE) {
|
||||||
// end of frame detected
|
// end of frame detected
|
||||||
dataState = STATE_DATA_IDLE;
|
dataState = STATE_DATA_IDLE;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,11 +21,7 @@
|
||||||
#ifndef _TELEMETRY_H_
|
#ifndef _TELEMETRY_H_
|
||||||
#define _TELEMETRY_H_
|
#define _TELEMETRY_H_
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
#include "frsky.h"
|
||||||
// FrSky Telemetry
|
|
||||||
#include "frsky.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "crossfire.h"
|
#include "crossfire.h"
|
||||||
#if defined(MULTIMODULE)
|
#if defined(MULTIMODULE)
|
||||||
#include "spektrum.h"
|
#include "spektrum.h"
|
||||||
|
|
|
@ -501,16 +501,12 @@ int setTelemetryValue(TelemetryProtocol protocol, uint16_t id, uint8_t subId, ui
|
||||||
int index = availableTelemetryIndex();
|
int index = availableTelemetryIndex();
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
switch (protocol) {
|
switch (protocol) {
|
||||||
#if defined(TELEMETRY_FRSKY_SPORT)
|
|
||||||
case TELEM_PROTO_FRSKY_SPORT:
|
case TELEM_PROTO_FRSKY_SPORT:
|
||||||
frskySportSetDefault(index, id, subId, instance);
|
frskySportSetDefault(index, id, subId, instance);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
case TELEM_PROTO_FRSKY_D:
|
case TELEM_PROTO_FRSKY_D:
|
||||||
frskyDSetDefault(index, id);
|
frskyDSetDefault(index, id);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
#if defined(CROSSFIRE)
|
#if defined(CROSSFIRE)
|
||||||
case TELEM_PROTO_CROSSFIRE:
|
case TELEM_PROTO_CROSSFIRE:
|
||||||
crossfireSetDefault(index, id, instance);
|
crossfireSetDefault(index, id, instance);
|
||||||
|
|
|
@ -21,17 +21,10 @@
|
||||||
#include "gtests.h"
|
#include "gtests.h"
|
||||||
|
|
||||||
void frskyDProcessPacket(const uint8_t *packet);
|
void frskyDProcessPacket(const uint8_t *packet);
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY_SPORT)
|
|
||||||
bool checkSportPacket(const uint8_t *packet);
|
bool checkSportPacket(const uint8_t *packet);
|
||||||
void sportProcessTelemetryPacket(const uint8_t * packet);
|
void sportProcessTelemetryPacket(const uint8_t * packet);
|
||||||
bool checkSportPacket(const uint8_t *packet);
|
bool checkSportPacket(const uint8_t *packet);
|
||||||
void frskyCalculateCellStats(void);
|
|
||||||
void displayVoltagesScreen();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
TEST(FrSky, TelemetryValueWithMinAveraging)
|
TEST(FrSky, TelemetryValueWithMinAveraging)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -147,9 +140,6 @@ TEST(FrSky, Gps)
|
||||||
EXPECT_EQ(telemetryItems[0].gps.longitude, 45341666);
|
EXPECT_EQ(telemetryItems[0].gps.longitude, 45341666);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // defined(TELEMETRY_FRSKY)
|
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY_SPORT)
|
|
||||||
TEST(FrSkySPORT, checkCrc)
|
TEST(FrSkySPORT, checkCrc)
|
||||||
{
|
{
|
||||||
// Packet downstream
|
// Packet downstream
|
||||||
|
@ -487,4 +477,3 @@ TEST(FrSkySPORT, frskyCurrent)
|
||||||
EXPECT_EQ(telemetryItems[0].valueMax, 505);
|
EXPECT_EQ(telemetryItems[0].valueMax, 505);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //#if defined(TELEMETRY_FRSKY_SPORT)
|
|
||||||
|
|
|
@ -80,13 +80,11 @@ inline void MIXER_RESET()
|
||||||
|
|
||||||
inline void TELEMETRY_RESET()
|
inline void TELEMETRY_RESET()
|
||||||
{
|
{
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
telemetryData.clear();
|
telemetryData.clear();
|
||||||
telemetryData.rssi.set(100);
|
telemetryData.rssi.set(100);
|
||||||
for (int i=0; i<MAX_TELEMETRY_SENSORS; i++) {
|
for (int i=0; i<MAX_TELEMETRY_SENSORS; i++) {
|
||||||
telemetryItems[i].clear();
|
telemetryItems[i].clear();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
memclear(g_model.telemetrySensors, sizeof(g_model.telemetrySensors));
|
memclear(g_model.telemetrySensors, sizeof(g_model.telemetrySensors));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -616,7 +616,6 @@ const char STR_BLONBRIGHTNESS[] = TR_BLONBRIGHTNESS;
|
||||||
const char STR_BLOFFBRIGHTNESS[] = TR_BLOFFBRIGHTNESS;
|
const char STR_BLOFFBRIGHTNESS[] = TR_BLOFFBRIGHTNESS;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
const char STR_TIMEZONE[] = TR_TIMEZONE;
|
const char STR_TIMEZONE[] = TR_TIMEZONE;
|
||||||
const char STR_ADJUST_RTC[] = TR_ADJUST_RTC;
|
const char STR_ADJUST_RTC[] = TR_ADJUST_RTC;
|
||||||
const char STR_GPS[] = TR_GPS;
|
const char STR_GPS[] = TR_GPS;
|
||||||
|
@ -625,7 +624,6 @@ const char STR_VARIO[] = TR_VARIO;
|
||||||
const char STR_PITCH_AT_ZERO[] = TR_PITCH_AT_ZERO;
|
const char STR_PITCH_AT_ZERO[] = TR_PITCH_AT_ZERO;
|
||||||
const char STR_PITCH_AT_MAX[] = TR_PITCH_AT_MAX;
|
const char STR_PITCH_AT_MAX[] = TR_PITCH_AT_MAX;
|
||||||
const char STR_REPEAT_AT_ZERO[] = TR_REPEAT_AT_ZERO;
|
const char STR_REPEAT_AT_ZERO[] = TR_REPEAT_AT_ZERO;
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(EEPROM)
|
#if defined(EEPROM)
|
||||||
const char STR_BAD_RADIO_DATA[] = TR_BADEEPROMDATA;
|
const char STR_BAD_RADIO_DATA[] = TR_BADEEPROMDATA;
|
||||||
|
@ -644,9 +642,7 @@ const char STR_STORAGE_FORMAT[] = TR_STORAGE_FORMAT;
|
||||||
const char STR_MENUCUSTOMSCRIPTS[] = TR_MENUCUSTOMSCRIPTS;
|
const char STR_MENUCUSTOMSCRIPTS[] = TR_MENUCUSTOMSCRIPTS;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
|
||||||
const char STR_MENUTELEMETRY[] = TR_MENUTELEMETRY;
|
const char STR_MENUTELEMETRY[] = TR_MENUTELEMETRY;
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(DSM2) || defined(PXX)
|
#if defined(DSM2) || defined(PXX)
|
||||||
const char STR_RECEIVER_NUM[] = TR_RECEIVER_NUM;
|
const char STR_RECEIVER_NUM[] = TR_RECEIVER_NUM;
|
||||||
|
|
|
@ -258,11 +258,7 @@
|
||||||
|
|
||||||
#define LEN_VFSWRESET TR("\004", "\012")
|
#define LEN_VFSWRESET TR("\004", "\012")
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetrie")
|
||||||
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetrie")
|
|
||||||
#else
|
|
||||||
#define TR_FSW_RESET_TELEM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
#define TR_FSW_RESET_TIMERS "Stopky1\0 ""Stopky2\0 ""Stopky3\0 "
|
#define TR_FSW_RESET_TIMERS "Stopky1\0 ""Stopky2\0 ""Stopky3\0 "
|
||||||
|
|
|
@ -261,11 +261,7 @@
|
||||||
|
|
||||||
#define LEN_VFSWRESET TR("\004", "\011")
|
#define LEN_VFSWRESET TR("\004", "\011")
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetrie")
|
||||||
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetrie")
|
|
||||||
#else
|
|
||||||
#define TR_FSW_RESET_TELEM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
#define TR_FSW_RESET_TIMERS "Timer 1\0 ""Timer 2\0 ""Timer 3\0 "
|
#define TR_FSW_RESET_TIMERS "Timer 1\0 ""Timer 2\0 ""Timer 3\0 "
|
||||||
|
|
|
@ -261,11 +261,7 @@
|
||||||
|
|
||||||
#define LEN_VFSWRESET TR("\004", "\011")
|
#define LEN_VFSWRESET TR("\004", "\011")
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetry")
|
||||||
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetry")
|
|
||||||
#else
|
|
||||||
#define TR_FSW_RESET_TELEM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
#define TR_FSW_RESET_TIMERS "Timer 1\0 ""Timer 2\0 ""Timer 3\0 "
|
#define TR_FSW_RESET_TIMERS "Timer 1\0 ""Timer 2\0 ""Timer 3\0 "
|
||||||
|
|
|
@ -259,11 +259,7 @@
|
||||||
|
|
||||||
#define LEN_VFSWRESET TR("\004", "\011")
|
#define LEN_VFSWRESET TR("\004", "\011")
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetry")
|
||||||
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetry")
|
|
||||||
#else
|
|
||||||
#define TR_FSW_RESET_TELEM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define TR_FSW_RESET_TIMERS "Timer 1\0 ""Timer 2\0 ""Timer 3\0 "
|
#define TR_FSW_RESET_TIMERS "Timer 1\0 ""Timer 2\0 ""Timer 3\0 "
|
||||||
|
|
|
@ -259,11 +259,7 @@
|
||||||
|
|
||||||
#define LEN_VFSWRESET TR("\004", "\011")
|
#define LEN_VFSWRESET TR("\004", "\011")
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetry")
|
||||||
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetry")
|
|
||||||
#else
|
|
||||||
#define TR_FSW_RESET_TELEM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define TR_FSW_RESET_TIMERS "Timer 1\0 ""Timer 2\0 ""Timer 3\0 "
|
#define TR_FSW_RESET_TIMERS "Timer 1\0 ""Timer 2\0 ""Timer 3\0 "
|
||||||
|
|
|
@ -261,11 +261,7 @@
|
||||||
|
|
||||||
#define LEN_VFSWRESET TR("\004", "\012")
|
#define LEN_VFSWRESET TR("\004", "\012")
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
#define TR_FSW_RESET_TELEM TR("Télm", "Télémétrie")
|
||||||
#define TR_FSW_RESET_TELEM TR("Télm", "Télémétrie")
|
|
||||||
#else
|
|
||||||
#define TR_FSW_RESET_TELEM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
#define TR_FSW_RESET_TIMERS "Chrono 1\0 ""Chrono 2\0 ""Chrono 3\0 "
|
#define TR_FSW_RESET_TIMERS "Chrono 1\0 ""Chrono 2\0 ""Chrono 3\0 "
|
||||||
|
|
|
@ -261,11 +261,7 @@
|
||||||
|
|
||||||
#define LEN_VFSWRESET TR("\004", "\011")
|
#define LEN_VFSWRESET TR("\004", "\011")
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetr.")
|
||||||
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetr.")
|
|
||||||
#else
|
|
||||||
#define TR_FSW_RESET_TELEM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
#define TR_FSW_RESET_TIMERS "Timer 1\0 ""Timer 2\0 ""Timer 3\0 "
|
#define TR_FSW_RESET_TIMERS "Timer 1\0 ""Timer 2\0 ""Timer 3\0 "
|
||||||
|
|
|
@ -262,11 +262,7 @@
|
||||||
|
|
||||||
#define LEN_VFSWRESET TR("\004", "\012")
|
#define LEN_VFSWRESET TR("\004", "\012")
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetrie")
|
||||||
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetrie")
|
|
||||||
#else
|
|
||||||
#define TR_FSW_RESET_TELEM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
#define TR_FSW_RESET_TIMERS "Timer 1\0 ""Timer 2\0 ""Timer 3\0 "
|
#define TR_FSW_RESET_TIMERS "Timer 1\0 ""Timer 2\0 ""Timer 3\0 "
|
||||||
|
|
|
@ -262,11 +262,7 @@
|
||||||
|
|
||||||
#define LEN_VFSWRESET TR("\004", "\011") /*9 decimal*/
|
#define LEN_VFSWRESET TR("\004", "\011") /*9 decimal*/
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetra")
|
||||||
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetra")
|
|
||||||
#else
|
|
||||||
#define TR_FSW_RESET_TELEM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
#define TR_FSW_RESET_TIMERS "Timer 1\0 ""Timer 2\0 ""Timer 3\0 "
|
#define TR_FSW_RESET_TIMERS "Timer 1\0 ""Timer 2\0 ""Timer 3\0 "
|
||||||
|
|
|
@ -258,11 +258,7 @@
|
||||||
|
|
||||||
#define LEN_VFSWRESET TR("\004", "\011")
|
#define LEN_VFSWRESET TR("\004", "\011")
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetry")
|
||||||
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetry")
|
|
||||||
#else
|
|
||||||
#define TR_FSW_RESET_TELEM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define TR_FSW_RESET_TIMERS "Timer 1\0 ""Timer 2\0 ""Timer 3\0 "
|
#define TR_FSW_RESET_TIMERS "Timer 1\0 ""Timer 2\0 ""Timer 3\0 "
|
||||||
|
|
|
@ -259,11 +259,7 @@
|
||||||
|
|
||||||
#define LEN_VFSWRESET TR("\004", "\011")
|
#define LEN_VFSWRESET TR("\004", "\011")
|
||||||
|
|
||||||
#if defined(TELEMETRY_FRSKY)
|
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetry")
|
||||||
#define TR_FSW_RESET_TELEM TR("Telm", "Telemetry")
|
|
||||||
#else
|
|
||||||
#define TR_FSW_RESET_TELEM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define TR_FSW_RESET_TIMERS "Timer 1\0 ""Timer 2\0 ""Timer 3\0 "
|
#define TR_FSW_RESET_TIMERS "Timer 1\0 ""Timer 2\0 ""Timer 3\0 "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue