[stock] New Makefile option GPS=YES/NO (saves 1.5k flash if disabled)
[stock] FRSKY_BARS option renamed to GAUGES=YES/NO (it could be used for another telemetry system in the future)
This commit is contained in:
@@ -169,7 +169,7 @@ enum menuGeneralSetupItems {
|
||||
ITEM_SETUP_DISABLE_SPLASH,
|
||||
#endif
|
||||
IF_FRSKY(ITEM_SETUP_TIMEZONE)
|
||||
IF_FRSKY(ITEM_SETUP_GPSFORMAT)
|
||||
IF_GPS(ITEM_SETUP_GPSFORMAT)
|
||||
IF_PXX(ITEM_SETUP_COUNTRYCODE)
|
||||
IF_CPUARM(ITEM_SETUP_LANGUAGE)
|
||||
IF_CPUARM(ITEM_SETUP_IMPERIAL)
|
||||
@@ -191,7 +191,7 @@ void menuGeneralSetup(uint8_t event)
|
||||
}
|
||||
#endif
|
||||
|
||||
MENU(STR_MENURADIOSETUP, menuTabDiag, e_Setup, ITEM_SETUP_MAX+1, {0, IF_RTCLOCK(2) IF_RTCLOCK(2) IF_BATTGRAPH(1) LABEL(SOUND), IF_AUDIO(0) IF_BUZZER(0) 0, IF_AUDIO(0) IF_VOICE(0) IF_HAPTIC(LABEL(HAPTIC)) IF_HAPTIC(0) IF_HAPTIC(0) IF_HAPTIC(0) IF_PCBSKY9X(0) IF_9X(0) LABEL(ALARMS), 0, IF_PCBSKY9X(0) IF_PCBSKY9X(0) 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, IF_SPLASH(0) IF_FRSKY(0) IF_FRSKY(0) IF_PXX(0) IF_CPUARM(0) IF_CPUARM(0) 0, LABEL(TX_MODE), CASE_PCBTARANIS(0) 1/*to force edit mode*/});
|
||||
MENU(STR_MENURADIOSETUP, menuTabDiag, e_Setup, ITEM_SETUP_MAX+1, {0, IF_RTCLOCK(2) IF_RTCLOCK(2) IF_BATTGRAPH(1) LABEL(SOUND), IF_AUDIO(0) IF_BUZZER(0) 0, IF_AUDIO(0) IF_VOICE(0) IF_HAPTIC(LABEL(HAPTIC)) IF_HAPTIC(0) IF_HAPTIC(0) IF_HAPTIC(0) IF_PCBSKY9X(0) IF_9X(0) LABEL(ALARMS), 0, IF_PCBSKY9X(0) IF_PCBSKY9X(0) 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, IF_SPLASH(0) IF_FRSKY(0) IF_GPS(0) IF_PXX(0) IF_CPUARM(0) IF_CPUARM(0) 0, LABEL(TX_MODE), CASE_PCBTARANIS(0) 1/*to force edit mode*/});
|
||||
|
||||
uint8_t sub = m_posVert - 1;
|
||||
|
||||
@@ -493,7 +493,9 @@ void menuGeneralSetup(uint8_t event)
|
||||
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.timezone, attr|LEFT);
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.timezone, -12, 12);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY) && defined(FRSKY_HUB) && defined(GPS)
|
||||
case ITEM_SETUP_GPSFORMAT:
|
||||
g_eeGeneral.gpsFormat = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_GPSCOORD, STR_GPSFORMAT, g_eeGeneral.gpsFormat, 0, 1, attr, event);
|
||||
break;
|
||||
|
||||
+15
-15
@@ -97,7 +97,7 @@ static uint8_t s_copyMode = 0;
|
||||
static int8_t s_copySrcRow;
|
||||
static int8_t s_copyTgtOfs;
|
||||
|
||||
inline uint8_t eeFindEmptyModel(uint8_t id, bool down)
|
||||
uint8_t eeFindEmptyModel(uint8_t id, bool down)
|
||||
{
|
||||
uint8_t i = id;
|
||||
for (;;) {
|
||||
@@ -108,6 +108,16 @@ inline uint8_t eeFindEmptyModel(uint8_t id, bool down)
|
||||
return i;
|
||||
}
|
||||
|
||||
void selectModel(uint8_t sub)
|
||||
{
|
||||
displayPopup(STR_LOADINGMODEL);
|
||||
saveTimers();
|
||||
eeCheck(true); // force writing of current model data before this is changed
|
||||
g_eeGeneral.currModel = sub;
|
||||
STORE_GENERALVARS;
|
||||
eeLoadModel(sub);
|
||||
}
|
||||
|
||||
#if defined(SDCARD)
|
||||
#define LIST_NONE_SD_FILE 1
|
||||
bool listSdFiles(const char *path, const char *extension, const uint8_t maxlen, const char *selection, uint8_t flags=0)
|
||||
@@ -305,16 +315,6 @@ void onModelSelectMenu(const char *result)
|
||||
}
|
||||
#endif
|
||||
|
||||
void selectModel(uint8_t sub)
|
||||
{
|
||||
displayPopup(STR_LOADINGMODEL);
|
||||
saveTimers();
|
||||
eeCheck(true); // force writing of current model data before this is changed
|
||||
g_eeGeneral.currModel = sub;
|
||||
STORE_GENERALVARS;
|
||||
eeLoadModel(sub);
|
||||
}
|
||||
|
||||
void menuModelSelect(uint8_t event)
|
||||
{
|
||||
if (s_warning_result) {
|
||||
@@ -4429,7 +4429,7 @@ enum menuModelTelemetryItems {
|
||||
#define RSSI_ROWS (uint8_t)-1, 1, 1,
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY_BARS)
|
||||
#if defined(GAUGES)
|
||||
#define SCREEN_TYPE_ROWS 0
|
||||
#else
|
||||
#define SCREEN_TYPE_ROWS (uint8_t)-1
|
||||
@@ -4654,7 +4654,7 @@ void menuModelTelemetry(uint8_t event)
|
||||
{
|
||||
uint8_t screenIndex = (k < ITEM_TELEMETRY_SCREEN_LABEL2 ? 0 : (k < ITEM_TELEMETRY_SCREEN_LABEL3 ? 1 : 2));
|
||||
putsStrIdx(0*FW, y, STR_SCREEN, screenIndex+1);
|
||||
#if defined(FRSKY_BARS)
|
||||
#if defined(GAUGES)
|
||||
bool screenType = IS_BARS_SCREEN(screenIndex);
|
||||
if (screenType != selectMenuItem(TELEM_SCRTYPE_COL, y, PSTR(""), STR_VSCREEN, screenType, 0, 1, attr, event))
|
||||
g_model.frsky.screensType ^= (1 << screenIndex);
|
||||
@@ -4665,7 +4665,7 @@ void menuModelTelemetry(uint8_t event)
|
||||
{
|
||||
uint8_t screenIndex = (k < ITEM_TELEMETRY_SCREEN_LABEL2 ? 1 : 2);
|
||||
putsStrIdx(0*FW, y, STR_SCREEN, screenIndex);
|
||||
#if defined(FRSKY_BARS)
|
||||
#if defined(GAUGES)
|
||||
bool screenType = g_model.frsky.screensType & screenIndex;
|
||||
if (screenType != selectMenuItem(TELEM_SCRTYPE_COL, y, PSTR(""), STR_VSCREEN, screenType, 0, 1, attr, event))
|
||||
g_model.frsky.screensType ^= screenIndex;
|
||||
@@ -4711,7 +4711,7 @@ void menuModelTelemetry(uint8_t event)
|
||||
putsStrIdx(0, y, PSTR(INDENT"Line"), lineIndex+1, m_posHorz<0 ? attr : 0);
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY_BARS)
|
||||
#if defined(GAUGES)
|
||||
if (IS_BARS_SCREEN(screenIndex)) {
|
||||
FrSkyBarData & bar = g_model.frsky.screens[screenIndex].bars[lineIndex];
|
||||
uint8_t barSource = bar.source;
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#define TELEM_2ND_COLUMN (10*FW)
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY_HUB) && defined(FRSKY_BARS)
|
||||
#if defined(FRSKY_HUB) && defined(GAUGES)
|
||||
uint8_t barsThresholds[THLD_MAX];
|
||||
#endif
|
||||
|
||||
@@ -202,7 +202,7 @@ void menuTelemetryFrsky(uint8_t event)
|
||||
|
||||
if (s_frsky_view < MAX_FRSKY_SCREENS) {
|
||||
FrSkyScreenData & screen = g_model.frsky.screens[s_frsky_view];
|
||||
#if defined(FRSKY_BARS)
|
||||
#if defined(GAUGES)
|
||||
if (g_model.frsky.screensType & (1<<s_frsky_view)) {
|
||||
// Custom Screen with gauges
|
||||
uint8_t barHeight = 5;
|
||||
@@ -365,7 +365,7 @@ void menuTelemetryFrsky(uint8_t event)
|
||||
if (frskyData.hub.cellsCount > 0) {
|
||||
uint8_t y = 1*FH;
|
||||
for (uint8_t k=0; k<frskyData.hub.cellsCount && k<6; k++) {
|
||||
#if defined(FRSKY_BARS)
|
||||
#if defined(GAUGES)
|
||||
uint8_t attr = (barsThresholds[THLD_CELL] && frskyData.hub.cellVolts[k] < barsThresholds[THLD_CELL]) ? BLINK|PREC2 : PREC2;
|
||||
#else
|
||||
uint8_t attr = PREC2;
|
||||
@@ -382,7 +382,7 @@ void menuTelemetryFrsky(uint8_t event)
|
||||
#if defined(FRSKY_HUB)
|
||||
else if (s_frsky_view == e_frsky_after_flight) {
|
||||
uint8_t line=1*FH+1;
|
||||
if (IS_USR_PROTO_FRSKY_HUB()) {
|
||||
if (IS_GPS_AVAILABLE()) {
|
||||
// Latitude
|
||||
lcd_putsLeft(line, STR_LATITUDE);
|
||||
displayGpsCoord(line, frskyData.hub.gpsLatitudeNS, frskyData.hub.gpsLatitude_bp, frskyData.hub.gpsLatitude_ap);
|
||||
|
||||
Reference in New Issue
Block a user