mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 17:25:13 +03:00
New telemetry screens (bars)
New telemetry units for A1 / A2 Update to pgmtypes according to Michal patch (suggested by gcc developers!) EEPROM v204
This commit is contained in:
parent
2c64004e7c
commit
caa2aec727
22 changed files with 670 additions and 558 deletions
|
@ -40,11 +40,11 @@ uint8_t tabViews[] = {
|
|||
2, /*e_inputs*/
|
||||
1, /*e_timer2*/
|
||||
#if defined(FRSKY_HUB)
|
||||
4, /*e_telemetry*/
|
||||
5, /*e_telemetry*/
|
||||
#elif defined(WS_HOW_HIGH)
|
||||
3, /*e_telemetry*/
|
||||
4, /*e_telemetry*/
|
||||
#elif defined(FRSKY)
|
||||
2, /*e_telemetry*/
|
||||
3, /*e_telemetry*/
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -67,8 +67,8 @@ void doMainScreenGrphics()
|
|||
DO_CROSS(LBOX_CENTERX,LBOX_CENTERY,3)
|
||||
DO_CROSS(RBOX_CENTERX,RBOX_CENTERY,3)
|
||||
|
||||
lcd_square(LBOX_CENTERX+(calibratedStick[CONVERT_MODE(0+1)-1]*BOX_LIMIT/(2*RESX))-MARKER_WIDTH/2, LBOX_CENTERY-(calibratedStick[CONVERT_MODE(1+1)-1]*BOX_LIMIT/(2*RESX))-MARKER_WIDTH/2, MARKER_WIDTH);
|
||||
lcd_square(RBOX_CENTERX+(calibratedStick[CONVERT_MODE(3+1)-1]*BOX_LIMIT/(2*RESX))-MARKER_WIDTH/2, RBOX_CENTERY-(calibratedStick[CONVERT_MODE(2+1)-1]*BOX_LIMIT/(2*RESX))-MARKER_WIDTH/2, MARKER_WIDTH);
|
||||
lcd_square(LBOX_CENTERX+(calibratedStick[CONVERT_MODE(0+1)-1]*BOX_LIMIT/(2*RESX))-MARKER_WIDTH/2, LBOX_CENTERY-(calibratedStick[CONVERT_MODE(1+1)-1]*BOX_LIMIT/(2*RESX))-MARKER_WIDTH/2, MARKER_WIDTH, ROUND);
|
||||
lcd_square(RBOX_CENTERX+(calibratedStick[CONVERT_MODE(3+1)-1]*BOX_LIMIT/(2*RESX))-MARKER_WIDTH/2, RBOX_CENTERY-(calibratedStick[CONVERT_MODE(2+1)-1]*BOX_LIMIT/(2*RESX))-MARKER_WIDTH/2, MARKER_WIDTH, ROUND);
|
||||
|
||||
// Optimization by Mike Blandford
|
||||
{
|
||||
|
@ -81,11 +81,31 @@ void doMainScreenGrphics()
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(FRSKY)
|
||||
void displayA1A2(uint8_t x, uint8_t y, uint8_t idx)
|
||||
{
|
||||
lcd_puts(x, y, PSTR("A :"));
|
||||
lcd_putc(x+FW, y, '1'+idx);
|
||||
}
|
||||
|
||||
void displayRssiLine()
|
||||
{
|
||||
lcd_hline(0, 54, 128, 0); // separator
|
||||
lcd_putsLeft(7*FH+1, STR_TX); lcd_outdezNAtt(4*FW, 7*FH+1, frskyRSSI[1].value, LEADING0, 2);
|
||||
lcd_rect(25, 57, 38, 7);
|
||||
lcd_filled_rect(26, 58, 9*frskyRSSI[1].value/25, 5);
|
||||
lcd_puts(105, 7*FH+1, STR_RX); lcd_outdezNAtt(105+4*FW-1, 7*FH+1, frskyRSSI[0].value, LEADING0, 2);
|
||||
lcd_rect(65, 57, 38, 7);
|
||||
uint8_t v = 9*frskyRSSI[0].value/25;
|
||||
lcd_filled_rect(66+36-v, 58, v, 5);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
|
||||
void displayAltitudeLine(uint8_t x, uint8_t y, uint8_t flags)
|
||||
{
|
||||
lcd_puts_P(x, y, STR_ALT);
|
||||
int16_t value = frskyHubData.baroAltitude + baroAltitudeOffset;
|
||||
lcd_puts(x, y, STR_ALT);
|
||||
int16_t value = frskyHubData.baroAltitude + frskyHubData.baroAltitudeOffset;
|
||||
putsTelemetryValue(lcd_lastPos, y, value, UNIT_METERS, flags|LEFT);
|
||||
}
|
||||
#endif
|
||||
|
@ -248,11 +268,11 @@ void menuMainView(uint8_t event)
|
|||
uint8_t xm, ym;
|
||||
xm = x[CONVERT_MODE(i+1)-1];
|
||||
|
||||
uint8_t att = 0;
|
||||
uint8_t att = ROUND;
|
||||
int16_t val = getTrimValue(getTrimFlightPhase(i, phase), i);
|
||||
|
||||
if (val < -125 || val > 125)
|
||||
att = BLINK;
|
||||
att = BLINK|ROUND;
|
||||
|
||||
if (val < -(TL+1)*4)
|
||||
val = -(TL+1);
|
||||
|
@ -265,7 +285,6 @@ void menuMainView(uint8_t event)
|
|||
ym = 31;
|
||||
lcd_vline(xm, ym-TL, TL*2);
|
||||
if (i!=2 || !g_model.thrTrim) {
|
||||
// TODO square?
|
||||
lcd_vline(xm-1, ym-1, 3);
|
||||
lcd_vline(xm+1, ym-1, 3);
|
||||
}
|
||||
|
@ -288,7 +307,7 @@ void menuMainView(uint8_t event)
|
|||
uint8_t x0,y0;
|
||||
int16_t val = g_chans512[i];
|
||||
//val += g_model.limitData[i].revert ? g_model.limitData[i].offset : -g_model.limitData[i].offset;
|
||||
switch(view_base) // TODO optim with if (view_base == e_e_outputValues) ... else ...
|
||||
switch(view_base)
|
||||
{
|
||||
case e_outputValues:
|
||||
x0 = (i%4*9+3)*FW/2;
|
||||
|
@ -305,19 +324,18 @@ void menuMainView(uint8_t event)
|
|||
#define WBAR2 (50/2)
|
||||
x0 = i<4 ? 128/4+2 : 128*3/4-2;
|
||||
y0 = 38+(i%4)*5;
|
||||
int8_t l = (abs(val) * WBAR2 + 512) / 1024;
|
||||
if(l>WBAR2) l = WBAR2; // prevent bars from going over the end - comment for debugging
|
||||
|
||||
lcd_hlineStip(x0-WBAR2,y0,WBAR2*2+1,0x55);
|
||||
int8_t len = (abs(val) * WBAR2 + 512) / 1024;
|
||||
if(len>WBAR2) len = WBAR2; // prevent bars from going over the end - comment for debugging
|
||||
lcd_hlineStip(x0-WBAR2, y0, WBAR2*2+1, DOTTED);
|
||||
lcd_vline(x0,y0-2,5);
|
||||
// TODO optim
|
||||
if(val>0){
|
||||
if (val>0){
|
||||
x0+=1;
|
||||
}else{
|
||||
x0-=l;
|
||||
x0-=len;
|
||||
}
|
||||
lcd_hline(x0,y0+1,l);
|
||||
lcd_hline(x0,y0-1,l);
|
||||
lcd_hline(x0,y0+1,len);
|
||||
lcd_hline(x0,y0-1,len);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -340,103 +358,98 @@ void menuMainView(uint8_t event)
|
|||
V_BAR(SCREEN_WIDTH/2-5*4+2+i*5, SCREEN_HEIGHT-8, len)
|
||||
}
|
||||
for (uint8_t i=0; i<12; i++) {
|
||||
if ((i%6) < 3) lcd_puts_P(i<6 ? 2*FW-2 : 16*FW-2, (i%3)*FH+4*FH, STR_SW);
|
||||
if ((i%6) < 3) lcd_puts(i<6 ? 2*FW-2 : 16*FW-2, (i%3)*FH+4*FH, STR_SW);
|
||||
lcd_putcAtt((i<6 ? 2*FW-2 : 16*FW-2) + 2 * FW + ((i%6) < 3 ? 0 : FW), (i%3)*FH+4*FH, i<9 ? '1'+i : 'A'+i-9, getSwitch(10+i, 0) ? INVERS : 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
#if defined(FRSKY)
|
||||
else if (view_base == e_telemetry) {
|
||||
static uint8_t displayCount = 0;
|
||||
static uint8_t staticTelemetry[2];
|
||||
static uint8_t staticRSSI[2];
|
||||
static bool alarmRaised[2];
|
||||
|
||||
if (frskyStreaming) {
|
||||
uint8_t y0, x0, blink;
|
||||
if (!displayCount) {
|
||||
for (int i=0; i<2; i++) {
|
||||
staticTelemetry[i] = frskyTelemetry[i].value;
|
||||
staticRSSI[i] = frskyRSSI[i].value;
|
||||
alarmRaised[i] = FRSKY_alarmRaised(i);
|
||||
}
|
||||
}
|
||||
displayCount = (displayCount+1) % 50;
|
||||
|
||||
if (view == e_telemetry+ALTERNATE_VIEW) {
|
||||
// The bars
|
||||
uint8_t bars_height = 5;
|
||||
for (int8_t i=3; i>=0; i--) {
|
||||
if (g_model.frsky.bars[i].source && (63-g_model.frsky.bars[i].barMax) > g_model.frsky.bars[i].barMin) {
|
||||
lcd_putsnAtt(0, bars_height+bars_height+1+i*(bars_height+6), STR_VTELEMBARS+LEN_VTELEMBARS*g_model.frsky.bars[i].source, LEN_VTELEMBARS, 0);
|
||||
lcd_rect(25, bars_height+6+i*(bars_height+6), 101, bars_height+2);
|
||||
int16_t value = getValue(CHOUT_BASE+NUM_CHNOUT+MAX_TIMERS+g_model.frsky.bars[i].source-1);
|
||||
uint8_t threshold = 0, thresholdX = 0;
|
||||
if (g_model.frsky.bars[i].source <= 2)
|
||||
threshold = g_model.frsky.channels[g_model.frsky.bars[i].source-1].alarms_value[0];
|
||||
else
|
||||
threshold = barsThresholds[g_model.frsky.bars[i].source-3];
|
||||
if (threshold) {
|
||||
thresholdX = (uint8_t)(int16_t)((int16_t)100 * (threshold - g_model.frsky.bars[i].barMin * 4) / ((63 - g_model.frsky.bars[i].barMax) * 4 - g_model.frsky.bars[i].barMin * 4));
|
||||
if (thresholdX > 100)
|
||||
thresholdX = 0;
|
||||
}
|
||||
uint8_t width = (uint8_t)limit((int16_t)0, (int16_t)((int16_t)100 * (value - g_model.frsky.bars[i].barMin * 4) / ((63 - g_model.frsky.bars[i].barMax) * 4 - g_model.frsky.bars[i].barMin * 4)), (int16_t)100);
|
||||
lcd_filled_rect(26, bars_height+6+1+i*(bars_height+6), width, bars_height, (threshold > value) ? DOTTED : SOLID);
|
||||
for (uint8_t j=50; j<125; j+=25)
|
||||
if (j>thresholdX) lcd_vline(j, bars_height+6+1+i*(bars_height+6), bars_height);
|
||||
if (thresholdX) {
|
||||
lcd_vlineStip(26+thresholdX, bars_height+4+i*(bars_height+6), bars_height+3, DOTTED);
|
||||
lcd_hline(25+thresholdX, bars_height+4+i*(bars_height+6), 3);
|
||||
}
|
||||
}
|
||||
else {
|
||||
bars_height += 2;
|
||||
}
|
||||
}
|
||||
|
||||
displayRssiLine();
|
||||
}
|
||||
else if (view == e_telemetry+2*ALTERNATE_VIEW) {
|
||||
// Big A1 / A2 with min and max
|
||||
if (g_model.frsky.channels[0].ratio || g_model.frsky.channels[1].ratio) {
|
||||
x0 = 0;
|
||||
for (int i=0; i<2; i++) {
|
||||
for (uint8_t i=0; i<2; i++) {
|
||||
if (g_model.frsky.channels[i].ratio) {
|
||||
blink = (alarmRaised[i] ? INVERS : 0);
|
||||
lcd_puts_P(x0, 3*FH, PSTR("A :"));
|
||||
lcd_putc(x0+FW, 3*FH, '1'+i);
|
||||
blink = (FRSKY_alarmRaised(i) ? INVERS : 0);
|
||||
displayA1A2(x0, 2*FH, i);
|
||||
x0 += 3*FW;
|
||||
putsTelemetryChannel(x0, 2*FH, i, staticTelemetry[i], blink|DBLSIZE|LEFT);
|
||||
putsTelemetryChannel(x0+FW, 4*FH, i, frskyTelemetry[i].min, 0);
|
||||
putsTelemetryChannel(x0+3*FW, 4*FH, i, frskyTelemetry[i].max, LEFT);
|
||||
putsTelemetryChannel(x0, 2*FH, i, frskyTelemetry[i].value, blink|DBLSIZE|LEFT);
|
||||
putsTelemetryChannel(x0+FW, 3*FH, i, frskyTelemetry[i].min, 0);
|
||||
putsTelemetryChannel(x0+3*FW, 3*FH, i, frskyTelemetry[i].max, LEFT);
|
||||
x0 = 11*FW-2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Display RX Batt Volts only if a valid channel (A1/A2) has been selected
|
||||
if (g_eeFrsky.rxVoltsChannel >0)
|
||||
// Cells voltage
|
||||
lcd_putsLeft( 5*FH-3, PSTR("V1=\004V2=\004V3=")) ;
|
||||
lcd_putsLeft( 6*FH-3, PSTR("V4=\004V5=\004V6="));
|
||||
{
|
||||
y+=FH; lcd_puts_P(2*FW, y, STR_RXBATT);
|
||||
// Rx batt voltage bar frame
|
||||
|
||||
// Minimum voltage
|
||||
lcd_vline(3, 58, 6); // marker
|
||||
|
||||
y = 6*FH;
|
||||
putsVolts(1, y, g_eeFrsky.rxVoltsBarMin, LEFT);
|
||||
uint8_t middleVolts = g_eeFrsky.rxVoltsBarMin+(g_eeFrsky.rxVoltsBarMax - g_eeFrsky.rxVoltsBarMin)/2;
|
||||
putsVolts(64-FW, y, middleVolts, LEFT);
|
||||
lcd_vline(64, 58, 6); // marker
|
||||
putsVolts(128-FW, y, g_eeFrsky.rxVoltsBarMax, 0);
|
||||
lcd_vline(125, 58, 6); // marker
|
||||
|
||||
// Rx Batt: volts (255 == g_eefrsky.rxVoltsMax)
|
||||
uint16_t centaVolts = (voltsVal > 0) ? (10 * (uint16_t)g_eeFrsky.rxVoltsMax * (uint32_t)(voltsVal) / 255) + g_eeFrsky.rxVoltsOfs : 0;
|
||||
lcd_outdezAtt(13*FW, 4*FH, centaVolts, 0|PREC2);
|
||||
lcd_putc(13*FW, 4*FH, 'v');
|
||||
|
||||
// draw the actual voltage bar
|
||||
uint16_t centaVoltsMin = 10 * g_eeFrsky.rxVoltsBarMin;
|
||||
if (centaVolts >= centaVoltsMin)
|
||||
{
|
||||
uint8_t vbarLen = (centaVolts - (10 * (uint16_t)g_eeFrsky.rxVoltsBarMin)) * 12
|
||||
/ (g_eeFrsky.rxVoltsBarMax - g_eeFrsky.rxVoltsBarMin);
|
||||
for (uint8_t i = 59; i < 63; i++) // Bar 4 pixels thick (high)
|
||||
lcd_hline(4, i, (vbarLen > 120) ? 120 : vbarLen);
|
||||
uint8_t x, y;
|
||||
x = 6*FW;
|
||||
y = 6*FH-3;
|
||||
for (uint8_t k=0; k<frskyHubData.cellsCount && k<6; k++) {
|
||||
uint8_t attr = (barsThresholds[6/*TODO constant*/] && frskyHubData.cellVolts[k] < barsThresholds[6/*TODO constant*/]) ? BLINK|PREC2 : PREC2;
|
||||
if (k == 3) {
|
||||
x = 6*FW;
|
||||
y = 7*FH-3;
|
||||
}
|
||||
lcd_outdezNAtt(x, y, frskyHubData.cellVolts[k] * 2, attr, 4);
|
||||
x += 7*FW;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
lcd_puts_P(0, 6*FH, STR_RX);
|
||||
lcd_outdezAtt(3 * FW, 5*FH+2, staticRSSI[0], DBLSIZE|LEFT);
|
||||
lcd_outdezAtt(4 * FW, 7*FH, frskyRSSI[0].min, 0);
|
||||
lcd_outdezAtt(6 * FW, 7*FH, frskyRSSI[0].max, LEFT);
|
||||
lcd_puts_P(11 * FW - 2, 6*FH, STR_TX);
|
||||
lcd_outdezAtt(14 * FW - 2, 5*FH+2, staticRSSI[1], DBLSIZE|LEFT);
|
||||
lcd_outdezAtt(15 * FW - 2, 7*FH, frskyRSSI[1].min, 0);
|
||||
lcd_outdezAtt(17 * FW - 2, 7*FH, frskyRSSI[1].max, LEFT);
|
||||
displayRssiLine();
|
||||
}
|
||||
|
||||
#ifdef WS_HOW_HIGH
|
||||
else if (g_model.frsky.usrProto == PROTO_WS_HOW_HIGH && view == e_telemetry+2*ALTERNATE_VIEW) {
|
||||
else if (g_model.frsky.usrProto == PROTO_WS_HOW_HIGH && view == e_telemetry+3*ALTERNATE_VIEW) {
|
||||
displayAltitudeLine(0, 4*FH, DBLSIZE);
|
||||
lcd_puts_P(1*FW, 7*FH, STR_RX);
|
||||
lcd_outdezAtt(4*FW, 7*FH, staticRSSI[0], LEFT);
|
||||
lcd_puts_P(11*FW, 7*FH, STR_TX);
|
||||
lcd_outdezAtt(14*FW, 7*FH, staticRSSI[1], LEFT);
|
||||
lcd_filled_rect(0, 7*FH, DISPLAY_W, 8);
|
||||
displayRssiLine();
|
||||
}
|
||||
#endif
|
||||
#ifdef FRSKY_HUB
|
||||
else if (g_model.frsky.usrProto == PROTO_FRSKY_HUB && view == e_telemetry+3*ALTERNATE_VIEW) {
|
||||
#define DATE_LINE (7*FH)
|
||||
//lcd_puts_P(0, DATE_LINE, PSTR("D/T:"));
|
||||
else if (g_model.frsky.usrProto == PROTO_FRSKY_HUB && view == e_telemetry+4*ALTERNATE_VIEW) {
|
||||
#define DATE_LINE (7*FH+1)
|
||||
//lcd_putsLeft( DATE_LINE, PSTR("D/T:"));
|
||||
// Date
|
||||
lcd_outdezNAtt(3*FW, DATE_LINE, frskyHubData.year+2000, LEFT, 4);
|
||||
lcd_putc(7*FW-4, DATE_LINE, '-');
|
||||
|
@ -450,11 +463,11 @@ void menuMainView(uint8_t event)
|
|||
lcd_outdezNAtt(15*FW+2, DATE_LINE, frskyHubData.min, LEFT|LEADING0, 2);
|
||||
lcd_putc(17*FW-1, DATE_LINE, ':');
|
||||
lcd_outdezNAtt(18*FW-1, DATE_LINE, frskyHubData.sec, LEFT|LEADING0, 2);
|
||||
lcd_filled_rect(0, DATE_LINE, DISPLAY_W, 8);
|
||||
lcd_filled_rect(0, DATE_LINE-1, DISPLAY_W, 8);
|
||||
|
||||
// Latitude
|
||||
#define LAT_LINE (2*FH)
|
||||
lcd_puts_P(0, LAT_LINE, PSTR("Lat:"));
|
||||
#define LAT_LINE (2*FH-4)
|
||||
lcd_putsLeft( LAT_LINE, PSTR("Lat:"));
|
||||
lcd_outdezAtt(lcd_lastPos, LAT_LINE, frskyHubData.gpsLatitude_bp / 100, LEFT); // ddd before '.'
|
||||
lcd_putc(lcd_lastPos, LAT_LINE, '@');
|
||||
uint8_t mn = frskyHubData.gpsLatitude_bp % 100;
|
||||
|
@ -464,8 +477,8 @@ void menuMainView(uint8_t event)
|
|||
lcd_putc(lcd_lastPos+1, LAT_LINE, frskyHubData.gpsLatitudeNS ? frskyHubData.gpsLatitudeNS : '-');
|
||||
|
||||
// Longitude
|
||||
#define LONG_LINE (3*FH)
|
||||
lcd_puts_P(0, LONG_LINE, PSTR("Lon:"));
|
||||
#define LONG_LINE (3*FH-3)
|
||||
lcd_putsLeft(LONG_LINE, PSTR("Lon:"));
|
||||
lcd_outdezAtt(lcd_lastPos, LONG_LINE, frskyHubData.gpsLongitude_bp / 100, LEFT); // ddd before '.'
|
||||
lcd_putc(lcd_lastPos, LONG_LINE, '@');
|
||||
mn = frskyHubData.gpsLongitude_bp % 100;
|
||||
|
@ -476,7 +489,7 @@ void menuMainView(uint8_t event)
|
|||
|
||||
#if 0
|
||||
// Course / Heading
|
||||
lcd_puts_P(5, 5*FH, STR_HDG);
|
||||
lcd_puts(5, 5*FH, STR_HDG);
|
||||
lcd_outdezNAtt(lcd_lastPos, 5*FH, frskyHubData.gpsCourse_bp, LEFT|LEADING0, 3); // before '.'
|
||||
lcd_plot(lcd_lastPos, 6*FH-2, 0); // small decimal point
|
||||
lcd_outdezAtt(lcd_lastPos+2, 5*FH, frskyHubData.gpsCourse_ap, LEFT); // after '.'
|
||||
|
@ -485,81 +498,68 @@ void menuMainView(uint8_t event)
|
|||
|
||||
// Speed
|
||||
#define SPEED_LINE (6*FH)
|
||||
lcd_puts_P(0, SPEED_LINE, STR_SPD);
|
||||
putsTelemetryValue(lcd_lastPos, SPEED_LINE, frskyHubData.gpsSpeed_bp, UNIT_KTS, LEFT|DBLSIZE); // before '.'
|
||||
lcd_putsLeft( SPEED_LINE, STR_SPDnMAX);
|
||||
putsTelemetryValue(4*FW, SPEED_LINE, frskyHubData.gpsSpeed_bp, UNIT_KTS, LEFT|DBLSIZE); // before '.'
|
||||
// lcd_putcAtt(lcd_lastPos-2, 5*FH, '.', DBLSIZE); // small decimal point
|
||||
// lcd_outdezAtt(lcd_lastPos+FW, 5*FH, frskyHubData.gpsSpeed_ap, LEFT|UNSIGN|DBLSIZE); // after '.'
|
||||
lcd_puts_P(10*FW, SPEED_LINE, PSTR("Max:"));
|
||||
putsTelemetryValue(lcd_lastPos, SPEED_LINE, maxGpsSpeed, UNIT_KTS, LEFT); // before '.'
|
||||
putsTelemetryValue(17*FW, SPEED_LINE, frskyHubData.maxGpsSpeed, UNIT_KTS, LEFT); // before '.'
|
||||
|
||||
// Altitude
|
||||
#define ALTITUDE_LINE (4*FH)
|
||||
lcd_puts_P(0, ALTITUDE_LINE, STR_ALT);
|
||||
putsTelemetryValue(lcd_lastPos, ALTITUDE_LINE, frskyHubData.gpsAltitude_bp, UNIT_METERS, LEFT); // before '.'
|
||||
#define ALTITUDE_LINE (4*FH-1)
|
||||
lcd_putsLeft( ALTITUDE_LINE, STR_ALT);
|
||||
putsTelemetryValue(4*FW, ALTITUDE_LINE, frskyHubData.gpsAltitude_bp, UNIT_METERS, LEFT); // before '.'
|
||||
// lcd_plot(lcd_lastPos, 8*FH-2, 0); // small decimal point
|
||||
// lcd_outdezAtt(lcd_lastPos+2, 7*FH, frskyHubData.gpsAltitude_ap, LEFT|UNSIGN); // after '.'
|
||||
}
|
||||
else if (g_model.frsky.usrProto == PROTO_FRSKY_HUB && view == e_telemetry+2*ALTERNATE_VIEW) {
|
||||
else if (g_model.frsky.usrProto == PROTO_FRSKY_HUB && view == e_telemetry+3*ALTERNATE_VIEW) {
|
||||
// Temperature 1
|
||||
lcd_puts_P(0, 4*FH, STR_TEMP1);
|
||||
putsTelemetryValue(lcd_lastPos, 4*FH, frskyHubData.temperature1, UNIT_DEGREES, DBLSIZE|LEFT);
|
||||
lcd_putsLeft( 4*FH, STR_TEMP1nTEMP2);
|
||||
putsTelemetryValue(4*FW, 4*FH, frskyHubData.temperature1, UNIT_DEGREES, DBLSIZE|LEFT);
|
||||
|
||||
// Temperature 2
|
||||
lcd_puts_P(11*FW, 4*FH, STR_TEMP2);
|
||||
putsTelemetryValue(lcd_lastPos, 4*FH, frskyHubData.temperature2, UNIT_DEGREES, DBLSIZE|LEFT);
|
||||
putsTelemetryValue(15*FW, 4*FH, frskyHubData.temperature2, UNIT_DEGREES, DBLSIZE|LEFT);
|
||||
|
||||
// RPM
|
||||
lcd_puts_P(0, 2*FH, STR_RPM);
|
||||
lcd_outdezNAtt(lcd_lastPos, 1*FH, frskyHubData.rpm, DBLSIZE|LEFT);
|
||||
lcd_putsLeft(2*FH, STR_RPMnFUEL);
|
||||
lcd_outdezNAtt(4*FW, 1*FH, frskyHubData.rpm, DBLSIZE|LEFT);
|
||||
|
||||
// Fuel
|
||||
lcd_puts_P(10*FW, 2*FH, STR_FUEL);
|
||||
lcd_outdezNAtt(lcd_lastPos, 1*FH, frskyHubData.fuelLevel, DBLSIZE|LEFT); // TODO putsTelemetry + UNIT_PERCENT
|
||||
lcd_putc(lcd_lastPos, 2*FH, '%');
|
||||
|
||||
#if 0
|
||||
// Volts
|
||||
lcd_puts_P(10*FW, 7*FH, STR_VOLTS);
|
||||
lcd_outdezNAtt(lcd_lastPos, 6*FH, frskyHubData.volts, DBLSIZE|LEFT); // TODO putsTelemetry?
|
||||
lcd_putc(lcd_lastPos, 7*FH, 'V');
|
||||
#endif
|
||||
putsTelemetryValue(15*FW, 2*FH, frskyHubData.fuelLevel, UNIT_PERCENT, DBLSIZE|LEFT);
|
||||
|
||||
// Altitude (barometric)
|
||||
displayAltitudeLine(0, 6*FH, DBLSIZE);
|
||||
|
||||
// Accelerometer
|
||||
lcd_puts_P(0, 7*FH, STR_ACCEL);
|
||||
// lcd_puts_P(4*FW, 7*FH, PSTR("x:"));
|
||||
lcd_outdezNAtt(4*FW, 7*FH, (int32_t)frskyHubData.accelX * 100 / 256, LEFT|PREC2);
|
||||
#define ACC_LINE (7*FH+1)
|
||||
lcd_putsLeft(ACC_LINE, STR_ACCEL);
|
||||
// lcd_puts(4*FW, 7*FH, PSTR("x:"));
|
||||
lcd_outdezNAtt(4*FW, ACC_LINE, (int32_t)frskyHubData.accelX * 100 / 256, LEFT|PREC2);
|
||||
// lcd_putc(lcd_lastPos, 7*FH, 'g');
|
||||
// lcd_puts_P(11*FW, 7*FH, PSTR("y:"));
|
||||
lcd_outdezNAtt(10*FW, 7*FH, (int32_t)frskyHubData.accelY * 100 / 256, LEFT|PREC2);
|
||||
// lcd_puts(11*FW, 7*FH, PSTR("y:"));
|
||||
lcd_outdezNAtt(10*FW, ACC_LINE, (int32_t)frskyHubData.accelY * 100 / 256, LEFT|PREC2);
|
||||
// lcd_putc(lcd_lastPos, 7*FH, 'g');
|
||||
// lcd_puts_P(18*FW, 7*FH, PSTR("z:"));
|
||||
lcd_outdezNAtt(16*FW, 7*FH, (int32_t)frskyHubData.accelZ * 100 / 256, LEFT|PREC2);
|
||||
// lcd_puts(18*FW, 7*FH, PSTR("z:"));
|
||||
lcd_outdezNAtt(16*FW, ACC_LINE, (int32_t)frskyHubData.accelZ * 100 / 256, LEFT|PREC2);
|
||||
// lcd_putc(lcd_lastPos, 7*FH, 'g');
|
||||
lcd_filled_rect(0, DATE_LINE, DISPLAY_W, 8);
|
||||
lcd_filled_rect(0, ACC_LINE-1, DISPLAY_W, 8);
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
y0 = 5*FH;
|
||||
//lcd_puts_P(2*FW-3, y0, STR_TELE);
|
||||
x0 = 4*FW-3;
|
||||
x0 = 2*FW-3;
|
||||
for (int i=0; i<2; i++) {
|
||||
if (g_model.frsky.channels[i].ratio) {
|
||||
blink = (alarmRaised[i] ? INVERS+BLINK : 0)|LEFT;
|
||||
lcd_puts_P(x0, y0, PSTR("A :"));
|
||||
lcd_putc(x0+FW, y0, '1'+i);
|
||||
putsTelemetryChannel(x0+3*FW, y0, i, staticTelemetry[i], blink);
|
||||
x0 = 13*FW-3;
|
||||
blink = (FRSKY_alarmRaised(i) ? INVERS+BLINK : 0)|LEFT;
|
||||
displayA1A2(x0, y0, i);
|
||||
putsTelemetryChannel(x0+3*FW, y0, i, frskyTelemetry[i].value, blink);
|
||||
x0 = 12*FW-3;
|
||||
}
|
||||
}
|
||||
y0+=FH;
|
||||
//lcd_puts_P(2*FW-3, y0, STR_RSSI);
|
||||
lcd_puts_P(4*FW-3, y0, STR_RX);
|
||||
lcd_outdezAtt(7*FW-3, y0, staticRSSI[0], LEFT);
|
||||
lcd_puts_P(13*FW-3, y0, STR_TX);
|
||||
lcd_outdezAtt(16*FW-3, y0, staticRSSI[1], LEFT);
|
||||
lcd_puts(2*FW-3, y0, STR_RX);
|
||||
lcd_outdezAtt(5*FW-3, y0, frskyRSSI[0].value, LEFT);
|
||||
lcd_puts(12*FW-3, y0, STR_TX);
|
||||
lcd_outdezAtt(15*FW-3, y0, frskyRSSI[1].value, LEFT);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue