* Code refactoring for GPS to RTC clock

* Enabled GPS adjust RTC option for Horus
* Moved sensor ID to the right to allow display of GPS date/time in Telemetry screen
This commit is contained in:
Damjan Adamic
2016-09-02 20:47:56 +02:00
parent 07c4563764
commit d8a00c3f3d
9 changed files with 77 additions and 53 deletions
+4 -3
View File
@@ -75,6 +75,7 @@ enum MenuModelTelemetryFrskyItems {
#define TELEM_COL2 200
#define TELEM_COL3 275
#define TELEM_COL4 350
#define TELEM_COL5 425
#define IF_FAS_OFFSET(x) x,
#define IS_RANGE_DEFINED(k) (g_model.frsky.channels[k].ratio > 0)
@@ -443,11 +444,11 @@ bool menuModelTelemetryFrsky(event_t event)
// Spektrum does not (yet?) really support multiple sensor of the same type. But a lot of
// different sensor display the same information (e.g. voltage, capacity). Show the id
// of the sensor in the overview to ease figuring out what sensors belong together
lcdDrawHexNumber(TELEM_COL4, y, sensor->id, LEFT);
lcdDrawHexNumber(TELEM_COL5, y, sensor->id, LEFT);
} else
#endif
if (sensor->type == TELEM_TYPE_CUSTOM && !g_model.ignoreSensorIds) {
lcdDrawNumber(TELEM_COL4, y, sensor->instance, LEFT);
lcdDrawNumber(TELEM_COL5, y, sensor->instance, LEFT);
}
if (attr) {
s_editMode = 0;
@@ -477,7 +478,7 @@ bool menuModelTelemetryFrsky(event_t event)
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_TELEMETRY_SENSORS);
lcdDrawText(TELEM_COL2, y, STR_VALUE, 0);
if (!g_model.ignoreSensorIds && !IS_SPEKTRUM_PROTOCOL()) {
lcdDrawText(TELEM_COL4, y, STR_ID, 0);
lcdDrawText(TELEM_COL5, y, STR_ID, 0);
}
break;
+6
View File
@@ -74,6 +74,7 @@ enum menuRadioSetupItems {
// CASE_SPLASH_PARAM(ITEM_SETUP_DISABLE_SPLASH)
CASE_GPS(ITEM_SETUP_LABEL_GPS)
CASE_GPS(ITEM_SETUP_TIMEZONE)
CASE_GPS(ITEM_SETUP_ADJUST_RTC)
CASE_GPS(ITEM_SETUP_GPSFORMAT)
CASE_PXX(ITEM_SETUP_COUNTRYCODE)
ITEM_SETUP_LANGUAGE,
@@ -417,6 +418,11 @@ bool menuRadioSetup(event_t event)
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.timezone, -12, 12);
break;
case ITEM_SETUP_ADJUST_RTC:
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_ADJUST_RTC);
g_eeGeneral.adjustRTC = editCheckBox(g_eeGeneral.adjustRTC, RADIO_SETUP_2ND_COLUMN, y, attr, event ) ;
break;
case ITEM_SETUP_GPSFORMAT:
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_GPSCOORD);
g_eeGeneral.gpsFormat = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_GPSFORMAT, g_eeGeneral.gpsFormat, 0, 1, attr, event);