Merge branch 'next' into kilrah/antennaselection
# Conflicts: # radio/src/translations/de.h.txt # radio/src/translations/es.h.txt # radio/src/translations/it.h.txt # radio/src/translations/pt.h.txt # radio/src/translations/se.h.txt
This commit is contained in:
@@ -609,7 +609,7 @@ void putsTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
|
||||
|
||||
#if defined(CPUARM)
|
||||
char separator = ':';
|
||||
if (tme >= 3600 && (~att & DBLSIZE)) {
|
||||
if (tme >= 3600) {
|
||||
qr = div(qr.quot, 60);
|
||||
separator = CHR_HOUR;
|
||||
}
|
||||
@@ -617,6 +617,10 @@ void putsTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
|
||||
#define separator ':'
|
||||
#endif
|
||||
lcdDrawNumber(x, y, qr.quot, att|LEADING0|LEFT, 2);
|
||||
#if defined(CPUARM)
|
||||
if (separator == CHR_HOUR)
|
||||
att &= ~DBLSIZE;
|
||||
#endif
|
||||
#if defined(CPUARM) && defined(RTCLOCK)
|
||||
if (att&TIMEBLINK)
|
||||
lcdDrawChar(lcdLastPos, y, separator, BLINK);
|
||||
|
||||
@@ -196,7 +196,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
||||
#endif
|
||||
#if defined(CPUARM)
|
||||
else if (func == FUNC_SET_TIMER) {
|
||||
val_max = 59*60+59;
|
||||
val_max = 539*60+59;
|
||||
putsTimer(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT, attr);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
#include "opentx.h"
|
||||
|
||||
#if defined(CPUARM)
|
||||
uint8_t g_moduleIdx;
|
||||
@@ -205,13 +205,14 @@ void menuModelSetup(uint8_t event)
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, qr.quot, 59);
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, qr.quot, 539); // 8:59
|
||||
timer->start = qr.rem + qr.quot*60;
|
||||
break;
|
||||
case 2:
|
||||
qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2;
|
||||
timer->start -= qr.rem ;
|
||||
if ((int16_t)timer->start < 0) timer->start=0;
|
||||
if ((int16_t)timer->start > 5999) timer->start=32399; // 8:59:59
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -284,7 +285,10 @@ void menuModelSetup(uint8_t event)
|
||||
break;
|
||||
case 2:
|
||||
qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2;
|
||||
timer->start -= qr.rem ;
|
||||
if (timer->start >= qr.rem) {
|
||||
timer->start -= qr.rem ;
|
||||
}
|
||||
if ((int32_t)timer->start > 3599) timer->start=3599; // 59:59
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -609,7 +609,7 @@ void menuModelTelemetry(uint8_t event)
|
||||
case ITEM_TELEMETRY_A2_LABEL:
|
||||
lcd_putsLeft(y, STR_ACHANNEL);
|
||||
lcdDrawNumber(2*FW, y, ch+1, 0);
|
||||
putsTelemetryChannelValue(TELEM_COL2+6*FW, y, dest, frskyData.analog[ch].value, LEFT);
|
||||
putsTelemetryChannelValue(TELEM_COL2+6*FW, y, dest, telemetryData.analog[ch].value, LEFT);
|
||||
break;
|
||||
|
||||
case ITEM_TELEMETRY_A1_RANGE:
|
||||
@@ -739,7 +739,7 @@ void menuModelTelemetry(uint8_t event)
|
||||
case ITEM_TELEMETRY_FAS_OFFSET:
|
||||
lcd_putsLeft(y, STR_FAS_OFFSET);
|
||||
lcdDrawNumber(TELEM_COL2, y, g_model.frsky.fasOffset, attr|LEFT|PREC1);
|
||||
lcdDrawNumber(TELEM_COL2+6*FW, y, frskyData.hub.current, LEFT|PREC1);
|
||||
lcdDrawNumber(TELEM_COL2+6*FW, y, telemetryData.hub.current, LEFT|PREC1);
|
||||
lcdDrawChar(TELEM_COL2+8*FW, y, 'A');
|
||||
if (attr) g_model.frsky.fasOffset = checkIncDec(event, g_model.frsky.fasOffset, -120, 120, EE_MODEL);
|
||||
break;
|
||||
|
||||
@@ -38,7 +38,7 @@ void displayRssiLine()
|
||||
lcdDrawSolidHorizontalLine(0, 55, 128, 0); // separator
|
||||
uint8_t rssi;
|
||||
#if !defined(CPUARM)
|
||||
rssi = min((uint8_t)99, frskyData.rssi[1].value);
|
||||
rssi = min((uint8_t)99, telemetryData.rssi[1].value);
|
||||
lcd_putsLeft(STATUS_BAR_Y, STR_TX); lcdDrawNumber(4*FW+1, STATUS_BAR_Y, rssi, LEADING0, 2);
|
||||
lcdDrawRect(BAR_LEFT+1, 57, 38, 7);
|
||||
lcdDrawFilledRect(BAR_LEFT+1, 58, 4*rssi/11, 5, (rssi < getRssiAlarmValue(0)) ? DOTTED : SOLID);
|
||||
@@ -59,17 +59,17 @@ void displayRssiLine()
|
||||
void displayGpsTime()
|
||||
{
|
||||
uint8_t att = (TELEMETRY_STREAMING() ? LEFT|LEADING0 : LEFT|LEADING0|BLINK);
|
||||
lcdDrawNumber(CENTER_OFS+6*FW+7, STATUS_BAR_Y, frskyData.hub.hour, att, 2);
|
||||
lcdDrawNumber(CENTER_OFS+6*FW+7, STATUS_BAR_Y, telemetryData.hub.hour, att, 2);
|
||||
lcdDrawChar(CENTER_OFS+8*FW+4, STATUS_BAR_Y, ':', att);
|
||||
lcdDrawNumber(CENTER_OFS+9*FW+2, STATUS_BAR_Y, frskyData.hub.min, att, 2);
|
||||
lcdDrawNumber(CENTER_OFS+9*FW+2, STATUS_BAR_Y, telemetryData.hub.min, att, 2);
|
||||
lcdDrawChar(CENTER_OFS+11*FW-1, STATUS_BAR_Y, ':', att);
|
||||
lcdDrawNumber(CENTER_OFS+12*FW-3, STATUS_BAR_Y, frskyData.hub.sec, att, 2);
|
||||
lcdDrawNumber(CENTER_OFS+12*FW-3, STATUS_BAR_Y, telemetryData.hub.sec, att, 2);
|
||||
lcdInvertLastLine();
|
||||
}
|
||||
|
||||
void displayGpsCoord(uint8_t y, char direction, int16_t bp, int16_t ap)
|
||||
{
|
||||
if (frskyData.hub.gpsFix >= 0) {
|
||||
if (telemetryData.hub.gpsFix >= 0) {
|
||||
if (!direction) direction = '-';
|
||||
lcdDrawNumber(TELEM_2ND_COLUMN, y, bp / 100, LEFT); // ddd before '.'
|
||||
lcdDrawChar(lcdLastPos, y, '@');
|
||||
@@ -107,9 +107,9 @@ void displayVoltageScreenLine(uint8_t y, uint8_t index)
|
||||
{
|
||||
drawStringWithIndex(0, y, STR_A, index+1, 0);
|
||||
if (TELEMETRY_STREAMING()) {
|
||||
putsTelemetryChannelValue(3*FW+6*FW+4, y-FH, index+TELEM_A1-1, frskyData.analog[index].value, DBLSIZE);
|
||||
lcdDrawChar(12*FW-1, y-FH, '<'); putsTelemetryChannelValue(17*FW, y-FH, index+TELEM_A1-1, frskyData.analog[index].min, NO_UNIT);
|
||||
lcdDrawChar(12*FW, y, '>'); putsTelemetryChannelValue(17*FW, y, index+TELEM_A1-1, frskyData.analog[index].max, NO_UNIT);
|
||||
putsTelemetryChannelValue(3*FW+6*FW+4, y-FH, index+TELEM_A1-1, telemetryData.analog[index].value, DBLSIZE);
|
||||
lcdDrawChar(12*FW-1, y-FH, '<'); putsTelemetryChannelValue(17*FW, y-FH, index+TELEM_A1-1, telemetryData.analog[index].min, NO_UNIT);
|
||||
lcdDrawChar(12*FW, y, '>'); putsTelemetryChannelValue(17*FW, y, index+TELEM_A1-1, telemetryData.analog[index].max, NO_UNIT);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -142,10 +142,10 @@ void displayVoltagesScreen()
|
||||
break;
|
||||
#if defined(FRSKY_HUB)
|
||||
case FRSKY_VOLTS_SOURCE_FAS:
|
||||
putsTelemetryChannelValue(3*FW+6*FW+4, FH, TELEM_VFAS-1, frskyData.hub.vfas, DBLSIZE);
|
||||
putsTelemetryChannelValue(3*FW+6*FW+4, FH, TELEM_VFAS-1, telemetryData.hub.vfas, DBLSIZE);
|
||||
break;
|
||||
case FRSKY_VOLTS_SOURCE_CELLS:
|
||||
putsTelemetryChannelValue(3*FW+6*FW+4, FH, TELEM_CELLS_SUM-1, frskyData.hub.cellsSum, DBLSIZE);
|
||||
putsTelemetryChannelValue(3*FW+6*FW+4, FH, TELEM_CELLS_SUM-1, telemetryData.hub.cellsSum, DBLSIZE);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
@@ -159,13 +159,13 @@ void displayVoltagesScreen()
|
||||
break;
|
||||
#if defined(FRSKY_HUB)
|
||||
case FRSKY_CURRENT_SOURCE_FAS:
|
||||
putsTelemetryChannelValue(3*FW+6*FW+4, 3*FH, TELEM_CURRENT-1, frskyData.hub.current, DBLSIZE);
|
||||
putsTelemetryChannelValue(3*FW+6*FW+4, 3*FH, TELEM_CURRENT-1, telemetryData.hub.current, DBLSIZE);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
putsTelemetryChannelValue(4, 5*FH, TELEM_POWER-1, frskyData.hub.power, LEFT|DBLSIZE);
|
||||
putsTelemetryChannelValue(3*FW+4+4*FW+6*FW+FW, 5*FH, TELEM_CONSUMPTION-1, frskyData.hub.currentConsumption, DBLSIZE);
|
||||
putsTelemetryChannelValue(4, 5*FH, TELEM_POWER-1, telemetryData.hub.power, LEFT|DBLSIZE);
|
||||
putsTelemetryChannelValue(3*FW+4+4*FW+6*FW+FW, 5*FH, TELEM_CONSUMPTION-1, telemetryData.hub.currentConsumption, DBLSIZE);
|
||||
}
|
||||
else {
|
||||
displayVoltageScreenLine(analog > 0 ? 5*FH : 4*FH, analog ? 2-analog : 0);
|
||||
@@ -174,11 +174,11 @@ void displayVoltagesScreen()
|
||||
|
||||
#if defined(FRSKY_HUB)
|
||||
// Cells voltage
|
||||
if (frskyData.hub.cellsCount > 0) {
|
||||
if (telemetryData.hub.cellsCount > 0) {
|
||||
uint8_t y = 1*FH;
|
||||
for (uint8_t k=0; k<frskyData.hub.cellsCount && k<6; k++) {
|
||||
for (uint8_t k=0; k<telemetryData.hub.cellsCount && k<6; k++) {
|
||||
#if defined(GAUGES)
|
||||
uint8_t attr = (barsThresholds[THLD_CELL] && frskyData.hub.cellVolts[k] < barsThresholds[THLD_CELL]) ? BLINK|PREC2 : PREC2;
|
||||
uint8_t attr = (barsThresholds[THLD_CELL] && telemetryData.hub.cellVolts[k] < barsThresholds[THLD_CELL]) ? BLINK|PREC2 : PREC2;
|
||||
#else
|
||||
uint8_t attr = PREC2;
|
||||
#endif
|
||||
@@ -198,20 +198,20 @@ void displayAfterFlightScreen()
|
||||
if (IS_GPS_AVAILABLE()) {
|
||||
// Latitude
|
||||
lcd_putsLeft(line, STR_LATITUDE);
|
||||
displayGpsCoord(line, frskyData.hub.gpsLatitudeNS, frskyData.hub.gpsLatitude_bp, frskyData.hub.gpsLatitude_ap);
|
||||
displayGpsCoord(line, telemetryData.hub.gpsLatitudeNS, telemetryData.hub.gpsLatitude_bp, telemetryData.hub.gpsLatitude_ap);
|
||||
// Longitude
|
||||
line+=1*FH+1;
|
||||
lcd_putsLeft(line, STR_LONGITUDE);
|
||||
displayGpsCoord(line, frskyData.hub.gpsLongitudeEW, frskyData.hub.gpsLongitude_bp, frskyData.hub.gpsLongitude_ap);
|
||||
displayGpsCoord(line, telemetryData.hub.gpsLongitudeEW, telemetryData.hub.gpsLongitude_bp, telemetryData.hub.gpsLongitude_ap);
|
||||
displayGpsTime();
|
||||
line+=1*FH+1;
|
||||
}
|
||||
// Rssi
|
||||
lcd_putsLeft(line, STR_MINRSSI);
|
||||
lcdDrawText(TELEM_2ND_COLUMN, line, STR_TX);
|
||||
lcdDrawNumber(TELEM_2ND_COLUMN+3*FW, line, frskyData.rssi[1].min, LEFT|LEADING0, 2);
|
||||
lcdDrawNumber(TELEM_2ND_COLUMN+3*FW, line, telemetryData.rssi[1].min, LEFT|LEADING0, 2);
|
||||
lcdDrawText(TELEM_2ND_COLUMN+6*FW, line, STR_RX);
|
||||
lcdDrawNumber(TELEM_2ND_COLUMN+9*FW, line, frskyData.rssi[0].min, LEFT|LEADING0, 2);
|
||||
lcdDrawNumber(TELEM_2ND_COLUMN+9*FW, line, telemetryData.rssi[0].min, LEFT|LEADING0, 2);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -372,9 +372,9 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
|
||||
#if defined(FRSKY_HUB)
|
||||
if (field == TELEM_ACC) {
|
||||
lcd_putsLeft(STATUS_BAR_Y, STR_ACCEL);
|
||||
lcdDrawNumber(4*FW, STATUS_BAR_Y, frskyData.hub.accelX, LEFT|PREC2);
|
||||
lcdDrawNumber(10*FW, STATUS_BAR_Y, frskyData.hub.accelY, LEFT|PREC2);
|
||||
lcdDrawNumber(16*FW, STATUS_BAR_Y, frskyData.hub.accelZ, LEFT|PREC2);
|
||||
lcdDrawNumber(4*FW, STATUS_BAR_Y, telemetryData.hub.accelX, LEFT|PREC2);
|
||||
lcdDrawNumber(10*FW, STATUS_BAR_Y, telemetryData.hub.accelY, LEFT|PREC2);
|
||||
lcdDrawNumber(16*FW, STATUS_BAR_Y, telemetryData.hub.accelZ, LEFT|PREC2);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -457,11 +457,21 @@ bool isSourceAvailableInResetSpecialFunction(int index)
|
||||
|
||||
bool isModuleAvailable(int module)
|
||||
{
|
||||
#if defined(CROSSFIRE)
|
||||
if (module == MODULE_TYPE_CROSSFIRE && g_model.moduleData[INTERNAL_MODULE].rfProtocol != RF_PROTO_OFF) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isRfProtocolAvailable(int protocol)
|
||||
{
|
||||
#if defined(CROSSFIRE)
|
||||
if (protocol != RF_PROTO_OFF && g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_CROSSFIRE) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
#if defined(MODULE_D16_EU_ONLY_SUPPORT)
|
||||
if (protocol == RF_PROTO_D8) {
|
||||
return false;
|
||||
|
||||
@@ -256,7 +256,7 @@ void BitmapBuffer::drawFontPattern(coord_t x, coord_t y, const uint8_t * font, c
|
||||
lcdNextPos = x + width;
|
||||
}
|
||||
|
||||
void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdFlags flags)
|
||||
void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const char * s, uint8_t len, LcdFlags flags)
|
||||
{
|
||||
int width = getTextWidth(s, len, flags);
|
||||
int height = getFontHeight(flags);
|
||||
@@ -279,12 +279,6 @@ void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const pm_char * s, uint8_
|
||||
drawSolidFilledRect(x-INVERT_HORZ_MARGIN, y, width+2*INVERT_HORZ_MARGIN, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
|
||||
}
|
||||
|
||||
char str[256];
|
||||
if (flags & ZCHAR)
|
||||
strcat_zchar(str, s, len);
|
||||
else
|
||||
strAppend(str, s, len);
|
||||
|
||||
const coord_t orig_x = x;
|
||||
bool setx = false;
|
||||
while (len--) {
|
||||
|
||||
@@ -52,6 +52,34 @@ const uint8_t LBM_TOPMENU_USB[] = {
|
||||
#include "mask_topmenu_usb.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TOPMENU_VOLUME_0[] = {
|
||||
#include "mask_volume_0.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TOPMENU_VOLUME_1[] = {
|
||||
#include "mask_volume_1.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TOPMENU_VOLUME_2[] = {
|
||||
#include "mask_volume_2.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TOPMENU_VOLUME_3[] = {
|
||||
#include "mask_volume_3.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TOPMENU_VOLUME_4[] = {
|
||||
#include "mask_volume_4.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TOPMENU_VOLUME_SCALE[] = {
|
||||
#include "mask_volume_scale.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TOPMENU_TXBATT[] = {
|
||||
#include "mask_txbat.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_HTRIM_FRAME[] = {
|
||||
#include "mask_htrim_frame.lbm"
|
||||
};
|
||||
|
||||
@@ -30,6 +30,13 @@ extern const uint8_t LBM_CURRENT_DOT[];
|
||||
|
||||
// Main view icons
|
||||
extern const uint8_t LBM_TOPMENU_USB[];
|
||||
extern const uint8_t LBM_TOPMENU_VOLUME_0[];
|
||||
extern const uint8_t LBM_TOPMENU_VOLUME_1[];
|
||||
extern const uint8_t LBM_TOPMENU_VOLUME_2[];
|
||||
extern const uint8_t LBM_TOPMENU_VOLUME_3[];
|
||||
extern const uint8_t LBM_TOPMENU_VOLUME_4[];
|
||||
extern const uint8_t LBM_TOPMENU_VOLUME_SCALE[];
|
||||
extern const uint8_t LBM_TOPMENU_TXBATT[];
|
||||
extern const uint8_t LBM_HTRIM_FRAME[];
|
||||
extern const uint8_t LBM_VTRIM_FRAME[];
|
||||
extern const uint8_t LBM_TRIM_SHADOW[];
|
||||
|
||||
@@ -18,55 +18,63 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
#include "opentx.h"
|
||||
|
||||
const uint16_t font_tinsize_specs[] PROGMEM =
|
||||
uint16_t font_tinsize_specs[] = {
|
||||
#include "font_tinsize.specs"
|
||||
;
|
||||
};
|
||||
|
||||
const pm_uchar font_tinsize[] PROGMEM = {
|
||||
pm_uchar font_tinsize[] = {
|
||||
#include "font_tinsize.lbm"
|
||||
};
|
||||
|
||||
const uint16_t font_smlsize_specs[] PROGMEM =
|
||||
uint16_t font_smlsize_specs[] = {
|
||||
#include "font_smlsize.specs"
|
||||
;
|
||||
};
|
||||
|
||||
const pm_uchar font_smlsize[] PROGMEM = {
|
||||
pm_uchar font_smlsize[] = {
|
||||
#include "font_smlsize.lbm"
|
||||
};
|
||||
|
||||
const uint16_t font_stdsize_specs[] PROGMEM =
|
||||
uint16_t font_stdsize_specs[] = {
|
||||
#include "font_stdsize.specs"
|
||||
;
|
||||
};
|
||||
|
||||
const pm_uchar font_stdsize[] PROGMEM = {
|
||||
pm_uchar font_stdsize[] = {
|
||||
#include "font_stdsize.lbm"
|
||||
};
|
||||
|
||||
const uint16_t font_midsize_specs[] PROGMEM =
|
||||
uint16_t font_midsize_specs[] = {
|
||||
#include "font_midsize.specs"
|
||||
;
|
||||
};
|
||||
|
||||
const pm_uchar font_midsize[] PROGMEM = {
|
||||
pm_uchar font_midsize[] = {
|
||||
#include "font_midsize.lbm"
|
||||
};
|
||||
|
||||
const uint16_t font_dblsize_specs[] PROGMEM =
|
||||
uint16_t font_dblsize_specs[] = {
|
||||
#include "font_dblsize.specs"
|
||||
;
|
||||
};
|
||||
|
||||
const pm_uchar font_dblsize[] PROGMEM = {
|
||||
pm_uchar font_dblsize[] = {
|
||||
#include "font_dblsize.lbm"
|
||||
};
|
||||
|
||||
const uint16_t font_xxlsize_specs[] PROGMEM =
|
||||
uint16_t font_xxlsize_specs[] = {
|
||||
#include "font_xxlsize.specs"
|
||||
;
|
||||
};
|
||||
|
||||
const pm_uchar font_xxlsize[] PROGMEM = {
|
||||
pm_uchar font_xxlsize[] = {
|
||||
#include "font_xxlsize.lbm"
|
||||
};
|
||||
|
||||
const uint16_t * const fontspecsTable[16] = { font_stdsize_specs, font_tinsize_specs, font_smlsize_specs, font_midsize_specs, font_dblsize_specs, font_xxlsize_specs };
|
||||
const pm_uchar * const fontsTable[16] = { font_stdsize, font_tinsize, font_smlsize, font_midsize, font_dblsize, font_xxlsize };
|
||||
uint16_t font_stdsizebold_specs[] = {
|
||||
#include "font_stdsizebold.specs"
|
||||
};
|
||||
|
||||
pm_uchar font_stdsizebold[] = {
|
||||
#include "font_stdsizebold.lbm"
|
||||
};
|
||||
|
||||
const uint16_t * const fontspecsTable[16] = { font_stdsize_specs, font_tinsize_specs, font_smlsize_specs, font_midsize_specs, font_dblsize_specs, font_xxlsize_specs, font_stdsizebold_specs };
|
||||
const uint8_t * const fontsTable[16] = { font_stdsize, font_tinsize, font_smlsize, font_midsize, font_dblsize, font_xxlsize, font_stdsizebold };
|
||||
|
||||
@@ -51,10 +51,10 @@
|
||||
#define CURVE_COORD_WIDTH 36
|
||||
#define CURVE_COORD_HEIGHT 17
|
||||
|
||||
#define DATETIME_SEPARATOR_X (LCD_W-55)
|
||||
#define DATETIME_SEPARATOR_X (LCD_W-53)
|
||||
#define DATETIME_LINE1 9
|
||||
#define DATETIME_LINE2 23
|
||||
#define DATETIME_MIDDLE (LCD_W+DATETIME_SEPARATOR_X+8)/2
|
||||
#define DATETIME_MIDDLE (LCD_W+DATETIME_SEPARATOR_X+6)/2
|
||||
|
||||
#define MENU_TITLE_NEXT_POS (lcdNextPos + 10)
|
||||
#define MENU_INIT_VPOS -1
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#define lcdint_t int32_t
|
||||
|
||||
#define BSS 0x00
|
||||
#define BOLD 0x00
|
||||
|
||||
/* lcd common flags */
|
||||
#define BLINK 0x01
|
||||
@@ -69,6 +68,7 @@
|
||||
#define MIDSIZE 0x0300
|
||||
#define DBLSIZE 0x0400
|
||||
#define XXLSIZE 0x0500
|
||||
#define BOLD 0x0600
|
||||
#define VERTICAL 0x0800
|
||||
|
||||
#define TIMEBLINK 0x1000
|
||||
|
||||
@@ -124,14 +124,14 @@ bool menuCommonCalib(evt_t event)
|
||||
// START CALIBRATION
|
||||
if (!READ_ONLY()) {
|
||||
lcdDrawText(50, 3, STR_MENUCALIBRATION, MENU_TITLE_COLOR);
|
||||
lcdDrawText(50, 3+FH, "Press [Enter] to start", MENU_TITLE_COLOR);
|
||||
lcdDrawText(50, 3+FH, STR_MENUTOSTART, MENU_TITLE_COLOR);
|
||||
}
|
||||
break;
|
||||
|
||||
case CALIB_SET_MIDPOINT:
|
||||
// SET MIDPOINT
|
||||
lcdDrawText(50, 3, STR_MENUCALIBRATION, MENU_TITLE_COLOR);
|
||||
lcdDrawText(50, 3+FH, "Please center sticks and press [Enter]", MENU_TITLE_COLOR);
|
||||
lcdDrawText(50, 3+FH, STR_SETMIDPOINT, MENU_TITLE_COLOR);
|
||||
for (int i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||
reusableBuffer.calib.loVals[i] = 15000;
|
||||
reusableBuffer.calib.hiVals[i] = -15000;
|
||||
@@ -146,7 +146,7 @@ bool menuCommonCalib(evt_t event)
|
||||
case CALIB_MOVE_STICKS:
|
||||
// MOVE STICKS/POTS
|
||||
lcdDrawText(50, 3, STR_MENUCALIBRATION, MENU_TITLE_COLOR);
|
||||
lcdDrawText(50, 3+FH, "Move sticks, pots and sliders and press [Enter]", MENU_TITLE_COLOR);
|
||||
lcdDrawText(50, 3+FH, STR_MOVESTICKSPOTS, MENU_TITLE_COLOR);
|
||||
for (int i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||
if (abs(reusableBuffer.calib.loVals[i]-reusableBuffer.calib.hiVals[i]) > 50) {
|
||||
g_eeGeneral.calib[i].mid = reusableBuffer.calib.midVals[i];
|
||||
|
||||
@@ -178,7 +178,7 @@ bool menuGeneralHardware(evt_t event)
|
||||
#endif
|
||||
|
||||
case ITEM_SETUP_HW_BAT_CAL:
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, "Battery cal.");
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_BATT_CALIB);
|
||||
lcdDrawNumber(HW_SETTINGS_COLUMN, y, getBatteryVoltage(), attr|LEFT|PREC2, 0, NULL, "V");
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.txVoltageCalibration, -127, 127);
|
||||
break;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
#include "opentx.h"
|
||||
|
||||
bool menuGeneralVersion(evt_t event)
|
||||
{
|
||||
|
||||
@@ -250,7 +250,7 @@ bool menuModelCurveOne(evt_t event)
|
||||
lcdDrawSolidFilledRect(point.x, CURVE_CENTER_Y-CURVE_SIDE_WIDTH, 2, 2*CURVE_SIDE_WIDTH+2, CURVE_CURSOR_COLOR);
|
||||
|
||||
char text[5];
|
||||
strAppendUnsigned(text, points[i]);
|
||||
strAppendSigned(text, points[i]);
|
||||
|
||||
if (point.x >= CURVE_CENTER_X) {
|
||||
drawCurveVerticalScale(point.x-15);
|
||||
@@ -273,7 +273,7 @@ bool menuModelCurveOne(evt_t event)
|
||||
|
||||
drawCurvePoint(point.x-3, point.y-4, CURVE_CURSOR_COLOR);
|
||||
|
||||
strAppendUnsigned(text, x);
|
||||
strAppendSigned(text, x);
|
||||
drawCurveCoord(limit(CURVE_CENTER_X-CURVE_SIDE_WIDTH-1, point.x-CURVE_COORD_WIDTH/2, CURVE_CENTER_X+CURVE_SIDE_WIDTH-CURVE_COORD_WIDTH+1), CURVE_CENTER_Y+CURVE_SIDE_WIDTH+2, text, selectionMode==1);
|
||||
|
||||
if (s_editMode > 0) {
|
||||
|
||||
@@ -127,7 +127,7 @@ bool menuModelFlightModesAll(evt_t event)
|
||||
|
||||
FlightModeData *p = flightModeAddress(k);
|
||||
|
||||
putsFlightMode(MENUS_MARGIN_LEFT, y, k+1, (getFlightMode()==k ? 0/*BOLD*/ : 0) | ((sub==k && menuHorizontalPosition<0) ? INVERS : 0));
|
||||
putsFlightMode(MENUS_MARGIN_LEFT, y, k+1, (getFlightMode()==k ? BOLD : 0) | ((sub==k && menuHorizontalPosition<0) ? INVERS : 0));
|
||||
|
||||
for (int j=0; j<ITEM_FLIGHT_MODES_COUNT; j++) {
|
||||
LcdFlags attr = ((sub==k && posHorz==j) ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
||||
|
||||
@@ -109,7 +109,7 @@ bool menuModelLogicalSwitches(evt_t event)
|
||||
|
||||
// CSW name
|
||||
unsigned int sw = SWSRC_SW1+k;
|
||||
putsSwitches(MENUS_MARGIN_LEFT, y, sw, (getSwitch(sw) ? 0/*BOLD*/ : 0) | ((sub==k && CURSOR_ON_LINE()) ? INVERS : 0));
|
||||
putsSwitches(MENUS_MARGIN_LEFT, y, sw, (getSwitch(sw) ? BOLD : 0) | ((sub==k && CURSOR_ON_LINE()) ? INVERS : 0));
|
||||
|
||||
// CSW func
|
||||
lcdDrawTextAtIndex(CSW_1ST_COLUMN, y, STR_VCSWFUNC, cs->func, horz==0 ? attr : 0);
|
||||
|
||||
@@ -162,7 +162,7 @@ enum MixFields {
|
||||
MIX_FIELD_COUNT
|
||||
};
|
||||
|
||||
void gvarWeightItem(coord_t x, coord_t y, MixData *md, uint8_t attr, evt_t event)
|
||||
void gvarWeightItem(coord_t x, coord_t y, MixData *md, LcdFlags attr, evt_t event)
|
||||
{
|
||||
u_int8int16_t weight;
|
||||
MD_WEIGHT_TO_UNION(md, weight);
|
||||
|
||||
@@ -101,11 +101,11 @@ void editTimerMode(int timerIdx, coord_t y, LcdFlags attr, evt_t event)
|
||||
{
|
||||
TimerData * timer = &g_model.timers[timerIdx];
|
||||
if (attr && menuHorizontalPosition < 0) {
|
||||
lcdDrawSolidFilledRect(MODEL_SETUP_2ND_COLUMN-INVERT_HORZ_MARGIN, y-INVERT_VERT_MARGIN+1, 90+2*INVERT_HORZ_MARGIN, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
|
||||
lcdDrawSolidFilledRect(MODEL_SETUP_2ND_COLUMN-INVERT_HORZ_MARGIN, y-INVERT_VERT_MARGIN+1, 115+2*INVERT_HORZ_MARGIN, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
|
||||
}
|
||||
drawStringWithIndex(MENUS_MARGIN_LEFT, y, STR_TIMER, timerIdx+1);
|
||||
putsTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer->mode, (menuHorizontalPosition<=0 ? attr : 0));
|
||||
putsTimer(MODEL_SETUP_2ND_COLUMN+50, y, timer->start, (menuHorizontalPosition!=0 ? attr : 0));
|
||||
putsTimer(MODEL_SETUP_2ND_COLUMN+50, y, timer->start, (menuHorizontalPosition==1 ? attr|TIMEHOUR : TIMEHOUR));
|
||||
if (attr && s_editMode>0) {
|
||||
switch (menuHorizontalPosition) {
|
||||
case 0:
|
||||
|
||||
@@ -487,18 +487,21 @@ bool menuScreenSetup(int index, evt_t event)
|
||||
currentContainer = currentScreen;
|
||||
bool needsOffsetCheck = (menuVerticalPosition != 0 || menuHorizontalPosition < 0);
|
||||
|
||||
const ZoneOption * options = currentScreen->getFactory()->getOptions();
|
||||
int optionsCount = getOptionsCount(options);
|
||||
linesCount = ITEM_SCREEN_SETUP_LAYOUT_OPTION1 + optionsCount;
|
||||
|
||||
char title[] = "Main view X";
|
||||
title[sizeof(title)-2] = '1' + index;
|
||||
menuPageCount = updateMainviewsMenu();
|
||||
|
||||
uint8_t mstate_tab[2 + MAX_LAYOUT_OPTIONS] = { uint8_t(NAVIGATION_LINE_BY_LINE|uint8_t(countRegisteredLayouts-1)), ORPHAN_ROW };
|
||||
const ZoneOption * options = currentScreen->getFactory()->getOptions();
|
||||
int optionsCount = getOptionsCount(options);
|
||||
linesCount = ITEM_SCREEN_SETUP_LAYOUT_OPTION1 + optionsCount;
|
||||
if (menuPageCount > 3)
|
||||
++linesCount;
|
||||
|
||||
uint8_t mstate_tab[2 + MAX_LAYOUT_OPTIONS + 1] = { uint8_t(NAVIGATION_LINE_BY_LINE|uint8_t(countRegisteredLayouts-1)), ORPHAN_ROW };
|
||||
for (int i=0; i<optionsCount; i++) {
|
||||
mstate_tab[3+i] = getZoneOptionColumns(&options[i]);
|
||||
}
|
||||
mstate_tab[3+optionsCount] = 0; // The remove button
|
||||
|
||||
CUSTOM_MENU_WITH_OPTIONS(title, LBM_SCREENS_SETUP_ICONS, menuTabScreensSetup, menuPageCount, index+1, linesCount);
|
||||
|
||||
@@ -533,26 +536,33 @@ bool menuScreenSetup(int index, evt_t event)
|
||||
|
||||
default:
|
||||
{
|
||||
uint8_t index = k - ITEM_SCREEN_SETUP_LAYOUT_OPTION1;
|
||||
if (index < optionsCount) {
|
||||
const ZoneOption * option = &options[index];
|
||||
ZoneOptionValue * value = currentScreen->getOptionValue(index);
|
||||
uint8_t o = k - ITEM_SCREEN_SETUP_LAYOUT_OPTION1;
|
||||
if (o < optionsCount) {
|
||||
const ZoneOption * option = &options[o];
|
||||
ZoneOptionValue * value = currentScreen->getOptionValue(o);
|
||||
if (editZoneOption(y, option, value, attr, EE_MODEL, event)) {
|
||||
currentScreen->update();
|
||||
}
|
||||
}
|
||||
else if (menuPageCount > 3 && o == optionsCount) {
|
||||
drawButton(SCREENS_SETUP_2ND_COLUMN, y, STR_REMOVE_SCREEN, attr);
|
||||
if (attr && event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
delete currentScreen;
|
||||
if (index != MAX_CUSTOM_SCREENS-1) {
|
||||
memmove(&g_model.screenData[index], &g_model.screenData[index + 1], sizeof(CustomScreenData) * (MAX_CUSTOM_SCREENS - index - 1));
|
||||
memmove(&customScreens[index], &customScreens[index + 1], sizeof(Layout *) * (MAX_CUSTOM_SCREENS - index - 1));
|
||||
}
|
||||
memset(&g_model.screenData[MAX_CUSTOM_SCREENS-1], 0, sizeof(CustomScreenData));
|
||||
customScreens[MAX_CUSTOM_SCREENS-1] = NULL;
|
||||
chainMenu(menuTabScreensSetup[index > 0 ? index : 1]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (menuVerticalPosition == -1 && index > 0 && event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||
killEvents(KEY_ENTER);
|
||||
menuHorizontalPosition = index;
|
||||
POPUP_MENU_ADD_ITEM(STR_REMOVE_SCREEN);
|
||||
popupMenuHandler = onScreenSetupMenu;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -592,23 +602,10 @@ bool menuScreenAdd(evt_t event)
|
||||
if (event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
customScreens[menuPageCount-2] = registeredLayouts[0]->create(&g_model.screenData[menuPageCount-2].layoutData);
|
||||
s_editMode = 0;
|
||||
menuHorizontalPosition = -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
SIMPLE_MENU_WITH_OPTIONS("Add main view", LBM_SCREENS_SETUP_ICONS, menuTabScreensSetup, menuPageCount, menuPageCount-1, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
void onScreenSetupMenu(const char * result)
|
||||
{
|
||||
if (result == STR_REMOVE_SCREEN) {
|
||||
delete customScreens[menuHorizontalPosition];
|
||||
if (menuHorizontalPosition != MAX_CUSTOM_SCREENS-1) {
|
||||
memmove(&g_model.screenData[menuHorizontalPosition], &g_model.screenData[menuHorizontalPosition + 1], sizeof(CustomScreenData) * (MAX_CUSTOM_SCREENS - menuHorizontalPosition - 1));
|
||||
memmove(&customScreens[menuHorizontalPosition], &customScreens[menuHorizontalPosition + 1], sizeof(Layout *) * (MAX_CUSTOM_SCREENS - menuHorizontalPosition - 1));
|
||||
}
|
||||
memset(&g_model.screenData[MAX_CUSTOM_SCREENS-1], 0, sizeof(CustomScreenData));
|
||||
customScreens[MAX_CUSTOM_SCREENS-1] = NULL;
|
||||
// chainMenu(menuMainviews[menuHorizontalPosition > 0 ? menuHorizontalPosition-1 : 0]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ unsigned int Topbar::getZonesCount() const
|
||||
Zone Topbar::getZone(unsigned int index) const
|
||||
{
|
||||
Zone zone;
|
||||
zone.x = 50 + (TOPBAR_ZONE_WIDTH + 2*TOPBAR_ZONE_MARGIN) * index;
|
||||
zone.x = 49 + (TOPBAR_ZONE_WIDTH + 2*TOPBAR_ZONE_MARGIN) * index;
|
||||
zone.y = TOPBAR_ZONE_MARGIN;
|
||||
zone.w = TOPBAR_ZONE_WIDTH;
|
||||
zone.h = MENU_HEADER_HEIGHT - 2*TOPBAR_ZONE_MARGIN;
|
||||
@@ -57,7 +57,7 @@ void drawTopBar()
|
||||
|
||||
// USB icon
|
||||
if (usbPlugged()) {
|
||||
lcdDrawBitmapPattern(LCD_W-102, 8, LBM_TOPMENU_USB, MENU_TITLE_COLOR);
|
||||
lcdDrawBitmapPattern(LCD_W-98, 8, LBM_TOPMENU_USB, MENU_TITLE_COLOR);
|
||||
}
|
||||
|
||||
// RSSI
|
||||
@@ -68,6 +68,26 @@ void drawTopBar()
|
||||
lcdDrawSolidFilledRect(LCD_W-90 + i * 6, 38 - height, 4, height, TELEMETRY_RSSI() >= rssiBarsValue[i] ? MENU_TITLE_COLOR : MENU_TITLE_DISABLE_COLOR);
|
||||
}
|
||||
|
||||
/* Audio volume */
|
||||
lcdDrawBitmapPattern(LCD_W-130, 4, LBM_TOPMENU_VOLUME_SCALE, MENU_TITLE_DISABLE_COLOR);
|
||||
if (requiredSpeakerVolume == 0 || g_eeGeneral.beepMode == e_mode_quiet)
|
||||
lcdDrawBitmapPattern(LCD_W-130, 4, LBM_TOPMENU_VOLUME_0, MENU_TITLE_COLOR);
|
||||
else if (requiredSpeakerVolume < 7)
|
||||
lcdDrawBitmapPattern(LCD_W-130, 4, LBM_TOPMENU_VOLUME_1, MENU_TITLE_COLOR);
|
||||
else if (requiredSpeakerVolume < 13)
|
||||
lcdDrawBitmapPattern(LCD_W-130, 4, LBM_TOPMENU_VOLUME_2, MENU_TITLE_COLOR);
|
||||
else if (requiredSpeakerVolume < 19)
|
||||
lcdDrawBitmapPattern(LCD_W-130, 4, LBM_TOPMENU_VOLUME_3, MENU_TITLE_COLOR);
|
||||
else
|
||||
lcdDrawBitmapPattern(LCD_W-130, 4, LBM_TOPMENU_VOLUME_4, MENU_TITLE_COLOR);
|
||||
|
||||
/* Tx battery */
|
||||
uint8_t bars = limit<int8_t>(0, 6 * (g_vbat100mV - g_eeGeneral.vBatMin - 90) / (30 + g_eeGeneral.vBatMax - g_eeGeneral.vBatMin), 5);
|
||||
lcdDrawBitmapPattern(LCD_W-130, 24, LBM_TOPMENU_TXBATT, MENU_TITLE_COLOR);
|
||||
for (unsigned int i = 0; i < 5; i++) {
|
||||
lcdDrawSolidFilledRect(LCD_W-122+4*i, 30, 2, 8, i >= bars ? MENU_TITLE_DISABLE_COLOR : MENU_TITLE_COLOR);
|
||||
}
|
||||
|
||||
topbar->refresh();
|
||||
|
||||
#if 0
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#define MAX_TOPBAR_ZONES 5
|
||||
#define MAX_TOPBAR_OPTIONS 0
|
||||
#define TOPBAR_ZONE_WIDTH 60
|
||||
#define TOPBAR_ZONE_WIDTH 70
|
||||
#define TOPBAR_ZONE_MARGIN 3
|
||||
|
||||
class Topbar: public WidgetsContainer<MAX_TOPBAR_ZONES, MAX_TOPBAR_OPTIONS>
|
||||
|
||||
@@ -137,10 +137,6 @@ bool menuMainView(evt_t event)
|
||||
killEvents(KEY_DOWN);
|
||||
break;
|
||||
|
||||
case EVT_ENTRY_UP:
|
||||
LOAD_MODEL_BITMAP();
|
||||
break;
|
||||
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
killEvents(event);
|
||||
POPUP_MENU_ADD_ITEM(STR_MODEL_SELECT);
|
||||
@@ -157,17 +153,17 @@ bool menuMainView(evt_t event)
|
||||
case EVT_KEY_LONG(KEY_MODEL):
|
||||
killEvents(event);
|
||||
pushMenu(menuTabModel[0]);
|
||||
break;
|
||||
return false;
|
||||
|
||||
case EVT_KEY_LONG(KEY_RADIO):
|
||||
killEvents(event);
|
||||
pushMenu(menuTabGeneral[0]);
|
||||
break;
|
||||
return false;
|
||||
|
||||
case EVT_KEY_LONG(KEY_TELEM):
|
||||
killEvents(event);
|
||||
pushMenu(menuTabScreensSetup[1]);
|
||||
break;
|
||||
return false;
|
||||
|
||||
case EVT_KEY_BREAK(KEY_PGDN):
|
||||
storageDirty(EE_GENERAL);
|
||||
|
||||
@@ -45,8 +45,13 @@ void TimerWidget::refresh()
|
||||
TimerState & timerState = timersStates[index];
|
||||
|
||||
if (zone.w >= 180 && zone.h >= 70) {
|
||||
lcdDrawBitmapPattern(zone.x, zone.y, LBM_TIMER_BACKGROUND, MAINVIEW_PANES_COLOR);
|
||||
if (timerData.start) {
|
||||
if (timerState.val >= 0 || !(timerState.val % 2)) {
|
||||
lcdDrawBitmapPattern(zone.x, zone.y, LBM_TIMER_BACKGROUND, MAINVIEW_PANES_COLOR);
|
||||
}
|
||||
else {
|
||||
lcdDrawBitmapPattern(zone.x, zone.y, LBM_TIMER_BACKGROUND, HEADER_BGCOLOR);
|
||||
}
|
||||
if (timerData.start && timerState.val >= 0) {
|
||||
lcdDrawBitmapPatternPie(
|
||||
zone.x + 2,
|
||||
zone.y + 3, LBM_RSCALE, MAINVIEW_GRAPHICS_COLOR, 0,
|
||||
@@ -67,21 +72,24 @@ void TimerWidget::refresh()
|
||||
drawStringWithIndex(zone.x + 137, zone.y + 17, "TMR", index + 1, SMLSIZE | TEXT_COLOR);
|
||||
}
|
||||
else {
|
||||
drawStringWithIndex(zone.x, zone.y, "TMR", index + 1, SMLSIZE | TEXT_INVERTED_COLOR);
|
||||
if (timerState.val < 0 && timerState.val % 2) {
|
||||
lcdDrawSolidFilledRect(zone.x, zone.y, zone.w, zone.h, HEADER_ICON_BGCOLOR);
|
||||
}
|
||||
drawStringWithIndex(zone.x + 2, zone.y, "TMR", index + 1, SMLSIZE | TEXT_INVERTED_COLOR);
|
||||
if (zone.w > 100 && zone.h > 40) {
|
||||
if (abs(timerState.val) >= 3600) {
|
||||
putsTimer(zone.x, zone.y + 16, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT | TIMEHOUR);
|
||||
putsTimer(zone.x + 3, zone.y + 16, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT | TIMEHOUR);
|
||||
}
|
||||
else {
|
||||
putsTimer(zone.x, zone.y + 16, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT | MIDSIZE);
|
||||
putsTimer(zone.x + 3, zone.y + 16, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT | MIDSIZE);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (abs(timerState.val) >= 3600) {
|
||||
putsTimer(zone.x, zone.y + 14, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT | SMLSIZE | TIMEHOUR);
|
||||
putsTimer(zone.x + 3, zone.y + 14, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT | SMLSIZE | TIMEHOUR);
|
||||
}
|
||||
else {
|
||||
putsTimer(zone.x, zone.y + 14, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT);
|
||||
putsTimer(zone.x + 3, zone.y + 14, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,8 +267,8 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, "\004Int.Ext.", CFN_PARAM(cfn), attr);
|
||||
}
|
||||
else if (func == FUNC_SET_TIMER) {
|
||||
val_max = 59*60+59;
|
||||
putsTimer(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT, attr);
|
||||
val_max = 539*60+59; //8:59:59
|
||||
putsTimer(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT|TIMEHOUR, attr);
|
||||
}
|
||||
else if (func == FUNC_PLAY_SOUND) {
|
||||
val_max = AU_SPECIAL_SOUND_LAST-AU_SPECIAL_SOUND_FIRST-1;
|
||||
|
||||
@@ -122,9 +122,8 @@ void editTimerMode(int timerIdx, coord_t y, LcdFlags attr, uint8_t event)
|
||||
TimerData * timer = &g_model.timers[timerIdx];
|
||||
drawStringWithIndex(0*FW, y, STR_TIMER, timerIdx+1);
|
||||
putsTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer->mode, menuHorizontalPosition==0 ? attr : 0);
|
||||
|
||||
putsTimer(MODEL_SETUP_2ND_COLUMN+5*FW-2+5*FWNUM+1, y, timer->start, menuHorizontalPosition==1 ? attr : 0, menuHorizontalPosition==2 ? attr : 0);
|
||||
if (attr && menuHorizontalPosition < 0) lcdDrawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, LCD_W-MODEL_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH+1, FH+1);
|
||||
putsTimer(MODEL_SETUP_2ND_COLUMN+5*FW-2+5*FWNUM+1, y, timer->start, menuHorizontalPosition==1 ? attr|TIMEHOUR : TIMEHOUR, menuHorizontalPosition==2 ? attr|TIMEHOUR : TIMEHOUR);
|
||||
if (attr && menuHorizontalPosition < 0) lcdDrawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, 11*FW, FH+1);
|
||||
if (attr && s_editMode>0) {
|
||||
div_t qr = div(timer->start, 60);
|
||||
switch (menuHorizontalPosition) {
|
||||
@@ -148,13 +147,14 @@ void editTimerMode(int timerIdx, coord_t y, LcdFlags attr, uint8_t event)
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, qr.quot, 59);
|
||||
qr.quot = checkIncDec(event, qr.quot, 0, 1439, EE_MODEL | NO_INCDEC_MARKS); // 23h59
|
||||
timer->start = qr.rem + qr.quot*60;
|
||||
break;
|
||||
case 2:
|
||||
qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2;
|
||||
timer->start -= qr.rem ;
|
||||
if ((int16_t)timer->start < 0) timer->start=0;
|
||||
if ((int32_t)timer->start > 86399) timer->start=86399; // 23h59:59
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
#include "opentx.h"
|
||||
|
||||
enum menuModelTelemetryItems {
|
||||
ITEM_TELEMETRY_PROTOCOL_TYPE,
|
||||
|
||||
@@ -275,9 +275,11 @@ void displayTopBar()
|
||||
/* Audio volume */
|
||||
if (requiredSpeakerVolume == 0 || g_eeGeneral.beepMode == e_mode_quiet)
|
||||
LCD_ICON(BAR_VOLUME_X, BAR_Y, ICON_SPEAKER0);
|
||||
else if (requiredSpeakerVolume < 10)
|
||||
else if (requiredSpeakerVolume <= 6)
|
||||
LCD_ICON(BAR_VOLUME_X, BAR_Y, ICON_SPEAKER1);
|
||||
else if (requiredSpeakerVolume < 20)
|
||||
else if (requiredSpeakerVolume <= 12)
|
||||
LCD_ICON(BAR_VOLUME_X, BAR_Y, ICON_SPEAKER2);
|
||||
else if (requiredSpeakerVolume <= 18)
|
||||
LCD_ICON(BAR_VOLUME_X, BAR_Y, ICON_SPEAKER2);
|
||||
else
|
||||
LCD_ICON(BAR_VOLUME_X, BAR_Y, ICON_SPEAKER3);
|
||||
|
||||
Reference in New Issue
Block a user