[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:
bsongis@gmail.com
2013-05-21 12:44:14 +00:00
parent 53e061ab6a
commit b0e49b8aaf
7 changed files with 55 additions and 28 deletions
+15 -15
View File
@@ -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;