Blades count for RPMs. Reordering of the TELEMETRY screen

This commit is contained in:
bsongis
2012-02-14 18:23:46 +00:00
parent 65621cae81
commit cd057686ef
8 changed files with 48 additions and 22 deletions
+1 -1
View File
@@ -532,7 +532,7 @@ void menuMainView(uint8_t event)
// RPM
lcd_putsLeft(2*FH, STR_RPMnFUEL);
lcd_outdezNAtt(4*FW, 1*FH, frskyHubData.rpm, DBLSIZE|LEFT);
lcd_outdezNAtt(4*FW, 1*FH, frskyHubData.rpm/(2+g_model.frsky.blades), DBLSIZE|LEFT);
// Fuel
putsTelemetryValue(15*FW, 2*FH, frskyHubData.fuelLevel, UNIT_PERCENT, DBLSIZE|LEFT);
+30 -15
View File
@@ -1841,12 +1841,12 @@ void menuProcSafetySwitches(uint8_t event)
void menuProcTelemetry(uint8_t event)
{
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
MENU(STR_MENUTELEMETRY, menuTabModel, e_Telemetry, 16, {0, -1, 1, 0, 2, 2, -1, 1, 0, 2, 2, 0, 2, 2, 2, 2});
MENU(STR_MENUTELEMETRY, menuTabModel, e_Telemetry, 19, {0, -1, 1, 0, 2, 2, -1, 1, 0, 2, 2, -1, 0, 0, -1, 2, 2, 2, 2});
#else
MENU(STR_MENUTELEMETRY, menuTabModel, e_Telemetry, 15, {0, -1, 1, 0, 2, 2, -1, 1, 0, 2, 2, 2, 2, 2, 2});
MENU(STR_MENUTELEMETRY, menuTabModel, e_Telemetry, 16, {0, -1, 1, 0, 2, 2, -1, 1, 0, 2, 2, -1, 2, 2, 2, 2});
#endif
int8_t sub = m_posVert;
int8_t sub = m_posVert;
uint8_t blink;
uint8_t y;
@@ -1939,28 +1939,43 @@ void menuProcTelemetry(uint8_t event)
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
if(s_pgOfs<subN) {
y = (subN-s_pgOfs)*FH;
lcd_putsLeft(y, STR_USRPROTO);
#if defined(WS_HOW_HIGH)
#define USR_PROTO_MAX 2
#else
#define USR_PROTO_MAX 1
#endif
lcd_putsLeft(y, STR_USRDATA);
}
subN++;
if(s_pgOfs<subN) {
y = (subN-s_pgOfs)*FH;
lcd_puts(4, y, STR_PROTO);
lcd_putsnAtt(TELEM_COL2, y, STR_VTELPROTO+LEN_VTELPROTO*g_model.frsky.usrProto, LEN_VTELPROTO, sub==subN ? INVERS:0);
if (sub==subN)
CHECK_INCDEC_MODELVAR(event, g_model.frsky.usrProto, 0, USR_PROTO_MAX);
CHECK_INCDEC_MODELVAR(event, g_model.frsky.usrProto, 0, 2);
}
subN++;
if(s_pgOfs<subN) {
y = (subN-s_pgOfs)*FH;
lcd_puts(4, y, STR_BLADES);
lcd_outdezAtt(TELEM_COL2+FWNUM, y, 2+g_model.frsky.blades, sub==subN ? INVERS : 0);
if (sub==subN)
CHECK_INCDEC_MODELVAR(event, g_model.frsky.blades, 0, 1);
}
subN++;
#endif
// Bars setup
// Bars
if(s_pgOfs<subN) {
y = (subN-s_pgOfs)*FH;
lcd_putsLeft(y, STR_BARS);
}
subN++;
for (int j=0; j<4; j++) {
if (s_pgOfs<subN) {
y = (subN-s_pgOfs)*FH;
putsStrIdx(0*FW, y, PSTR("Bar"), j+1); // TODO lang
lcd_putsnAtt(5*FW, y, STR_VTELEMBARS+LEN_VTELEMBARS*g_model.frsky.bars[j].source, LEN_VTELEMBARS, sub==subN && m_posHorz==0 ? blink : 0);
lcd_putsnAtt(4, y, STR_VTELEMBARS+LEN_VTELEMBARS*g_model.frsky.bars[j].source, LEN_VTELEMBARS, sub==subN && m_posHorz==0 ? blink : 0);
if (g_model.frsky.bars[j].source) {
putsTelemetryChannel(TELEM_COL2, y, g_model.frsky.bars[j].source-1, g_model.frsky.bars[j].barMin*5, (sub==subN && m_posHorz==1 ? blink : 0) | LEFT);
putsTelemetryChannel(16*FW-3, y, g_model.frsky.bars[j].source-1, (51-g_model.frsky.bars[j].barMax)*5, (sub==subN && m_posHorz==2 ? blink : 0) | LEFT);
putsTelemetryChannel(TELEM_COL2-3*FW, y, g_model.frsky.bars[j].source-1, g_model.frsky.bars[j].barMin*5, (sub==subN && m_posHorz==1 ? blink : 0) | LEFT);
putsTelemetryChannel(14*FW-3, y, g_model.frsky.bars[j].source-1, (51-g_model.frsky.bars[j].barMax)*5, (sub==subN && m_posHorz==2 ? blink : 0) | LEFT);
}
else {
if (sub == subN) m_posHorz = 0;
+3 -2
View File
@@ -238,9 +238,10 @@ PACK(typedef struct t_FrSkyBarData {
#define PROTO_WS_HOW_HIGH 2
PACK(typedef struct t_FrSkyData {
FrSkyChannelData channels[2];
uint16_t usrProto:3; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
uint16_t usrProto:3; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
uint16_t imperial:1;
uint16_t spare:4;
uint16_t blades:1; // How many blades for RPMs, 0=2 blades, 1=3 blades
uint16_t spare:3;
FrSkyBarData bars[4];
}) FrSkyData;
+3 -1
View File
@@ -142,7 +142,9 @@ const pm_char STR_ACHANNEL[] PROGMEM = TR_ACHANNEL;
const pm_char STR_RANGE[] PROGMEM = TR_RANGE;
const pm_char STR_BAR[] PROGMEM = TR_BAR;
const pm_char STR_ALARM[] PROGMEM = TR_ALARM;
const pm_char STR_USRPROTO[] PROGMEM = TR_USRPROTO;
const pm_char STR_USRDATA[] PROGMEM = TR_USRDATA;
const pm_char STR_BLADES[] PROGMEM = TR_BLADES; // TODO check that it is optimized away when no FRSKY
const pm_char STR_BARS[] PROGMEM = TR_BARS;
const pm_char STR_CLEARMIXMENU[] PROGMEM = TR_CLEARMIXMENU;
const pm_char STR_BEEPER[] PROGMEM = TR_BEEPER;
const pm_char STR_CONTRAST[] PROGMEM = TR_CONTRAST;
+3 -1
View File
@@ -223,7 +223,9 @@ extern const pm_char STR_ACHANNEL[];
extern const pm_char STR_RANGE[];
extern const pm_char STR_BAR[];
extern const pm_char STR_ALARM[];
extern const pm_char STR_USRPROTO[];
extern const pm_char STR_USRDATA[];
extern const pm_char STR_BLADES[];
extern const pm_char STR_BARS[];
extern const pm_char STR_CLEARMIXMENU[];
extern const pm_char STR_BEEPER[];
extern const pm_char STR_CONTRAST[];
+2
View File
@@ -168,6 +168,7 @@ extern sem_t eeprom_write_sem;
#define TIMSK dummyport
#define TIMSK1 dummyport
#define TIMSK4 dummyport
#define ETIMSK dummyport
#define ETIMSK1 dummyport
@@ -175,6 +176,7 @@ extern sem_t eeprom_write_sem;
#define OCIE1A dummyport
#define OCIE1B dummyport
#define OCIE1C dummyport
#define OCIE4A dummyport
#define OUT_B_LIGHT 7
#define INP_E_ElevDR 2
+3 -1
View File
@@ -183,7 +183,9 @@
#define TR_RANGE "Range"
#define TR_BAR "Bar"
#define TR_ALARM "Alarm"
#define TR_USRPROTO "UsrProto"
#define TR_USRDATA "UsrData"
#define TR_BLADES "Blades"
#define TR_BARS "Bars"
#define TR_CLEARMIXMENU "CLEAR MIXES [MENU]"
#define TR_BEEPER "Beeper"
#define TR_CONTRAST "Contrast"
+3 -1
View File
@@ -183,7 +183,9 @@
#define TR_RANGE "Range"
#define TR_BAR "Bar"
#define TR_ALARM "Alarme"
#define TR_USRPROTO "UsrProto"
#define TR_USRDATA "UsrData"
#define TR_BLADES "Blades"
#define TR_BARS "Bars"
#define TR_CLEARMIXMENU "EFFACER MIXAGES[MENU]"
#define TR_BEEPER "Bipeur"
#define TR_CONTRAST "Contraste"