[all] Telemetry display bug fixes
[X9D] Some more work on screens
This commit is contained in:
+6
-2
@@ -189,8 +189,12 @@ void menuMainView(uint8_t event)
|
|||||||
// Flight Phase Name
|
// Flight Phase Name
|
||||||
uint8_t phase = s_perout_flight_phase;
|
uint8_t phase = s_perout_flight_phase;
|
||||||
#if defined(PCBX9D)
|
#if defined(PCBX9D)
|
||||||
lcd_putsnAtt(21*FW-1, 5, g_model.phaseData[phase].name, sizeof(g_model.phaseData[phase].name), ZCHAR);
|
uint8_t len = ZLEN(g_model.phaseData[phase].name);
|
||||||
lcd_rect(21*FW-3, 5-2, lcdLastPos-20*FW, FH+3);
|
if (len > 0) {
|
||||||
|
uint8_t tmp = (DISPLAY_W - 6*FW - 2 - len*FW/2);
|
||||||
|
lcd_putsnAtt(tmp, 5, g_model.phaseData[phase].name, sizeof(g_model.phaseData[phase].name), ZCHAR);
|
||||||
|
lcd_rect(tmp-2, 5-2, 3+FW*len, FH+3);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
lcd_putsnAtt(6*FW, 2*FH, g_model.phaseData[phase].name, sizeof(g_model.phaseData[phase].name), ZCHAR);
|
lcd_putsnAtt(6*FW, 2*FH, g_model.phaseData[phase].name, sizeof(g_model.phaseData[phase].name), ZCHAR);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+5
-1
@@ -3176,12 +3176,16 @@ void menuModelTelemetry(uint8_t event)
|
|||||||
switch (m_posHorz) {
|
switch (m_posHorz) {
|
||||||
case 0:
|
case 0:
|
||||||
bar.source = checkIncDecModel(event, barSource, 0, g_model.frsky.usrProto ? TELEM_DISPLAY_MAX : TELEM_NOUSR_MAX);
|
bar.source = checkIncDecModel(event, barSource, 0, g_model.frsky.usrProto ? TELEM_DISPLAY_MAX : TELEM_NOUSR_MAX);
|
||||||
|
if (checkIncDec_Ret) {
|
||||||
|
bar.barMin = 0;
|
||||||
|
bar.barMax = 255-maxTelemValue(bar.source);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
bar.barMin = checkIncDec(event, bar.barMin, 0, 254-bar.barMax, EE_MODEL|NO_INCDEC_MARKS);
|
bar.barMin = checkIncDec(event, bar.barMin, 0, 254-bar.barMax, EE_MODEL|NO_INCDEC_MARKS);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
bar.barMax = 255 - checkIncDec(event, 255-bar.barMax, bar.barMin+1, 255, EE_MODEL|NO_INCDEC_MARKS);
|
bar.barMax = 255 - checkIncDec(event, 255-bar.barMax, bar.barMin+1, maxTelemValue(barSource), EE_MODEL|NO_INCDEC_MARKS);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,6 +158,18 @@ char idx2char(int8_t idx)
|
|||||||
return ' ';
|
return ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(PCBX9D)
|
||||||
|
uint8_t zlen(const char *str, uint8_t size)
|
||||||
|
{
|
||||||
|
while (size > 0) {
|
||||||
|
if (str[size-1] != 0)
|
||||||
|
return size;
|
||||||
|
size--;
|
||||||
|
}
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
PhaseData *phaseaddress(uint8_t idx)
|
PhaseData *phaseaddress(uint8_t idx)
|
||||||
{
|
{
|
||||||
return &g_model.phaseData[idx];
|
return &g_model.phaseData[idx];
|
||||||
|
|||||||
+7
-2
@@ -1267,5 +1267,10 @@ void checkFlashOnBeep();
|
|||||||
void putsTelemetryValue(uint8_t x, uint8_t y, int16_t val, uint8_t unit, uint8_t att);
|
void putsTelemetryValue(uint8_t x, uint8_t y, int16_t val, uint8_t unit, uint8_t att);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // gruvin9x_h
|
#if defined(PCBX9D)
|
||||||
/*eof*/
|
uint8_t zlen(const char *str, uint8_t size);
|
||||||
|
#define ZLEN(s) zlen(s, sizeof(s))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user