[sky9x] 3 Telemetry screens

[all] Variants
[stock] Around 50bytes flash saved
[sky9x] Date/Time setting problem
This commit is contained in:
bsongis
2012-10-19 18:48:10 +00:00
parent 99283c6ed6
commit 93eafc667a
11 changed files with 111 additions and 55 deletions
+9 -5
View File
@@ -310,6 +310,8 @@ CPPDEFS += -DTRANSLATIONS_$(TRANSLATIONS)
# TTS language # TTS language
CPPDEFS += -DTTS_$(TTS) CPPDEFS += -DTTS_$(TTS)
VARIANT = 0
ifeq ($(UNITS), IMPERIAL) ifeq ($(UNITS), IMPERIAL)
CPPDEFS += -DIMPERIAL_UNITS CPPDEFS += -DIMPERIAL_UNITS
endif endif
@@ -366,6 +368,7 @@ endif
ifeq ($(GVARS), YES) ifeq ($(GVARS), YES)
CPPDEFS += -DGVARS CPPDEFS += -DGVARS
VARIANT += +1
endif endif
# If STD-Support is enabled # If STD-Support is enabled
@@ -409,6 +412,7 @@ ifeq ($(EXT), FRSKY)
ifeq ($(VARIO), YES) ifeq ($(VARIO), YES)
CPPDEFS += -DVARIO CPPDEFS += -DVARIO
endif endif
VARIANT += +2
endif endif
ifeq ($(DEBUG), YES) ifeq ($(DEBUG), YES)
@@ -429,7 +433,7 @@ RUN_FROM_FLASH = 1
ifeq ($(PCB), X9D) ifeq ($(PCB), X9D)
# X9D, so ... # X9D, so ...
OPT = 2 OPT = 2
CPPDEFS += -DPCBX9D -DPCBSKY9X -DAUDIO -DHAPTIC -DPXX -DDSM2 -DDSM2_PPM -DROTARY_ENCODERS=1 CPPDEFS += -DPCBX9D -DPCBSKY9X -DVARIANT=0 -DAUDIO -DHAPTIC -DPXX -DDSM2 -DDSM2_PPM -DROTARY_ENCODERS=1
EXTRAINCDIRS += sky9x CoOS/kernel CoOS/portable EXTRAINCDIRS += sky9x CoOS/kernel CoOS/portable
BOARDSRC = board_sky9x.cpp BOARDSRC = board_sky9x.cpp
SRC += sky9x/core_cm3.c sky9x/board_lowlevel.c sky9x/crt.c sky9x/vectors_sam3s.c SRC += sky9x/core_cm3.c sky9x/board_lowlevel.c sky9x/crt.c sky9x/vectors_sam3s.c
@@ -463,7 +467,7 @@ endif
ifeq ($(PCB), SKY9X) ifeq ($(PCB), SKY9X)
# SKY9X, so ... # SKY9X, so ...
OPT = 2 OPT = 2
CPPDEFS += -DPCBSKY9X -DAUDIO -DHAPTIC -DRTCLOCK -DPXX -DDSM2 -DDSM2_PPM -DROTARY_ENCODERS=1 CPPDEFS += -DPCBSKY9X -DVARIANT=0 -DAUDIO -DHAPTIC -DRTCLOCK -DPXX -DDSM2 -DDSM2_PPM -DROTARY_ENCODERS=1
EXTRAINCDIRS += sky9x CoOS/kernel CoOS/portable EXTRAINCDIRS += sky9x CoOS/kernel CoOS/portable
BOARDSRC = board_sky9x.cpp BOARDSRC = board_sky9x.cpp
SRC += sky9x/core_cm3.c sky9x/board_lowlevel.c sky9x/crt.c sky9x/vectors_sam3s.c SRC += sky9x/core_cm3.c sky9x/board_lowlevel.c sky9x/crt.c sky9x/vectors_sam3s.c
@@ -498,7 +502,7 @@ endif
ifeq ($(PCB), GRUVIN9X) ifeq ($(PCB), GRUVIN9X)
# Gruvin9x PCB, so ... # Gruvin9x PCB, so ...
OPT = 2 OPT = 2
CPPDEFS += -DPCBGRUVIN9X -DAUDIO -DHAPTIC -DROTARY_ENCODERS=2 CPPDEFS += -DPCBGRUVIN9X -DVARIANT=0 -DAUDIO -DHAPTIC -DROTARY_ENCODERS=2
EXTRAINCDIRS += gruvin9x stock FatFs FatFs/option EXTRAINCDIRS += gruvin9x stock FatFs FatFs/option
BOARDSRC += board_gruvin9x.cpp BOARDSRC += board_gruvin9x.cpp
EEPROMSRC = eeprom_avr.cpp EEPROMSRC = eeprom_avr.cpp
@@ -524,7 +528,7 @@ endif
ifeq ($(PCB), STD128) ifeq ($(PCB), STD128)
# STD PCB with Atmega 128, so ... # STD PCB with Atmega 128, so ...
OPT = 2 OPT = 2
CPPDEFS += -DPCBSTD -DM128 CPPDEFS += -DPCBSTD -DM128 -DVARIANT=0
EXTRAINCDIRS += stock EXTRAINCDIRS += stock
BOARDSRC = board_stock.cpp BOARDSRC = board_stock.cpp
EEPROMSRC = eeprom_avr.cpp EEPROMSRC = eeprom_avr.cpp
@@ -556,7 +560,7 @@ ifeq ($(PCB), STD)
# STD PCB, so ... # STD PCB, so ...
OPT = s OPT = s
EXTRAINCDIRS += stock EXTRAINCDIRS += stock
CPPDEFS += -DPCBSTD CPPDEFS += -DPCBSTD -DVARIANT=$(shell echo ${VARIANT} | bc)
BOARDSRC = board_stock.cpp BOARDSRC = board_stock.cpp
EEPROMSRC = eeprom_avr.cpp EEPROMSRC = eeprom_avr.cpp
PULSESSRC = pulses_avr.cpp PULSESSRC = pulses_avr.cpp
+2 -2
View File
@@ -444,7 +444,7 @@ bool ee32LoadGeneral()
read32_eeprom_data( ( File_system[0].block_no << 12) + sizeof( struct t_eeprom_header), ( uint8_t *)&g_eeGeneral, size) ; read32_eeprom_data( ( File_system[0].block_no << 12) + sizeof( struct t_eeprom_header), ( uint8_t *)&g_eeGeneral, size) ;
} }
if (g_eeGeneral.version == EEPROM_VER && g_eeGeneral.variant == EEPROM_VARIANT) { if (g_eeGeneral.version == EEPROM_VER) {
uint16_t sum = evalChkSum(); uint16_t sum = evalChkSum();
if (g_eeGeneral.chkSum == sum) { if (g_eeGeneral.chkSum == sum) {
return true; return true;
@@ -452,7 +452,7 @@ bool ee32LoadGeneral()
} }
#ifdef SIMU #ifdef SIMU
printf("EEPROM version %d (%d) instead of %d (%d)\n", g_eeGeneral.version, g_eeGeneral.variant, EEPROM_VER, EEPROM_VARIANT); printf("EEPROM version %d (%d) instead of %d (%d)\n", g_eeGeneral.version, g_eeGeneral.variant, EEPROM_VER, VARIANT);
fflush(stdout); fflush(stdout);
#endif #endif
+8 -2
View File
@@ -816,14 +816,20 @@ bool eeLoadGeneral()
if (theFile.readRlc((uint8_t*)&g_eeGeneral, 1) == 1 && g_eeGeneral.version == EEPROM_VER) { if (theFile.readRlc((uint8_t*)&g_eeGeneral, 1) == 1 && g_eeGeneral.version == EEPROM_VER) {
theFile.openRlc(FILE_GENERAL); theFile.openRlc(FILE_GENERAL);
if (theFile.readRlc((uint8_t*)&g_eeGeneral, sizeof(g_eeGeneral)) <= sizeof(EEGeneral)) { if (theFile.readRlc((uint8_t*)&g_eeGeneral, sizeof(g_eeGeneral)) <= sizeof(EEGeneral)) {
if (g_eeGeneral.variant == EEPROM_VARIANT && g_eeGeneral.chkSum == evalChkSum()) { #if defined(PCBSTD)
if (g_eeGeneral.variant == VARIANT && g_eeGeneral.chkSum == evalChkSum()) {
return true; return true;
} }
#else
if (g_eeGeneral.chkSum == evalChkSum()) {
return true;
}
#endif
} }
} }
#ifdef SIMU #ifdef SIMU
printf("EEPROM version %d (%d) instead of %d (%d)\n", g_eeGeneral.version, g_eeGeneral.variant, EEPROM_VER, EEPROM_VARIANT); printf("EEPROM version %d (%d) instead of %d (%d)\n", g_eeGeneral.version, g_eeGeneral.variant, EEPROM_VER, VARIANT);
fflush(stdout); fflush(stdout);
#endif #endif
+2 -2
View File
@@ -1090,7 +1090,7 @@ void putsTelemetryChannel(uint8_t x, uint8_t y, uint8_t channel, int16_t val, ui
enum FrskyViews { enum FrskyViews {
e_frsky_custom_screen_1, e_frsky_custom_screen_1,
e_frsky_custom_screen_2, e_frsky_custom_screen_2,
// TODO IF_PCBSKY9X(e_frsky_custom_screen_3) IF_PCBSKY9X(e_frsky_custom_screen_3)
e_frsky_voltages, e_frsky_voltages,
e_frsky_after_flight, e_frsky_after_flight,
FRSKY_VIEW_MAX = e_frsky_after_flight FRSKY_VIEW_MAX = e_frsky_after_flight
@@ -1214,7 +1214,7 @@ void menuTelemetryFrsky(uint8_t event)
lcd_filled_rect(0, 0, DISPLAY_W, 8); lcd_filled_rect(0, 0, DISPLAY_W, 8);
if (frskyStreaming >= 0) { if (frskyStreaming >= 0) {
if (s_frsky_view < 2/* TODO MAX_FRSKY_SCREENS*/) { if (s_frsky_view < MAX_FRSKY_SCREENS) {
FrSkyScreenData & screen = g_model.frsky.screens[s_frsky_view]; FrSkyScreenData & screen = g_model.frsky.screens[s_frsky_view];
if (g_model.frsky.screensType & (1<<s_frsky_view)) { if (g_model.frsky.screensType & (1<<s_frsky_view)) {
// Custom Screen with gauges // Custom Screen with gauges
+2
View File
@@ -218,5 +218,7 @@ extern const pm_uint8_t bchunit_ar[];
int16_t applyChannelRatio(uint8_t channel, int16_t val); int16_t applyChannelRatio(uint8_t channel, int16_t val);
void putsTelemetryChannel(uint8_t x, uint8_t y, uint8_t channel, int16_t val, uint8_t att); void putsTelemetryChannel(uint8_t x, uint8_t y, uint8_t channel, int16_t val, uint8_t att);
#define IS_BARS_SCREEN(screenIndex) (g_model.frsky.screensType & (1<<(screenIndex)))
#endif #endif
+7 -8
View File
@@ -126,17 +126,17 @@ enum menuGeneralSetupItems {
void menuGeneralSetup(uint8_t event) void menuGeneralSetup(uint8_t event)
{ {
MENU(STR_MENURADIOSETUP, menuTabDiag, e_Setup, ITEM_SETUP_MAX+1, {0, IF_RTCLOCK(2) IF_RTCLOCK(2) 0, 0, IF_AUDIO(0) IF_VOICE(0) IF_HAPTIC(0) IF_HAPTIC(0) IF_HAPTIC(0) IF_PCBSKY9X(0) 0, 0, IF_PCBSKY9X(0) IF_PCBSKY9X(0) 0, IF_ROTARY_ENCODERS(0) 0, 0, 0, 0, 0, 0, 0, IF_SPLASH(0) 0, 0, IF_FRSKY(0) IF_FRSKY(0) 0, (uint8_t)-1, 1});
uint8_t sub = m_posVert - 1;
#if defined(RTCLOCK) #if defined(RTCLOCK)
static struct gtm t; static struct gtm t;
if ((sub!=ITEM_SETUP_DATE && sub!=ITEM_SETUP_TIME) || s_editMode<=0) { if ((m_posVert!=ITEM_SETUP_DATE+1 && m_posVert!=ITEM_SETUP_TIME+1) || s_editMode<=0) {
gettime(&t); gettime(&t);
} }
#endif #endif
MENU(STR_MENURADIOSETUP, menuTabDiag, e_Setup, ITEM_SETUP_MAX+1, {0, IF_RTCLOCK(2) IF_RTCLOCK(2) 0, 0, IF_AUDIO(0) IF_VOICE(0) IF_HAPTIC(0) IF_HAPTIC(0) IF_HAPTIC(0) IF_PCBSKY9X(0) 0, 0, IF_PCBSKY9X(0) IF_PCBSKY9X(0) 0, IF_ROTARY_ENCODERS(0) 0, 0, 0, 0, 0, 0, 0, IF_SPLASH(0) 0, 0, IF_FRSKY(0) IF_FRSKY(0) 0, (uint8_t)-1, 1});
uint8_t sub = m_posVert - 1;
for (uint8_t i=0; i<7; i++) { for (uint8_t i=0; i<7; i++) {
uint8_t y = 1*FH + i*FH; uint8_t y = 1*FH + i*FH;
uint8_t k = i+s_pgOfs; uint8_t k = i+s_pgOfs;
@@ -766,9 +766,8 @@ void menuGeneralVersion(uint8_t event)
lcd_putsLeft(5*FH, PSTR("CoPr: ---")); lcd_putsLeft(5*FH, PSTR("CoPr: ---"));
} }
#endif #endif
lcd_putsLeft(7*FH, STR_EEPROMV); lcd_putsLeft(7*FH, eeprom_stamp);
lcd_outdezAtt(6*FW+1, 7*FH, g_eeGeneral.version, LEFT); // TODO remove lcd_putsLeft(7*FH, STR_EEPROMV);
lcd_outhex4(10*FW+1, 7*FH, g_eeGeneral.variant);
} }
void displayKeyState(uint8_t x, uint8_t y, EnumKeys key) void displayKeyState(uint8_t x, uint8_t y, EnumKeys key)
+38 -4
View File
@@ -2230,7 +2230,7 @@ void menuModelLimits(uint8_t event)
#if defined(GVARS) && defined(PCBSKY9X) #if defined(GVARS) && defined(PCBSKY9X)
void menuModelRegisterOne(uint8_t event) void menuModelRegisterOne(uint8_t event)
{ {
model_gvar_t *reg = &g_model.gvars[s_curveChan]; gvar_t *reg = &g_model.gvars[s_curveChan];
putsStrIdx(11*FW, 0, STR_GV, s_curveChan+1); putsStrIdx(11*FW, 0, STR_GV, s_curveChan+1);
@@ -2835,6 +2835,13 @@ enum menuModelTelemetryItems {
ITEM_TELEMETRY_SCREEN_LINE6, ITEM_TELEMETRY_SCREEN_LINE6,
ITEM_TELEMETRY_SCREEN_LINE7, ITEM_TELEMETRY_SCREEN_LINE7,
ITEM_TELEMETRY_SCREEN_LINE8, ITEM_TELEMETRY_SCREEN_LINE8,
#if defined(PCBSKY9X)
ITEM_TELEMETRY_SCREEN_LABEL3,
ITEM_TELEMETRY_SCREEN_LINE9,
ITEM_TELEMETRY_SCREEN_LINE10,
ITEM_TELEMETRY_SCREEN_LINE11,
ITEM_TELEMETRY_SCREEN_LINE12,
#endif
ITEM_TELEMETRY_MAX ITEM_TELEMETRY_MAX
}; };
@@ -2853,7 +2860,7 @@ enum menuModelTelemetryItems {
void menuModelTelemetry(uint8_t event) void menuModelTelemetry(uint8_t event)
{ {
MENU(STR_MENUTELEMETRY, menuTabModel, e_Telemetry, ITEM_TELEMETRY_MAX+1, {0, (uint8_t)-1, 1, 0, 2, 2, (uint8_t)-1, 1, 0, 2, 2, (uint8_t)-1, 1, 1, USRDATA_LINES 0, 0, IF_VARIO((uint8_t)-1) IF_VARIO(0) IF_VARIO(1) 0, 2, 2, 2, 2, 0, 2, 2, 2, 2}); MENU(STR_MENUTELEMETRY, menuTabModel, e_Telemetry, ITEM_TELEMETRY_MAX+1, {0, (uint8_t)-1, 1, 0, 2, 2, (uint8_t)-1, 1, 0, 2, 2, (uint8_t)-1, 1, 1, USRDATA_LINES 0, 0, IF_VARIO((uint8_t)-1) IF_VARIO(0) IF_VARIO(1) 0, 2, 2, 2, 2, 0, 2, 2, 2, IF_PCBSKY9X(2) IF_PCBSKY9X(0) IF_PCBSKY9X(2) IF_PCBSKY9X(2) IF_PCBSKY9X(2) 2 });
uint8_t sub = m_posVert - 1; uint8_t sub = m_posVert - 1;
@@ -3038,14 +3045,27 @@ void menuModelTelemetry(uint8_t event)
case ITEM_TELEMETRY_SCREEN_LABEL1: case ITEM_TELEMETRY_SCREEN_LABEL1:
case ITEM_TELEMETRY_SCREEN_LABEL2: case ITEM_TELEMETRY_SCREEN_LABEL2:
#if defined(PCBSKY9X)
case ITEM_TELEMETRY_SCREEN_LABEL3:
{
uint8_t screenIndex = (k < ITEM_TELEMETRY_SCREEN_LABEL2 ? 0 : (k < ITEM_TELEMETRY_SCREEN_LABEL3 ? 1 : 2));
bool screenType = IS_BARS_SCREEN(screenIndex);
putsStrIdx(0*FW, y, STR_SCREEN, screenIndex+1);
if (screenType != selectMenuItem(10*FW, y, PSTR(""), STR_VSCREEN, screenType, 0, 1, attr, event))
g_model.frsky.screensType ^= (1 << screenIndex);
break;
}
#else
{ {
uint8_t screenIndex = (k < ITEM_TELEMETRY_SCREEN_LABEL2 ? 1 : 2); uint8_t screenIndex = (k < ITEM_TELEMETRY_SCREEN_LABEL2 ? 1 : 2);
putsStrIdx(0*FW, y, STR_SCREEN, screenIndex);
bool screenType = g_model.frsky.screensType & screenIndex; bool screenType = g_model.frsky.screensType & screenIndex;
putsStrIdx(0*FW, y, STR_SCREEN, screenIndex);
if (screenType != selectMenuItem(10*FW, y, PSTR(""), STR_VSCREEN, screenType, 0, 1, attr, event)) if (screenType != selectMenuItem(10*FW, y, PSTR(""), STR_VSCREEN, screenType, 0, 1, attr, event))
g_model.frsky.screensType ^= screenIndex; g_model.frsky.screensType ^= screenIndex;
break; break;
} }
#endif
case ITEM_TELEMETRY_SCREEN_LINE1: case ITEM_TELEMETRY_SCREEN_LINE1:
case ITEM_TELEMETRY_SCREEN_LINE2: case ITEM_TELEMETRY_SCREEN_LINE2:
@@ -3055,17 +3075,31 @@ void menuModelTelemetry(uint8_t event)
case ITEM_TELEMETRY_SCREEN_LINE6: case ITEM_TELEMETRY_SCREEN_LINE6:
case ITEM_TELEMETRY_SCREEN_LINE7: case ITEM_TELEMETRY_SCREEN_LINE7:
case ITEM_TELEMETRY_SCREEN_LINE8: case ITEM_TELEMETRY_SCREEN_LINE8:
#if defined(PCBSKY9X)
case ITEM_TELEMETRY_SCREEN_LINE9:
case ITEM_TELEMETRY_SCREEN_LINE10:
case ITEM_TELEMETRY_SCREEN_LINE11:
case ITEM_TELEMETRY_SCREEN_LINE12:
#endif
{ {
uint8_t screenIndex, lineIndex; uint8_t screenIndex, lineIndex;
if (k < ITEM_TELEMETRY_SCREEN_LABEL2) { if (k < ITEM_TELEMETRY_SCREEN_LABEL2) {
screenIndex = 0; screenIndex = 0;
lineIndex = k-ITEM_TELEMETRY_SCREEN_LINE1; lineIndex = k-ITEM_TELEMETRY_SCREEN_LINE1;
} }
#if defined(PCBSKY9X)
else if (k >= ITEM_TELEMETRY_SCREEN_LABEL3) {
screenIndex = 2;
lineIndex = k-ITEM_TELEMETRY_SCREEN_LINE9;
}
#endif
else { else {
screenIndex = 1; screenIndex = 1;
lineIndex = k-ITEM_TELEMETRY_SCREEN_LINE5; lineIndex = k-ITEM_TELEMETRY_SCREEN_LINE5;
} }
if (g_model.frsky.screensType & (screenIndex+1)) { if (IS_BARS_SCREEN(screenIndex)) {
FrSkyBarData & bar = g_model.frsky.screens[screenIndex].bars[lineIndex]; FrSkyBarData & bar = g_model.frsky.screens[screenIndex].bars[lineIndex];
uint8_t barSource = bar.source; uint8_t barSource = bar.source;
lcd_putsiAtt(4, y, STR_VTELEMCHNS, barSource, (attr && m_posHorz==0) ? blink : 0); lcd_putsiAtt(4, y, STR_VTELEMCHNS, barSource, (attr && m_posHorz==0) ? blink : 0);
+38 -23
View File
@@ -622,13 +622,45 @@ PACK(typedef struct t_SwashRingData { // Swash Ring data
#define TRIM_ARRAY int16_t trim[4] #define TRIM_ARRAY int16_t trim[4]
#endif #endif
#if defined(PCBSKY9X)
PACK(typedef struct {
int8_t value;
char name[6];
}) gvar_t;
#define GVAR_VALUE(x) g_model.gvars[x].value
#else
typedef int8_t gvar_t;
#define GVAR_VALUE(x) g_model.gvars[x]
#endif
#if defined(PCBSTD)
#define PHASE_GVARS_DATA
#if defined(GVARS)
#define MAX_GVARS 5
#define MODEL_GVARS_DATA gvar_t gvars[MAX_GVARS]
#else
#define MAX_GVARS 0
#define MODEL_GVARS_DATA
#endif
#else
#define PHASE_GVARS_DATA
#if defined(GVARS)
#define MAX_GVARS 5
#define MODEL_GVARS_DATA gvar_t gvars[MAX_GVARS]
#else
#define MAX_GVARS 0
#define MODEL_GVARS_DATA gvar_t gvars[5]
#endif
#endif
PACK(typedef struct t_PhaseData { PACK(typedef struct t_PhaseData {
TRIM_ARRAY; TRIM_ARRAY;
int8_t swtch; // swtch of phase[0] is not used int8_t swtch; // swtch of phase[0] is not used
char name[LEN_FP_NAME]; char name[LEN_FP_NAME];
uint8_t fadeIn:4; uint8_t fadeIn:4;
uint8_t fadeOut:4; uint8_t fadeOut:4;
ROTARY_ENCODER_ARRAY ROTARY_ENCODER_ARRAY;
PHASE_GVARS_DATA;
}) PhaseData; }) PhaseData;
#if defined(PCBSKY9X) #if defined(PCBSKY9X)
@@ -718,10 +750,12 @@ enum Dsm2Variants {
DSM2_DSMX DSM2_DSMX
}; };
#ifdef MAVLINK #if defined(MAVLINK)
#define TELEMETRY_DATA MavlinkData mavlink #define TELEMETRY_DATA MavlinkData mavlink
#else #elif defined(FRSKY) || !defined(PCBSTD)
#define TELEMETRY_DATA FrSkyData frsky #define TELEMETRY_DATA FrSkyData frsky
#else
#define TELEMETRY_DATA
#endif #endif
#if defined(PCBGRUVIN9X) || defined(PCBSKY9X) #if defined(PCBGRUVIN9X) || defined(PCBSKY9X)
@@ -730,25 +764,6 @@ enum Dsm2Variants {
#define BeepANACenter uint8_t #define BeepANACenter uint8_t
#endif #endif
#if defined(PCBSKY9X)
PACK(typedef struct {
int8_t value;
char name[6];
}) model_gvar_t;
#define GVAR_VALUE(x) g_model.gvars[x].value
#else
typedef int8_t model_gvar_t;
#define GVAR_VALUE(x) g_model.gvars[x]
#endif
#if defined(GVARS)
#define MAX_GVARS 5
#define GVARS_DATA model_gvar_t gvars[MAX_GVARS]
#else
#define MAX_GVARS 0
#define GVARS_DATA
#endif
PACK(typedef struct t_ModelData { PACK(typedef struct t_ModelData {
char name[LEN_MODEL_NAME]; // must be first for eeLoadModelName char name[LEN_MODEL_NAME]; // must be first for eeLoadModelName
TimerData timers[MAX_TIMERS]; TimerData timers[MAX_TIMERS];
@@ -781,7 +796,7 @@ PACK(typedef struct t_ModelData {
uint8_t switchWarningStates; uint8_t switchWarningStates;
GVARS_DATA; MODEL_GVARS_DATA;
TELEMETRY_DATA; TELEMETRY_DATA;
+1 -1
View File
@@ -216,7 +216,7 @@ void generalDefault()
{ {
memclear(&g_eeGeneral, sizeof(g_eeGeneral)); memclear(&g_eeGeneral, sizeof(g_eeGeneral));
g_eeGeneral.version = EEPROM_VER; g_eeGeneral.version = EEPROM_VER;
g_eeGeneral.variant = EEPROM_VARIANT; g_eeGeneral.variant = VARIANT;
g_eeGeneral.contrast = 25; g_eeGeneral.contrast = 25;
g_eeGeneral.vBatWarn = 90; g_eeGeneral.vBatWarn = 90;
for (int i = 0; i < 7; ++i) { for (int i = 0; i < 7; ++i) {
+3 -7
View File
@@ -85,10 +85,8 @@
#endif #endif
#if defined(FRSKY) #if defined(FRSKY)
#define FRSKY_VARIANT 0x0002
#define IF_FRSKY(x) x, #define IF_FRSKY(x) x,
#else #else
#define FRSKY_VARIANT 0x0000
#define IF_FRSKY(x) #define IF_FRSKY(x)
#endif #endif
@@ -135,10 +133,8 @@
#endif #endif
#if defined(GVARS) #if defined(GVARS)
#define GVARS_VARIANT 0x0001
#define IF_GVARS(x) x, #define IF_GVARS(x) x,
#else #else
#define GVARS_VARIANT 0x0000
#define IF_GVARS(x) #define IF_GVARS(x)
#endif #endif
@@ -148,7 +144,8 @@
#define WDT_RESET_STOCK() #define WDT_RESET_STOCK()
#endif #endif
/* #define HELI_VARIANT 0x0004 /*
#define HELI_VARIANT 0x0004
#define VOICE_VARIANT 0x0008 #define VOICE_VARIANT 0x0008
#define PHASES_VARIANT 0x0010 #define PHASES_VARIANT 0x0010
#define PXX_VARIANT 0x0020 #define PXX_VARIANT 0x0020
@@ -156,8 +153,6 @@
#define VARIO_VARIANT 0x0080 #define VARIO_VARIANT 0x0080
#define HAPTIC_VARIANT 0x0100 */ #define HAPTIC_VARIANT 0x0100 */
#define EEPROM_VARIANT (GVARS_VARIANT + FRSKY_VARIANT)
#if defined(PCBSKY9X) #if defined(PCBSKY9X)
#include "board_sky9x.h" #include "board_sky9x.h"
#elif defined(PCBGRUVIN9X) #elif defined(PCBGRUVIN9X)
@@ -982,6 +977,7 @@ extern inline uint16_t get_tmr10ms()
extern const char stamp1[]; extern const char stamp1[];
extern const char stamp2[]; extern const char stamp2[];
extern const char stamp3[]; extern const char stamp3[];
extern const char eeprom_stamp[];
extern uint8_t g_vbat100mV; extern uint8_t g_vbat100mV;
extern volatile uint8_t g_blinkTmr10ms; extern volatile uint8_t g_blinkTmr10ms;
+1 -1
View File
@@ -40,4 +40,4 @@
const pm_char stamp1[] PROGMEM = " SVN: " SVN_STR; const pm_char stamp1[] PROGMEM = " SVN: " SVN_STR;
const pm_char stamp2[] PROGMEM = "DATE: " DATE_STR; const pm_char stamp2[] PROGMEM = "DATE: " DATE_STR;
const pm_char stamp3[] PROGMEM = "TIME: " TIME_STR; const pm_char stamp3[] PROGMEM = "TIME: " TIME_STR;
const pm_char eeprom_stamp[] PROGMEM = "EEPR: " DEFNUMSTR(EEPROM_VER) "-" DEFNUMSTR(VARIANT);