Skip to content

Commit

Permalink
Autodetect in display menu
Browse files Browse the repository at this point in the history
  • Loading branch information
raul-ortega committed Jun 21, 2017
1 parent 4c6d3b8 commit e8bed4a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 20 deletions.
7 changes: 4 additions & 3 deletions src/main/config/runtime_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,11 @@ typedef enum {
TP_FRSKY_D = (1 << 6),
TP_FRSKY_X = (1 << 7),
TP_LTM = (1 << 8),
TP_LTM_FRSKYD = (1 << 9),
TP_PITLAB = (1 << 10),
TP_PITLAB = (1 << 9),
TP_LTM_FRSKYD = (1 << 10),
TP_CALIBRATING_PAN0 = (1 << 11),
TP_CALIBRATING_MAXPAN = (1 << 12)
TP_CALIBRATING_MAXPAN = (1 << 12),

} trackerProtocolFlags_t;

extern uint16_t trackerProtocolFlags;
Expand Down
27 changes: 14 additions & 13 deletions src/main/io/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,17 @@ typedef struct pageState_s {
static pageState_t pageState;

static const char* const telemetry_protocols_Titles[]={
"SERVOTEST ",
"SERVOTEST ",
"CALIBRATING_MAG",
"MFD ",
"GPS_TELEMETRY",
"MAVLINK ",
"RVOSD ",
"FRSKY_D ",
"FRSKY_X ",
"LTM ",
"LTM_FRSKYD ",
"PITLAB "
"MFD ",
"GPS_TELEMETRY ",
"MAVLINK ",
"RVOSD ",
"FRSKY_D ",
"FRSKY_X ",
"LTM ",
/*"LTM_FRSKYD ",*/
"PITLAB "
};

// Menu
Expand Down Expand Up @@ -221,8 +221,9 @@ static const char* const telemetryProtocolMenu[] = {
"FRSKY D ",
"FRSKY X ",
"LTM ",
"LTM_FRSKYD ",
"PITLAB ",
/*"LTM_FRSKYD ",*/
"AUTODETECT ",
"EXIT "
};

Expand Down Expand Up @@ -385,7 +386,7 @@ void showTitle()
//i2c_OLED_send_string(pageTitles[pageState.pageId]);
if(pageState.pageId==PAGE_TELEMETRY) {
int16_t i;
for(i=0;i<11;i++) {
for(i=0;i<10;i++) {
if(master_telemetry_protocol & (1<<i)) {
i2c_OLED_send_string(telemetry_protocols_Titles[i]);
if(feature(FEATURE_EPS) && !PROTOCOL(TP_MFD)){
Expand All @@ -398,7 +399,7 @@ void showTitle()
}
}
if(master_telemetry_protocol == 0 && feature(FEATURE_AUTODETECT)){
tfp_sprintf(lineBuffer, "Autodetecting");
tfp_sprintf(lineBuffer, "Auto detecting");
i2c_OLED_send_string(lineBuffer);
}
} else if(pageState.pageId==PAGE_MENU){
Expand Down
6 changes: 4 additions & 2 deletions src/main/io/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ typedef enum {
OP_RVOSD,
OP_FRSKY_D,
OP_FRSKY_X,
OP_LTM,/*
OP_LTM_FRSKYD,*/
OP_LTM,
OP_PITLAB,
OP_LTM_FRSKYD,
OP_AUTODETECT,
OP_TELEMETRY_PROTOCOL_EXIT,
} telemetryProtocolMenu_e;

Expand Down
8 changes: 6 additions & 2 deletions src/main/tracker/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1253,8 +1253,12 @@ void processMenuTelemetryProtocol(void){
menuOption = indexMenuOption % (OP_TELEMETRY_PROTOCOL_EXIT+1);
if(menuOption == OP_TELEMETRY_PROTOCOL_EXIT)
menuState = MENU_TELEMETRY;
else {
masterConfig.telemetry_protocol = (1 << (2+menuOption));
else if(menuOption == OP_AUTODETECT){
featureSet(FEATURE_AUTODETECT);
menuState = MENU_TELEMETRY;
} else {
featureClear(FEATURE_AUTODETECT);
masterConfig.telemetry_protocol = (1 << ( 2 + menuOption));
menuState = MENU_TELEMETRY;
}
indexMenuOption = OP_TELMETRY_SAVE;
Expand Down

0 comments on commit e8bed4a

Please sign in to comment.