mirror of
https://github.com/opentx/opentx.git
synced 2025-07-26 01:35:21 +03:00
LCD refactoring - saves 6 bytes on 9x stock
This commit is contained in:
parent
749afc103e
commit
4d84ba4c19
19 changed files with 349 additions and 334 deletions
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
#include "opentx.h"
|
#include "opentx.h"
|
||||||
|
|
||||||
const pm_char * bmpLoad(uint8_t *bmp, const char *filename, const xcoord_t width, const uint8_t height)
|
const pm_char * bmpLoad(uint8_t *bmp, const char *filename, const unsigned int width, const unsigned int height)
|
||||||
{
|
{
|
||||||
FIL bmpFile;
|
FIL bmpFile;
|
||||||
UINT read;
|
UINT read;
|
||||||
|
|
|
@ -108,7 +108,7 @@ const MenuFuncP_PROGMEM menuTabDiag[] PROGMEM = {
|
||||||
#else
|
#else
|
||||||
#define RADIO_SETUP_2ND_COLUMN (LCD_W-6*FW-1-MENUS_SCROLLBAR_WIDTH)
|
#define RADIO_SETUP_2ND_COLUMN (LCD_W-6*FW-1-MENUS_SCROLLBAR_WIDTH)
|
||||||
#define RADIO_SETUP_TIME_COLUMN (FW*15+9)
|
#define RADIO_SETUP_TIME_COLUMN (FW*15+9)
|
||||||
#define RADIO_SETUP_DATE_COLUMN (FW*15+5)
|
#define RADIO_SETUP_DATE_COLUMN (FW*15+7)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(CPUM64)
|
#if !defined(CPUM64)
|
||||||
|
@ -220,7 +220,7 @@ void menuGeneralSetup(uint8_t event)
|
||||||
uint8_t sub = m_posVert - 1;
|
uint8_t sub = m_posVert - 1;
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
uint8_t y = 1 + 1*FH + i*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i+s_pgOfs;
|
uint8_t k = i+s_pgOfs;
|
||||||
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
||||||
uint8_t attr = (sub == k ? blink : 0);
|
uint8_t attr = (sub == k ? blink : 0);
|
||||||
|
@ -1096,7 +1096,7 @@ void menuGeneralSdManager(uint8_t _event)
|
||||||
reusableBuffer.sdmanager.offset = s_pgOfs;
|
reusableBuffer.sdmanager.offset = s_pgOfs;
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
uint8_t y = 1 + FH + i*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
||||||
lcdNextPos = 0;
|
lcdNextPos = 0;
|
||||||
uint8_t attr = (m_posVert-1-s_pgOfs == i ? BSS|INVERS : BSS);
|
uint8_t attr = (m_posVert-1-s_pgOfs == i ? BSS|INVERS : BSS);
|
||||||
if (reusableBuffer.sdmanager.lines[i][0]) {
|
if (reusableBuffer.sdmanager.lines[i][0]) {
|
||||||
|
@ -1148,9 +1148,9 @@ void menuGeneralTrainer(uint8_t event)
|
||||||
uint8_t attr;
|
uint8_t attr;
|
||||||
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
||||||
|
|
||||||
lcd_puts(3*FW, 1 + 1*FH, STR_MODESRC);
|
lcd_puts(3*FW, MENU_TITLE_HEIGHT+1, STR_MODESRC);
|
||||||
|
|
||||||
y = 1 + 2*FH;
|
y = MENU_TITLE_HEIGHT + 1 + FH;
|
||||||
|
|
||||||
for (uint8_t i=1; i<=NUM_STICKS; i++) {
|
for (uint8_t i=1; i<=NUM_STICKS; i++) {
|
||||||
uint8_t chan = channel_order(i);
|
uint8_t chan = channel_order(i);
|
||||||
|
@ -1183,19 +1183,19 @@ void menuGeneralTrainer(uint8_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
attr = (m_posVert==5) ? blink : 0;
|
attr = (m_posVert==5) ? blink : 0;
|
||||||
lcd_putsLeft(6*FH+1, STR_MULTIPLIER);
|
lcd_putsLeft(MENU_TITLE_HEIGHT+1+5*FH, STR_MULTIPLIER);
|
||||||
lcd_outdezAtt(LEN_MULTIPLIER*FW+3*FW, 6*FH+1, g_eeGeneral.PPM_Multiplier+10, attr|PREC1);
|
lcd_outdezAtt(LEN_MULTIPLIER*FW+3*FW, MENU_TITLE_HEIGHT+1+5*FH, g_eeGeneral.PPM_Multiplier+10, attr|PREC1);
|
||||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.PPM_Multiplier, -10, 40);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.PPM_Multiplier, -10, 40);
|
||||||
|
|
||||||
attr = (m_posVert==6) ? INVERS : 0;
|
attr = (m_posVert==6) ? INVERS : 0;
|
||||||
if (attr) s_editMode = 0;
|
if (attr) s_editMode = 0;
|
||||||
lcd_putsAtt(0*FW, 1+7*FH, STR_CAL, attr);
|
lcd_putsAtt(0*FW, MENU_TITLE_HEIGHT+1+6*FH, STR_CAL, attr);
|
||||||
for (uint8_t i=0; i<4; i++) {
|
for (uint8_t i=0; i<4; i++) {
|
||||||
uint8_t x = (i*TRAINER_CALIB_POS+16)*FW/2;
|
uint8_t x = (i*TRAINER_CALIB_POS+16)*FW/2;
|
||||||
#if defined (PPM_UNIT_PERCENT_PREC1)
|
#if defined (PPM_UNIT_PERCENT_PREC1)
|
||||||
lcd_outdezAtt(x, 1+7*FH, (g_ppmIns[i]-g_eeGeneral.trainer.calib[i])*2, PREC1);
|
lcd_outdezAtt(x, MENU_TITLE_HEIGHT+1+6*FH, (g_ppmIns[i]-g_eeGeneral.trainer.calib[i])*2, PREC1);
|
||||||
#else
|
#else
|
||||||
lcd_outdezAtt(x, 1+7*FH, (g_ppmIns[i]-g_eeGeneral.trainer.calib[i])/5, 0);
|
lcd_outdezAtt(x, MENU_TITLE_HEIGHT+1+6*FH, (g_ppmIns[i]-g_eeGeneral.trainer.calib[i])/5, 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1213,7 +1213,7 @@ void menuGeneralVersion(uint8_t event)
|
||||||
{
|
{
|
||||||
SIMPLE_MENU(STR_MENUVERSION, menuTabDiag, e_Vers, 1);
|
SIMPLE_MENU(STR_MENUVERSION, menuTabDiag, e_Vers, 1);
|
||||||
|
|
||||||
lcd_putsLeft(2*FH, vers_stamp);
|
lcd_putsLeft(MENU_TITLE_HEIGHT+FH, vers_stamp);
|
||||||
|
|
||||||
#if defined(COPROCESSOR)
|
#if defined(COPROCESSOR)
|
||||||
if (Coproc_valid == 1) {
|
if (Coproc_valid == 1) {
|
||||||
|
@ -1226,7 +1226,7 @@ void menuGeneralVersion(uint8_t event)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
lcd_putsLeft(7*FH, STR_EEBACKUP);
|
lcd_putsLeft(MENU_TITLE_HEIGHT+6*FH, STR_EEBACKUP);
|
||||||
if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||||
backupEeprom();
|
backupEeprom();
|
||||||
}
|
}
|
||||||
|
@ -1243,26 +1243,26 @@ void menuGeneralDiagKeys(uint8_t event)
|
||||||
{
|
{
|
||||||
SIMPLE_MENU(STR_MENUDIAG, menuTabDiag, e_Keys, 1);
|
SIMPLE_MENU(STR_MENUDIAG, menuTabDiag, e_Keys, 1);
|
||||||
|
|
||||||
lcd_puts(14*FW, 3*FH, STR_VTRIM);
|
lcd_puts(14*FW, MENU_TITLE_HEIGHT+2*FH, STR_VTRIM);
|
||||||
|
|
||||||
for(uint8_t i=0; i<9; i++) {
|
for(uint8_t i=0; i<9; i++) {
|
||||||
uint8_t y;
|
coord_t y;
|
||||||
|
|
||||||
if (i<8) {
|
if (i<8) {
|
||||||
y = i/2*FH+FH*4;
|
y = MENU_TITLE_HEIGHT + FH*3 + FH*(i/2);
|
||||||
lcd_img(14*FW, y, sticks, i/2, 0);
|
lcd_img(14*FW, y, sticks, i/2, 0);
|
||||||
displayKeyState(i&1? 20*FW : 18*FW, y, (EnumKeys)(TRM_BASE+i));
|
displayKeyState(i&1? 20*FW : 18*FW, y, (EnumKeys)(TRM_BASE+i));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i<6) {
|
if (i<6) {
|
||||||
y = (5-i)*FH+2*FH;
|
y = (5-i)*FH+MENU_TITLE_HEIGHT+FH;
|
||||||
lcd_putsiAtt(0, y, STR_VKEYS, i, 0);
|
lcd_putsiAtt(0, y, STR_VKEYS, i, 0);
|
||||||
displayKeyState(5*FW+2, y, (EnumKeys)(KEY_MENU+i));
|
displayKeyState(5*FW+2, y, (EnumKeys)(KEY_MENU+i));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(PCBTARANIS)
|
#if !defined(PCBTARANIS)
|
||||||
if (i != SW_ID0-SW_BASE) {
|
if (i != SW_ID0-SW_BASE) {
|
||||||
y = i*FH-FH;
|
y = MENU_TITLE_HEIGHT+i*FH-2*FH;
|
||||||
putsSwitches(8*FW, y, i+1, 0); //ohne off,on
|
putsSwitches(8*FW, y, i+1, 0); //ohne off,on
|
||||||
displayKeyState(11*FW+2, y, (EnumKeys)(SW_BASE+i));
|
displayKeyState(11*FW+2, y, (EnumKeys)(SW_BASE+i));
|
||||||
}
|
}
|
||||||
|
@ -1271,7 +1271,7 @@ void menuGeneralDiagKeys(uint8_t event)
|
||||||
|
|
||||||
#if defined(ROTARY_ENCODERS) || defined(ROTARY_ENCODER_NAVIGATION)
|
#if defined(ROTARY_ENCODERS) || defined(ROTARY_ENCODER_NAVIGATION)
|
||||||
for(uint8_t i=0; i<DIM(g_rotenc); i++) {
|
for(uint8_t i=0; i<DIM(g_rotenc); i++) {
|
||||||
uint8_t y = i*FH + FH;
|
coord_t y = MENU_TITLE_HEIGHT /* ??? + 1 ??? */ + i*FH;
|
||||||
lcd_putsiAtt(14*FW, y, STR_VRENCODERS, i, 0);
|
lcd_putsiAtt(14*FW, y, STR_VRENCODERS, i, 0);
|
||||||
lcd_outdezNAtt(18*FW, y, g_rotenc[i], LEFT|(switchState((EnumKeys)(BTN_REa+i)) ? INVERS : 0));
|
lcd_outdezNAtt(18*FW, y, g_rotenc[i], LEFT|(switchState((EnumKeys)(BTN_REa+i)) ? INVERS : 0));
|
||||||
}
|
}
|
||||||
|
@ -1294,7 +1294,7 @@ void menuGeneralDiagAna(uint8_t event)
|
||||||
STICK_SCROLL_DISABLE();
|
STICK_SCROLL_DISABLE();
|
||||||
|
|
||||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||||
uint8_t y = 1+FH+(i/2)*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + (i/2)*FH;
|
||||||
uint8_t x = i&1 ? 64+5 : 0;
|
uint8_t x = i&1 ? 64+5 : 0;
|
||||||
putsStrIdx(x, y, PSTR("A"), i+1);
|
putsStrIdx(x, y, PSTR("A"), i+1);
|
||||||
lcd_putc(lcdNextPos, y, ':');
|
lcd_putc(lcdNextPos, y, ':');
|
||||||
|
@ -1304,25 +1304,25 @@ void menuGeneralDiagAna(uint8_t event)
|
||||||
|
|
||||||
#if !defined(CPUARM)
|
#if !defined(CPUARM)
|
||||||
// Display raw BandGap result (debug)
|
// Display raw BandGap result (debug)
|
||||||
lcd_puts(64+5, 1+4*FH, STR_BG);
|
lcd_puts(64+5, MENU_TITLE_HEIGHT+1+3*FH, STR_BG);
|
||||||
lcd_outdezAtt(64+5+6*FW-3, 1+4*FH, BandGap, 0);
|
lcd_outdezAtt(64+5+6*FW-3, 1+4*FH, BandGap, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
lcd_putsLeft(6*FH+1, STR_BATT_CALIB);
|
lcd_putsLeft(MENU_TITLE_HEIGHT+1+5*FH, STR_BATT_CALIB);
|
||||||
static int32_t adcBatt;
|
static int32_t adcBatt;
|
||||||
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8;
|
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8;
|
||||||
uint32_t batCalV = (adcBatt + (adcBatt*g_eeGeneral.vBatCalib)/128) * BATT_SCALE;
|
uint32_t batCalV = (adcBatt + (adcBatt*g_eeGeneral.vBatCalib)/128) * BATT_SCALE;
|
||||||
batCalV >>= 11;
|
batCalV >>= 11;
|
||||||
batCalV += 2; // because of the diode
|
batCalV += 2; // because of the diode
|
||||||
putsVolts(LEN_CALIB_FIELDS*FW+4*FW, 6*FH+1, batCalV, (m_posVert==1 ? INVERS : 0));
|
putsVolts(LEN_CALIB_FIELDS*FW+4*FW, MENU_TITLE_HEIGHT+1+5*FH, batCalV, (m_posVert==1 ? INVERS : 0));
|
||||||
#elif defined(PCBSKY9X)
|
#elif defined(PCBSKY9X)
|
||||||
lcd_putsLeft(5*FH+1, STR_BATT_CALIB);
|
lcd_putsLeft(MENU_TITLE_HEIGHT+1+4*FH, STR_BATT_CALIB);
|
||||||
static int32_t adcBatt;
|
static int32_t adcBatt;
|
||||||
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8;
|
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8;
|
||||||
uint32_t batCalV = (adcBatt + adcBatt*(g_eeGeneral.vBatCalib)/128) * 4191;
|
uint32_t batCalV = (adcBatt + adcBatt*(g_eeGeneral.vBatCalib)/128) * 4191;
|
||||||
batCalV /= 55296;
|
batCalV /= 55296;
|
||||||
putsVolts(LEN_CALIB_FIELDS*FW+4*FW, 5*FH+1, batCalV, (m_posVert==1 ? INVERS : 0));
|
putsVolts(LEN_CALIB_FIELDS*FW+4*FW, MENU_TITLE_HEIGHT+1+4*FH, batCalV, (m_posVert==1 ? INVERS : 0));
|
||||||
#elif defined(PCBGRUVIN9X)
|
#elif defined(PCBGRUVIN9X)
|
||||||
lcd_putsLeft(6*FH-2, STR_BATT_CALIB);
|
lcd_putsLeft(6*FH-2, STR_BATT_CALIB);
|
||||||
// Gruvin wants 2 decimal places and instant update of volts calib field when button pressed
|
// Gruvin wants 2 decimal places and instant update of volts calib field when button pressed
|
||||||
|
@ -1367,7 +1367,7 @@ void menuGeneralHardware(uint8_t event)
|
||||||
uint8_t sub = m_posVert - 1;
|
uint8_t sub = m_posVert - 1;
|
||||||
|
|
||||||
for (uint8_t i=0; i<ITEM_SETUP_HW_MAX; i++) {
|
for (uint8_t i=0; i<ITEM_SETUP_HW_MAX; i++) {
|
||||||
uint8_t y = 1 + 1*FH + i*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
||||||
uint8_t attr = (sub == i ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
uint8_t attr = (sub == i ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
||||||
switch(i) {
|
switch(i) {
|
||||||
case ITEM_SETUP_HW_POT1:
|
case ITEM_SETUP_HW_POT1:
|
||||||
|
@ -1422,7 +1422,7 @@ void menuGeneralHardware(uint8_t event)
|
||||||
uint8_t sub = m_posVert - 1;
|
uint8_t sub = m_posVert - 1;
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
uint8_t y = 1 + 1*FH + i*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i+s_pgOfs;
|
uint8_t k = i+s_pgOfs;
|
||||||
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
||||||
uint8_t attr = (sub == k ? blink : 0);
|
uint8_t attr = (sub == k ? blink : 0);
|
||||||
|
@ -1539,14 +1539,14 @@ void menuCommonCalib(uint8_t event)
|
||||||
case 0:
|
case 0:
|
||||||
// START CALIBRATION
|
// START CALIBRATION
|
||||||
if (!READ_ONLY()) {
|
if (!READ_ONLY()) {
|
||||||
lcd_putsLeft(3*FH, STR_MENUTOSTART);
|
lcd_putsLeft(MENU_TITLE_HEIGHT+2*FH, STR_MENUTOSTART);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
// SET MIDPOINT
|
// SET MIDPOINT
|
||||||
lcd_putsAtt(0*FW, 2*FH, STR_SETMIDPOINT, INVERS);
|
lcd_putsAtt(0*FW, MENU_TITLE_HEIGHT+FH, STR_SETMIDPOINT, INVERS);
|
||||||
lcd_putsLeft(3*FH, STR_MENUWHENDONE);
|
lcd_putsLeft(MENU_TITLE_HEIGHT+2*FH, STR_MENUWHENDONE);
|
||||||
|
|
||||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||||
reusableBuffer.calib.loVals[i] = 15000;
|
reusableBuffer.calib.loVals[i] = 15000;
|
||||||
|
@ -1564,8 +1564,8 @@ void menuCommonCalib(uint8_t event)
|
||||||
case 2:
|
case 2:
|
||||||
// MOVE STICKS/POTS
|
// MOVE STICKS/POTS
|
||||||
STICK_SCROLL_DISABLE();
|
STICK_SCROLL_DISABLE();
|
||||||
lcd_putsAtt(0*FW, 2*FH, STR_MOVESTICKSPOTS, INVERS);
|
lcd_putsAtt(0*FW, MENU_TITLE_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS);
|
||||||
lcd_putsLeft(3*FH, STR_MENUWHENDONE);
|
lcd_putsLeft(MENU_TITLE_HEIGHT+2*FH, STR_MENUWHENDONE);
|
||||||
|
|
||||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||||
if (abs(reusableBuffer.calib.loVals[i]-reusableBuffer.calib.hiVals[i]) > 50) {
|
if (abs(reusableBuffer.calib.loVals[i]-reusableBuffer.calib.hiVals[i]) > 50) {
|
||||||
|
|
|
@ -591,11 +591,11 @@ void menuModelSelect(uint8_t event)
|
||||||
lcd_outdezAtt(17*FW, 0, reusableBuffer.modelsel.eepromfree, 0);
|
lcd_outdezAtt(17*FW, 0, reusableBuffer.modelsel.eepromfree, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
#if defined(PCBTARANIS)
|
||||||
displayScreenIndex(e_ModelSelect, DIM(menuTabModel), (sub == g_eeGeneral.currModel) ? ((IS_RE_NAVIGATION_ENABLE() && s_editMode < 0) ? INVERS|BLINK : INVERS) : 0);
|
|
||||||
#elif defined(PCBTARANIS)
|
|
||||||
displayScreenIndex(e_ModelSelect, DIM(menuTabModel), 0);
|
displayScreenIndex(e_ModelSelect, DIM(menuTabModel), 0);
|
||||||
lcd_filled_rect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
lcd_filled_rect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
||||||
|
#elif defined(ROTARY_ENCODER_NAVIGATION)
|
||||||
|
displayScreenIndex(e_ModelSelect, DIM(menuTabModel), (sub == g_eeGeneral.currModel) ? ((IS_RE_NAVIGATION_ENABLE() && s_editMode < 0) ? INVERS|BLINK : INVERS) : 0);
|
||||||
#else
|
#else
|
||||||
displayScreenIndex(e_ModelSelect, DIM(menuTabModel), (sub == g_eeGeneral.currModel) ? INVERS : 0);
|
displayScreenIndex(e_ModelSelect, DIM(menuTabModel), (sub == g_eeGeneral.currModel) ? INVERS : 0);
|
||||||
#endif
|
#endif
|
||||||
|
@ -603,7 +603,7 @@ void menuModelSelect(uint8_t event)
|
||||||
TITLE(STR_MENUMODELSEL);
|
TITLE(STR_MENUMODELSEL);
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
uint8_t y=(i+1)*FH+1;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i+s_pgOfs;
|
uint8_t k = i+s_pgOfs;
|
||||||
lcd_outdezNAtt(3*FW+2, y, k+1, LEADING0+((!s_copyMode && sub==k) ? INVERS : 0), 2);
|
lcd_outdezNAtt(3*FW+2, y, k+1, LEADING0+((!s_copyMode && sub==k) ? INVERS : 0), 2);
|
||||||
|
|
||||||
|
@ -702,11 +702,11 @@ void menuModelFailsafe(uint8_t event)
|
||||||
uint8_t col = 0;
|
uint8_t col = 0;
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
uint8_t x = col*COL_W+1;
|
coord_t x = col*COL_W+1;
|
||||||
|
|
||||||
// Channels
|
// Channels
|
||||||
for (uint8_t line=0; line<8; line++) {
|
for (uint8_t line=0; line<8; line++) {
|
||||||
uint8_t y = 9+line*7;
|
coord_t y = 9+line*7;
|
||||||
int32_t val;
|
int32_t val;
|
||||||
uint8_t ofs = (col ? 0 : 1);
|
uint8_t ofs = (col ? 0 : 1);
|
||||||
|
|
||||||
|
@ -754,7 +754,7 @@ void menuModelFailsafe(uint8_t event)
|
||||||
lcd_rect(x+COL_W-3-wbar-ofs, y, wbar+1, 6);
|
lcd_rect(x+COL_W-3-wbar-ofs, y, wbar+1, 6);
|
||||||
uint16_t lim = g_model.extendedLimits ? 640*2 : 512*2;
|
uint16_t lim = g_model.extendedLimits ? 640*2 : 512*2;
|
||||||
uint8_t len = limit((uint8_t)1, uint8_t((abs(val) * wbar/2 + lim/2) / lim), uint8_t(wbar/2));
|
uint8_t len = limit((uint8_t)1, uint8_t((abs(val) * wbar/2 + lim/2) / lim), uint8_t(wbar/2));
|
||||||
uint8_t x0 = (val>0) ? x+COL_W-ofs-3-wbar/2 : x+COL_W-ofs-2-wbar/2-len;
|
coord_t x0 = (val>0) ? x+COL_W-ofs-3-wbar/2 : x+COL_W-ofs-2-wbar/2-len;
|
||||||
lcd_hline(x0, y+1, len);
|
lcd_hline(x0, y+1, len);
|
||||||
lcd_hline(x0, y+2, len);
|
lcd_hline(x0, y+2, len);
|
||||||
lcd_hline(x0, y+3, len);
|
lcd_hline(x0, y+3, len);
|
||||||
|
@ -774,7 +774,7 @@ void menuModelFailsafe(uint8_t event)
|
||||||
static uint8_t editNameCursorPos = 0;
|
static uint8_t editNameCursorPos = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void editName(uint8_t x, uint8_t y, char *name, uint8_t size, uint8_t event, uint8_t active)
|
void editName(coord_t x, coord_t y, char *name, uint8_t size, uint8_t event, uint8_t active)
|
||||||
{
|
{
|
||||||
#if defined(CPUM64)
|
#if defined(CPUM64)
|
||||||
// in order to save flash
|
// in order to save flash
|
||||||
|
@ -788,6 +788,7 @@ void editName(uint8_t x, uint8_t y, char *name, uint8_t size, uint8_t event, uin
|
||||||
else
|
else
|
||||||
mode = FIXEDWIDTH;
|
mode = FIXEDWIDTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
lcd_putsnAtt(x, y, name, size, ZCHAR | mode);
|
lcd_putsnAtt(x, y, name, size, ZCHAR | mode);
|
||||||
|
|
||||||
if (active) {
|
if (active) {
|
||||||
|
@ -851,7 +852,8 @@ void editName(uint8_t x, uint8_t y, char *name, uint8_t size, uint8_t event, uin
|
||||||
name[cur] = v;
|
name[cur] = v;
|
||||||
eeDirty(EE_MODEL);
|
eeDirty(EE_MODEL);
|
||||||
}
|
}
|
||||||
lcd_putcAtt(x+editNameCursorPos*FW, y, idx2char(v), INVERS+FIXEDWIDTH);
|
|
||||||
|
lcd_putcAtt(x+editNameCursorPos*FW, y, idx2char(v), ERASEBG|INVERS|FIXEDWIDTH);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
cur = 0;
|
cur = 0;
|
||||||
|
@ -863,7 +865,7 @@ void editName(uint8_t x, uint8_t y, char *name, uint8_t size, uint8_t event, uin
|
||||||
#if defined(CPUM64)
|
#if defined(CPUM64)
|
||||||
#define editSingleName(x, y, label, name, size, event, active) editName(x, y, name, size, event, active)
|
#define editSingleName(x, y, label, name, size, event, active) editName(x, y, name, size, event, active)
|
||||||
#else
|
#else
|
||||||
void editSingleName(uint8_t x, uint8_t y, const pm_char *label, char *name, uint8_t size, uint8_t event, uint8_t active)
|
void editSingleName(coord_t x, coord_t y, const pm_char *label, char *name, uint8_t size, uint8_t event, uint8_t active)
|
||||||
{
|
{
|
||||||
lcd_putsLeft(y, label);
|
lcd_putsLeft(y, label);
|
||||||
editName(x, y, name, size, event, active);
|
editName(x, y, name, size, event, active);
|
||||||
|
@ -1055,7 +1057,7 @@ void menuModelSetup(uint8_t event)
|
||||||
int8_t editMode = s_editMode;
|
int8_t editMode = s_editMode;
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
uint8_t y = 1 + 1*FH + i*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
||||||
|
|
||||||
uint8_t k = i+s_pgOfs;
|
uint8_t k = i+s_pgOfs;
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
|
@ -1390,7 +1392,7 @@ void menuModelSetup(uint8_t event)
|
||||||
|
|
||||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, PSTR("\004""OFF\0""Man\0""Auto"), potMode, attr & ((m_posHorz == 0) ? attr : !INVERS));
|
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, PSTR("\004""OFF\0""Man\0""Auto"), potMode, attr & ((m_posHorz == 0) ? attr : !INVERS));
|
||||||
if (potMode) {
|
if (potMode) {
|
||||||
uint8_t x = MODEL_SETUP_2ND_COLUMN+5*FW;
|
coord_t x = MODEL_SETUP_2ND_COLUMN+5*FW;
|
||||||
for (uint8_t i=0; i<NUM_POTS ; i++) {
|
for (uint8_t i=0; i<NUM_POTS ; i++) {
|
||||||
#if !defined(REVPLUS)
|
#if !defined(REVPLUS)
|
||||||
if (attr && i == POT3-POT1) {
|
if (attr && i == POT3-POT1) {
|
||||||
|
@ -1418,7 +1420,7 @@ void menuModelSetup(uint8_t event)
|
||||||
lcd_putsLeft(y, STR_BEEPCTR);
|
lcd_putsLeft(y, STR_BEEPCTR);
|
||||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS; i++) {
|
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS; i++) {
|
||||||
// TODO flash saving, \001 not needed in STR_RETA123
|
// TODO flash saving, \001 not needed in STR_RETA123
|
||||||
uint8_t x = MODEL_SETUP_2ND_COLUMN+i*FW;
|
coord_t x = MODEL_SETUP_2ND_COLUMN+i*FW;
|
||||||
#if defined(PCBTARANIS) && !defined(REVPLUS)
|
#if defined(PCBTARANIS) && !defined(REVPLUS)
|
||||||
if (i == POT3) {
|
if (i == POT3) {
|
||||||
if (m_posHorz == POT3) REPEAT_LAST_CURSOR_MOVE();
|
if (m_posHorz == POT3) REPEAT_LAST_CURSOR_MOVE();
|
||||||
|
@ -1589,7 +1591,7 @@ void menuModelSetup(uint8_t event)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
horzpos_t l_posHorz = m_posHorz;
|
horzpos_t l_posHorz = m_posHorz;
|
||||||
uint8_t xOffsetBind = MODEL_SETUP_BIND_OFS;
|
coord_t xOffsetBind = MODEL_SETUP_BIND_OFS;
|
||||||
if (IS_MODULE_XJT(moduleIdx) && IS_D8_RX(moduleIdx)) {
|
if (IS_MODULE_XJT(moduleIdx) && IS_D8_RX(moduleIdx)) {
|
||||||
xOffsetBind = 0;
|
xOffsetBind = 0;
|
||||||
lcd_putsLeft(y, INDENT "Receiver");
|
lcd_putsLeft(y, INDENT "Receiver");
|
||||||
|
@ -1838,7 +1840,7 @@ static uint8_t s_currIdx;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MENU_COLUMNS > 1
|
#if MENU_COLUMNS > 1
|
||||||
uint8_t editDelay(const xcoord_t x, const uint8_t y, const uint8_t event, const uint8_t attr, const pm_char *str, uint8_t delay)
|
uint8_t editDelay(const coord_t x, const coord_t y, const uint8_t event, const uint8_t attr, const pm_char *str, uint8_t delay)
|
||||||
{
|
{
|
||||||
lcd_puts(x, y, str);
|
lcd_puts(x, y, str);
|
||||||
lcd_outdezAtt(x+MIXES_2ND_COLUMN, y, (10/DELAY_STEP)*delay, attr|PREC1|LEFT);
|
lcd_outdezAtt(x+MIXES_2ND_COLUMN, y, (10/DELAY_STEP)*delay, attr|PREC1|LEFT);
|
||||||
|
@ -1847,7 +1849,7 @@ uint8_t editDelay(const xcoord_t x, const uint8_t y, const uint8_t event, const
|
||||||
}
|
}
|
||||||
#define EDIT_DELAY(x, y, event, attr, str, delay) editDelay(x, y, event, attr, str, delay)
|
#define EDIT_DELAY(x, y, event, attr, str, delay) editDelay(x, y, event, attr, str, delay)
|
||||||
#else
|
#else
|
||||||
uint8_t editDelay(const uint8_t y, const uint8_t event, const uint8_t attr, const pm_char *str, uint8_t delay)
|
uint8_t editDelay(const coord_t y, const uint8_t event, const uint8_t attr, const pm_char *str, uint8_t delay)
|
||||||
{
|
{
|
||||||
lcd_putsLeft(y, str);
|
lcd_putsLeft(y, str);
|
||||||
lcd_outdezAtt(MIXES_2ND_COLUMN, y, (10/DELAY_STEP)*delay, attr|PREC1|LEFT);
|
lcd_outdezAtt(MIXES_2ND_COLUMN, y, (10/DELAY_STEP)*delay, attr|PREC1|LEFT);
|
||||||
|
@ -1866,7 +1868,7 @@ uint8_t editDelay(const uint8_t y, const uint8_t event, const uint8_t attr, cons
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
void displayFlightModes(uint8_t x, uint8_t y, FlightModesType value)
|
void displayFlightModes(coord_t x, coord_t y, FlightModesType value)
|
||||||
{
|
{
|
||||||
lcd_puts(x, y, STR_FP);
|
lcd_puts(x, y, STR_FP);
|
||||||
x = lcdNextPos + 1;
|
x = lcdNextPos + 1;
|
||||||
|
@ -1876,7 +1878,7 @@ void displayFlightModes(uint8_t x, uint8_t y, FlightModesType value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void displayFlightModes(uint8_t x, uint8_t y, FlightModesType value)
|
void displayFlightModes(coord_t x, coord_t y, FlightModesType value)
|
||||||
{
|
{
|
||||||
uint8_t p = MAX_FLIGHT_MODES;
|
uint8_t p = MAX_FLIGHT_MODES;
|
||||||
do {
|
do {
|
||||||
|
@ -1888,7 +1890,7 @@ void displayFlightModes(uint8_t x, uint8_t y, FlightModesType value)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
FlightModesType editFlightModes(uint8_t x, uint8_t y, uint8_t event, FlightModesType value, uint8_t attr)
|
FlightModesType editFlightModes(coord_t x, coord_t y, uint8_t event, FlightModesType value, uint8_t attr)
|
||||||
{
|
{
|
||||||
lcd_putsColumnLeft(x, y, STR_FLMODE);
|
lcd_putsColumnLeft(x, y, STR_FLMODE);
|
||||||
|
|
||||||
|
@ -1964,7 +1966,7 @@ void menuModelFlightModesAll(uint8_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
uint8_t y = 1 + (i+1)*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i+s_pgOfs;
|
uint8_t k = i+s_pgOfs;
|
||||||
|
|
||||||
if (k==MAX_FLIGHT_MODES) {
|
if (k==MAX_FLIGHT_MODES) {
|
||||||
|
@ -2092,7 +2094,7 @@ void menuModelPhaseOne(uint8_t event)
|
||||||
if (s_currIdx == 0 && sub>=ITEM_MODEL_PHASE_SWITCH) sub += ITEM_MODEL_PHASE_FADE_IN-ITEM_MODEL_PHASE_SWITCH;
|
if (s_currIdx == 0 && sub>=ITEM_MODEL_PHASE_SWITCH) sub += ITEM_MODEL_PHASE_FADE_IN-ITEM_MODEL_PHASE_SWITCH;
|
||||||
|
|
||||||
for (uint8_t k=0; k<LCD_LINES-1; k++) {
|
for (uint8_t k=0; k<LCD_LINES-1; k++) {
|
||||||
uint8_t y = 1 + (k+1)*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + k*FH;
|
||||||
int8_t i = k + s_pgOfs;
|
int8_t i = k + s_pgOfs;
|
||||||
if (s_currIdx == 0 && i>=ITEM_MODEL_PHASE_SWITCH) i += ITEM_MODEL_PHASE_FADE_IN-ITEM_MODEL_PHASE_SWITCH;
|
if (s_currIdx == 0 && i>=ITEM_MODEL_PHASE_SWITCH) i += ITEM_MODEL_PHASE_FADE_IN-ITEM_MODEL_PHASE_SWITCH;
|
||||||
uint8_t attr = (sub==i ? (editMode>0 ? BLINK|INVERS : INVERS) : 0);
|
uint8_t attr = (sub==i ? (editMode>0 ? BLINK|INVERS : INVERS) : 0);
|
||||||
|
@ -2239,10 +2241,10 @@ void menuModelFlightModesAll(uint8_t event)
|
||||||
uint8_t att;
|
uint8_t att;
|
||||||
for (uint8_t i=0; i<MAX_FLIGHT_MODES; i++) {
|
for (uint8_t i=0; i<MAX_FLIGHT_MODES; i++) {
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
int8_t y = 1 + (1+i-s_pgOfs)*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + (i-s_pgOfs)*FH;
|
||||||
if (y<1*FH+1 || y>(LCD_LINES-1)*FH+1) continue;
|
if (y<MENU_TITLE_HEIGHT+1 || y>(LCD_LINES-1)*FH+MENU_TITLE_HEIGHT-FH) continue;
|
||||||
#else
|
#else
|
||||||
uint8_t y = 1 + (i+1)*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
||||||
#endif
|
#endif
|
||||||
att = (i==sub ? INVERS : 0);
|
att = (i==sub ? INVERS : 0);
|
||||||
FlightModeData *p = flightModeAddress(i);
|
FlightModeData *p = flightModeAddress(i);
|
||||||
|
@ -2312,7 +2314,7 @@ void menuModelHeli(uint8_t event)
|
||||||
uint8_t sub = m_posVert - 1;
|
uint8_t sub = m_posVert - 1;
|
||||||
|
|
||||||
for (uint8_t i=0; i<6; i++) {
|
for (uint8_t i=0; i<6; i++) {
|
||||||
uint8_t y = 1 + 1*FH + i*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
||||||
uint8_t attr = (sub == i ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
uint8_t attr = (sub == i ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
||||||
switch(i) {
|
switch(i) {
|
||||||
case ITEM_HELI_SWASHTYPE:
|
case ITEM_HELI_SWASHTYPE:
|
||||||
|
@ -2374,7 +2376,7 @@ void DrawFunction(FnFuncP fn, uint8_t offset=0)
|
||||||
uint8_t prev_yv = 255;
|
uint8_t prev_yv = 255;
|
||||||
|
|
||||||
for (int8_t xv=-WCHART; xv<=WCHART; xv++) {
|
for (int8_t xv=-WCHART; xv<=WCHART; xv++) {
|
||||||
uint8_t yv = (LCD_H-1) - (((uint16_t)RESX + fn(xv * (RESX/WCHART))) / 2 * (LCD_H-1) / RESX);
|
coord_t yv = (LCD_H-1) - (((uint16_t)RESX + fn(xv * (RESX/WCHART))) / 2 * (LCD_H-1) / RESX);
|
||||||
if (prev_yv != 255) {
|
if (prev_yv != 255) {
|
||||||
if (abs((int8_t)yv-prev_yv) <= 1) {
|
if (abs((int8_t)yv-prev_yv) <= 1) {
|
||||||
lcd_plot(X0+xv-offset-1, prev_yv, FORCE);
|
lcd_plot(X0+xv-offset-1, prev_yv, FORCE);
|
||||||
|
@ -2396,8 +2398,8 @@ int16_t curveFn(int16_t x)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct point_t {
|
struct point_t {
|
||||||
uint8_t x;
|
coord_t x;
|
||||||
uint8_t y;
|
coord_t y;
|
||||||
};
|
};
|
||||||
|
|
||||||
point_t getPoint(uint8_t i)
|
point_t getPoint(uint8_t i)
|
||||||
|
@ -2772,7 +2774,7 @@ void menuModelCurveOne(uint8_t event)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBTARANIS) && defined(CURVES)
|
#if defined(PCBTARANIS) && defined(CURVES)
|
||||||
void editCurveRef(uint8_t x, uint8_t y, CurveRef & curve, uint8_t event, uint8_t attr)
|
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, uint8_t event, uint8_t attr)
|
||||||
{
|
{
|
||||||
lcd_putsiAtt(x, y, "\004DiffExpoFuncCstm", curve.type, m_posHorz==0 ? attr : 0);
|
lcd_putsiAtt(x, y, "\004DiffExpoFuncCstm", curve.type, m_posHorz==0 ? attr : 0);
|
||||||
if (attr && m_posHorz==0) {
|
if (attr && m_posHorz==0) {
|
||||||
|
@ -3041,7 +3043,7 @@ void menuModelExpoOne(uint8_t event)
|
||||||
|
|
||||||
int8_t sub = m_posVert;
|
int8_t sub = m_posVert;
|
||||||
|
|
||||||
uint8_t y = FH+1;
|
coord_t y = MENU_TITLE_HEIGHT + 1;
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
for (uint8_t k=0; k<LCD_LINES-1; k++) {
|
for (uint8_t k=0; k<LCD_LINES-1; k++) {
|
||||||
|
@ -3208,7 +3210,7 @@ enum MixFields {
|
||||||
MIX_FIELD_COUNT
|
MIX_FIELD_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
void gvarWeightItem(xcoord_t x, uint8_t y, MixData *md, uint8_t attr, uint8_t event)
|
void gvarWeightItem(coord_t x, coord_t y, MixData *md, uint8_t attr, uint8_t event)
|
||||||
{
|
{
|
||||||
u_int8int16_t weight;
|
u_int8int16_t weight;
|
||||||
MD_WEIGHT_TO_UNION(md, weight);
|
MD_WEIGHT_TO_UNION(md, weight);
|
||||||
|
@ -3253,7 +3255,7 @@ void menuModelMixOne(uint8_t event)
|
||||||
for (uint8_t k=0; k<MENU_COLUMNS*(LCD_LINES-1); k++) {
|
for (uint8_t k=0; k<MENU_COLUMNS*(LCD_LINES-1); k++) {
|
||||||
|
|
||||||
#if MENU_COLUMNS > 1
|
#if MENU_COLUMNS > 1
|
||||||
uint8_t y;
|
coord_t y;
|
||||||
uint8_t COLUMN_X;
|
uint8_t COLUMN_X;
|
||||||
if (k >= LCD_LINES-1) {
|
if (k >= LCD_LINES-1) {
|
||||||
y = 1 + (k-LCD_LINES+2)*FH;
|
y = 1 + (k-LCD_LINES+2)*FH;
|
||||||
|
@ -3265,7 +3267,7 @@ void menuModelMixOne(uint8_t event)
|
||||||
}
|
}
|
||||||
int8_t i = k;
|
int8_t i = k;
|
||||||
#else
|
#else
|
||||||
uint8_t y = 1 + (k+1)*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + k*FH;
|
||||||
int8_t i = k + s_pgOfs;
|
int8_t i = k + s_pgOfs;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -3494,7 +3496,7 @@ void displayHeaderChannelName(uint8_t ch)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void displayMixInfos(uint8_t y, MixData *md)
|
void displayMixInfos(coord_t y, MixData *md)
|
||||||
{
|
{
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
putsCurveRef(MIX_LINE_CURVE_POS, y, md->curve, 0);
|
putsCurveRef(MIX_LINE_CURVE_POS, y, md->curve, 0);
|
||||||
|
@ -3513,7 +3515,7 @@ void displayMixInfos(uint8_t y, MixData *md)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
void displayMixLine(uint8_t y, MixData *md)
|
void displayMixLine(coord_t y, MixData *md)
|
||||||
{
|
{
|
||||||
if (md->name[0]) {
|
if (md->name[0]) {
|
||||||
lcd_putsnAtt(EXPO_LINE_NAME_POS, y, md->name, sizeof(md->name), ZCHAR);
|
lcd_putsnAtt(EXPO_LINE_NAME_POS, y, md->name, sizeof(md->name), ZCHAR);
|
||||||
|
@ -3525,7 +3527,7 @@ void displayMixLine(uint8_t y, MixData *md)
|
||||||
displayFlightModes(MIX_LINE_FM_POS, y, md->flightModes);
|
displayFlightModes(MIX_LINE_FM_POS, y, md->flightModes);
|
||||||
}
|
}
|
||||||
#elif defined(CPUARM)
|
#elif defined(CPUARM)
|
||||||
void displayMixLine(uint8_t y, MixData *md)
|
void displayMixLine(coord_t y, MixData *md)
|
||||||
{
|
{
|
||||||
if (md->name[0]) {
|
if (md->name[0]) {
|
||||||
lcd_putsnAtt(EXPO_LINE_NAME_POS, y, md->name, sizeof(md->name), ZCHAR);
|
lcd_putsnAtt(EXPO_LINE_NAME_POS, y, md->name, sizeof(md->name), ZCHAR);
|
||||||
|
@ -3538,7 +3540,7 @@ void displayMixLine(uint8_t y, MixData *md)
|
||||||
#define displayMixLine(y, md) displayMixInfos(y, md)
|
#define displayMixLine(y, md) displayMixInfos(y, md)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void displayExpoInfos(uint8_t y, ExpoData *ed)
|
void displayExpoInfos(coord_t y, ExpoData *ed)
|
||||||
{
|
{
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
putsCurveRef(EXPO_LINE_CURVE_POS, y, ed->curve, 0);
|
putsCurveRef(EXPO_LINE_CURVE_POS, y, ed->curve, 0);
|
||||||
|
@ -3553,7 +3555,7 @@ void displayExpoInfos(uint8_t y, ExpoData *ed)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
void displayExpoLine(uint8_t y, ExpoData *ed)
|
void displayExpoLine(coord_t y, ExpoData *ed)
|
||||||
{
|
{
|
||||||
putsMixerSource(EXPO_LINE_SRC_POS, y, ed->srcRaw, 0);
|
putsMixerSource(EXPO_LINE_SRC_POS, y, ed->srcRaw, 0);
|
||||||
|
|
||||||
|
@ -3571,7 +3573,7 @@ void displayExpoLine(uint8_t y, ExpoData *ed)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#elif defined(CPUARM)
|
#elif defined(CPUARM)
|
||||||
void displayExpoLine(uint8_t y, ExpoData *ed)
|
void displayExpoLine(coord_t y, ExpoData *ed)
|
||||||
{
|
{
|
||||||
displayExpoInfos(y, ed);
|
displayExpoInfos(y, ed);
|
||||||
|
|
||||||
|
@ -3751,7 +3753,7 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||||
|
|
||||||
for (uint8_t ch=1; ch<=(expo ? NUM_INPUTS : NUM_CHNOUT); ch++) {
|
for (uint8_t ch=1; ch<=(expo ? NUM_INPUTS : NUM_CHNOUT); ch++) {
|
||||||
void *pointer = NULL; MixData * &md = (MixData * &)pointer; ExpoData * &ed = (ExpoData * &)pointer;
|
void *pointer = NULL; MixData * &md = (MixData * &)pointer; ExpoData * &ed = (ExpoData * &)pointer;
|
||||||
uint8_t y = 1+(cur-s_pgOfs)*FH;
|
coord_t y = MENU_TITLE_HEIGHT-FH+1+(cur-s_pgOfs)*FH;
|
||||||
if (expo ? (i<MAX_EXPOS && (ed=expoAddress(i))->chn+1 == ch && EXPO_VALID(ed)) : (i<MAX_MIXERS && (md=mixAddress(i))->srcRaw && md->destCh+1 == ch)) {
|
if (expo ? (i<MAX_EXPOS && (ed=expoAddress(i))->chn+1 == ch && EXPO_VALID(ed)) : (i<MAX_MIXERS && (md=mixAddress(i))->srcRaw && md->destCh+1 == ch)) {
|
||||||
if (s_pgOfs < cur && cur-s_pgOfs < LCD_LINES) {
|
if (s_pgOfs < cur && cur-s_pgOfs < LCD_LINES) {
|
||||||
if (expo) {
|
if (expo) {
|
||||||
|
@ -4028,7 +4030,7 @@ void menuModelLimits(uint8_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
uint8_t y = 1 + (i+1)*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i+s_pgOfs;
|
uint8_t k = i+s_pgOfs;
|
||||||
|
|
||||||
if (k==NUM_CHNOUT) {
|
if (k==NUM_CHNOUT) {
|
||||||
|
@ -4053,7 +4055,9 @@ void menuModelLimits(uint8_t event)
|
||||||
char swVal = '-'; // '-', '<', '>'
|
char swVal = '-'; // '-', '<', '>'
|
||||||
if ((channelOutputs[k] - v) > 50) swVal = (ld->revert ? 127 : 126); // Switch to raw inputs? - remove trim!
|
if ((channelOutputs[k] - v) > 50) swVal = (ld->revert ? 127 : 126); // Switch to raw inputs? - remove trim!
|
||||||
if ((channelOutputs[k] - v) < -50) swVal = (ld->revert ? 126 : 127);
|
if ((channelOutputs[k] - v) < -50) swVal = (ld->revert ? 126 : 127);
|
||||||
|
#if !defined(PCBTARANIS)
|
||||||
putsChn(0, y, k+1, 0);
|
putsChn(0, y, k+1, 0);
|
||||||
|
#endif
|
||||||
lcd_putc(LIMITS_DIRECTION_POS, y, swVal);
|
lcd_putc(LIMITS_DIRECTION_POS, y, swVal);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -4228,7 +4232,7 @@ void menuModelCurvesAll(uint8_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
uint8_t y = 1 + FH + i*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i + s_pgOfs;
|
uint8_t k = i + s_pgOfs;
|
||||||
uint8_t attr = (sub == k ? INVERS : 0);
|
uint8_t attr = (sub == k ? INVERS : 0);
|
||||||
#if defined(GVARS) && defined(PCBSTD)
|
#if defined(GVARS) && defined(PCBSTD)
|
||||||
|
@ -4307,13 +4311,13 @@ void menuModelGVars(uint8_t event)
|
||||||
#if MAX_GVARS > 6
|
#if MAX_GVARS > 6
|
||||||
for (uint8_t l=0; l<LCD_LINES-1; l++) {
|
for (uint8_t l=0; l<LCD_LINES-1; l++) {
|
||||||
uint8_t i = l+s_pgOfs;
|
uint8_t i = l+s_pgOfs;
|
||||||
uint8_t y = 1 + FH + l*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + l*FH;
|
||||||
#elif MAX_GVARS == 6
|
#elif MAX_GVARS == 6
|
||||||
for (uint8_t i=0; i<MAX_GVARS; i++) {
|
for (uint8_t i=0; i<MAX_GVARS; i++) {
|
||||||
uint8_t y = 1 + 2*FH + i*FH;
|
coord_t y = MENU_TITLE_HEIGHT + FH + 1 + i*FH;
|
||||||
#else
|
#else
|
||||||
for (uint8_t i=0; i<MAX_GVARS; i++) {
|
for (uint8_t i=0; i<MAX_GVARS; i++) {
|
||||||
uint8_t y = 1 + 3*FH + i*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 2*FH + 1 + i*FH;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (g_model.gvars[i].popup) lcd_putc(3*FW, y, '!');
|
if (g_model.gvars[i].popup) lcd_putc(3*FW, y, '!');
|
||||||
|
@ -4321,7 +4325,7 @@ void menuModelGVars(uint8_t event)
|
||||||
|
|
||||||
for (uint8_t j=0; j<1+MAX_FLIGHT_MODES; j++) {
|
for (uint8_t j=0; j<1+MAX_FLIGHT_MODES; j++) {
|
||||||
LcdFlags attr = ((sub==i && m_posHorz==j) ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
LcdFlags attr = ((sub==i && m_posHorz==j) ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
||||||
xcoord_t x = GVARS_FM_COLUMN(j-1);
|
coord_t x = GVARS_FM_COLUMN(j-1);
|
||||||
|
|
||||||
#if MAX_GVARS == 6
|
#if MAX_GVARS == 6
|
||||||
if (i==0 && j!=9) putsStrIdx(x+2, FH+1, STR_FP, j, SMLSIZE);
|
if (i==0 && j!=9) putsStrIdx(x+2, FH+1, STR_FP, j, SMLSIZE);
|
||||||
|
@ -4448,7 +4452,7 @@ void menuModelLogicalSwitchOne(uint8_t event)
|
||||||
int v1_val = cs->v1;
|
int v1_val = cs->v1;
|
||||||
|
|
||||||
for (uint8_t k=0; k<LCD_LINES-1; k++) {
|
for (uint8_t k=0; k<LCD_LINES-1; k++) {
|
||||||
uint8_t y = 1 + (k+1)*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + k*FH;
|
||||||
uint8_t i = k + s_pgOfs;
|
uint8_t i = k + s_pgOfs;
|
||||||
uint8_t attr = (sub==i ? (s_editMode>0 ? BLINK|INVERS : INVERS) : 0);
|
uint8_t attr = (sub==i ? (s_editMode>0 ? BLINK|INVERS : INVERS) : 0);
|
||||||
uint8_t cstate = lswFamily(cs->func);
|
uint8_t cstate = lswFamily(cs->func);
|
||||||
|
@ -4587,7 +4591,7 @@ void menuModelLogicalSwitches(uint8_t event)
|
||||||
{
|
{
|
||||||
SIMPLE_MENU(STR_MENULOGICALSWITCHES, menuTabModel, e_LogicalSwitches, NUM_LOGICAL_SWITCH+1);
|
SIMPLE_MENU(STR_MENULOGICALSWITCHES, menuTabModel, e_LogicalSwitches, NUM_LOGICAL_SWITCH+1);
|
||||||
|
|
||||||
uint8_t y = 0;
|
coord_t y = 0;
|
||||||
uint8_t k = 0;
|
uint8_t k = 0;
|
||||||
int8_t sub = m_posVert - 1;
|
int8_t sub = m_posVert - 1;
|
||||||
|
|
||||||
|
@ -4706,7 +4710,6 @@ void menuModelLogicalSwitches(uint8_t event)
|
||||||
|
|
||||||
MENU(STR_MENULOGICALSWITCHES, menuTabModel, e_LogicalSwitches, NUM_LOGICAL_SWITCH+1, {0, NAVIGATION_LINE_BY_LINE|LS_FIELD_LAST/*repeated...*/});
|
MENU(STR_MENULOGICALSWITCHES, menuTabModel, e_LogicalSwitches, NUM_LOGICAL_SWITCH+1, {0, NAVIGATION_LINE_BY_LINE|LS_FIELD_LAST/*repeated...*/});
|
||||||
|
|
||||||
uint8_t y = 0;
|
|
||||||
uint8_t k = 0;
|
uint8_t k = 0;
|
||||||
int8_t sub = m_posVert - 1;
|
int8_t sub = m_posVert - 1;
|
||||||
horzpos_t horz = m_posHorz;
|
horzpos_t horz = m_posHorz;
|
||||||
|
@ -4732,7 +4735,7 @@ void menuModelLogicalSwitches(uint8_t event)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
y = 1 + (i+1)*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
||||||
k = i+s_pgOfs;
|
k = i+s_pgOfs;
|
||||||
uint8_t attr = (sub==k ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
uint8_t attr = (sub==k ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
||||||
uint8_t attr1 = (horz==1 ? attr : 0);
|
uint8_t attr1 = (horz==1 ? attr : 0);
|
||||||
|
@ -5068,8 +5071,6 @@ void menuModelCustomFunctions(uint8_t event)
|
||||||
{
|
{
|
||||||
MENU(STR_MENUCUSTOMFUNC, menuTabModel, e_CustomFunctions, NUM_CFN+1, {0, NAVIGATION_LINE_BY_LINE|4/*repeated*/});
|
MENU(STR_MENUCUSTOMFUNC, menuTabModel, e_CustomFunctions, NUM_CFN+1, {0, NAVIGATION_LINE_BY_LINE|4/*repeated*/});
|
||||||
|
|
||||||
uint8_t y;
|
|
||||||
uint8_t k = 0;
|
|
||||||
int8_t sub = m_posVert - 1;
|
int8_t sub = m_posVert - 1;
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
|
@ -5095,8 +5096,8 @@ void menuModelCustomFunctions(uint8_t event)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
y = 1 + (i+1)*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
||||||
k = i+s_pgOfs;
|
uint8_t k = i+s_pgOfs;
|
||||||
|
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
putsStrIdx(0, y, STR_CF, k+1, (sub==k && m_posHorz<0) ? INVERS : 0);
|
putsStrIdx(0, y, STR_CF, k+1, (sub==k && m_posHorz<0) ? INVERS : 0);
|
||||||
|
@ -5216,9 +5217,9 @@ void menuModelCustomFunctions(uint8_t event)
|
||||||
#if defined(CPUARM) && defined(SDCARD)
|
#if defined(CPUARM) && defined(SDCARD)
|
||||||
else if (func == FUNC_PLAY_TRACK || func == FUNC_BACKGND_MUSIC || func == FUNC_PLAY_SCRIPT) {
|
else if (func == FUNC_PLAY_TRACK || func == FUNC_BACKGND_MUSIC || func == FUNC_PLAY_SCRIPT) {
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
xcoord_t x = MODEL_CUSTOM_FUNC_3RD_COLUMN;
|
coord_t x = MODEL_CUSTOM_FUNC_3RD_COLUMN;
|
||||||
#else
|
#else
|
||||||
xcoord_t x = (func == FUNC_PLAY_TRACK ? MODEL_CUSTOM_FUNC_2ND_COLUMN + FW + FW*strlen(TR_PLAY_TRACK) : MODEL_CUSTOM_FUNC_3RD_COLUMN);
|
coord_t x = (func == FUNC_PLAY_TRACK ? MODEL_CUSTOM_FUNC_2ND_COLUMN + FW + FW*strlen(TR_PLAY_TRACK) : MODEL_CUSTOM_FUNC_3RD_COLUMN);
|
||||||
#endif
|
#endif
|
||||||
if (ZEXIST(sd->play.name))
|
if (ZEXIST(sd->play.name))
|
||||||
lcd_putsnAtt(x, y, sd->play.name, sizeof(sd->play.name), attr);
|
lcd_putsnAtt(x, y, sd->play.name, sizeof(sd->play.name), attr);
|
||||||
|
@ -5438,7 +5439,7 @@ void menuModelCustomScriptOne(uint8_t event)
|
||||||
int8_t sub = m_posVert;
|
int8_t sub = m_posVert;
|
||||||
|
|
||||||
for (uint8_t k=0; k<LCD_LINES-1; k++) {
|
for (uint8_t k=0; k<LCD_LINES-1; k++) {
|
||||||
uint8_t y = 1 + (k+1)*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + k*FH;
|
||||||
uint8_t i = k + s_pgOfs;
|
uint8_t i = k + s_pgOfs;
|
||||||
uint8_t attr = (sub==i ? (s_editMode>0 ? BLINK|INVERS : INVERS) : 0);
|
uint8_t attr = (sub==i ? (s_editMode>0 ? BLINK|INVERS : INVERS) : 0);
|
||||||
|
|
||||||
|
@ -5503,7 +5504,7 @@ void menuModelCustomScripts(uint8_t event)
|
||||||
|
|
||||||
MENU(STR_MENUCUSTOMSCRIPTS, menuTabModel, e_CustomScripts, MAX_SCRIPTS+1, {0, NAVIGATION_LINE_BY_LINE|3/*repeated*/});
|
MENU(STR_MENUCUSTOMSCRIPTS, menuTabModel, e_CustomScripts, MAX_SCRIPTS+1, {0, NAVIGATION_LINE_BY_LINE|3/*repeated*/});
|
||||||
|
|
||||||
uint8_t y;
|
coord_t y;
|
||||||
int8_t sub = m_posVert - 1;
|
int8_t sub = m_posVert - 1;
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
|
@ -5708,7 +5709,7 @@ void menuModelTelemetry(uint8_t event)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
uint8_t y = 1 + 1*FH + i*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i + s_pgOfs;
|
uint8_t k = i + s_pgOfs;
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
for (int j=0; j<=k; j++) {
|
for (int j=0; j<=k; j++) {
|
||||||
|
@ -6131,7 +6132,7 @@ void menuModelTemplates(uint8_t event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t y = 1 + 1*FH;
|
coord_t y = MENU_TITLE_HEIGHT + 1;
|
||||||
uint8_t k = 0;
|
uint8_t k = 0;
|
||||||
for (uint8_t i=0; i<LCD_LINES-1 && k<TMPL_COUNT; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1 && k<TMPL_COUNT; i++) {
|
||||||
k = i+s_pgOfs;
|
k = i+s_pgOfs;
|
||||||
|
|
|
@ -41,7 +41,7 @@ int8_t s_editMode;
|
||||||
uint8_t s_noHi;
|
uint8_t s_noHi;
|
||||||
uint8_t calibrationState;
|
uint8_t calibrationState;
|
||||||
|
|
||||||
void menu_lcd_onoff(uint8_t x, uint8_t y, uint8_t value, LcdFlags attr)
|
void menu_lcd_onoff(coord_t x, coord_t y, uint8_t value, LcdFlags attr)
|
||||||
{
|
{
|
||||||
#if defined(GRAPHICS)
|
#if defined(GRAPHICS)
|
||||||
if (value)
|
if (value)
|
||||||
|
@ -59,18 +59,18 @@ void menu_lcd_onoff(uint8_t x, uint8_t y, uint8_t value, LcdFlags attr)
|
||||||
void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr)
|
void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr)
|
||||||
{
|
{
|
||||||
lcd_outdezAtt(LCD_W, 0, count, attr);
|
lcd_outdezAtt(LCD_W, 0, count, attr);
|
||||||
xcoord_t x = 1+LCD_W-FW*(count>9 ? 3 : 2);
|
coord_t x = 1+LCD_W-FW*(count>9 ? 3 : 2);
|
||||||
lcd_putcAtt(x, 0, '/', attr);
|
lcd_putcAtt(x, 0, '/', attr);
|
||||||
lcd_outdezAtt(x, 0, index+1, attr);
|
lcd_outdezAtt(x, 0, index+1, attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(CPUM64)
|
#if !defined(CPUM64)
|
||||||
void displayScrollbar(xcoord_t x, uint8_t y, uint8_t h, uint16_t offset, uint16_t count, uint8_t visible)
|
void displayScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible)
|
||||||
{
|
{
|
||||||
lcd_vlineStip(x, y, h, SOLID, ERASE);
|
lcd_vlineStip(x, y, h, SOLID, ERASE);
|
||||||
lcd_vlineStip(x, y, h, DOTTED);
|
lcd_vlineStip(x, y, h, DOTTED);
|
||||||
uint8_t yofs = (h * offset) / count;
|
coord_t yofs = (h * offset) / count;
|
||||||
uint8_t yhgt = (h * visible) / count;
|
coord_t yhgt = (h * visible) / count;
|
||||||
if (yhgt + yofs > h)
|
if (yhgt + yofs > h)
|
||||||
yhgt = h - yofs;
|
yhgt = h - yofs;
|
||||||
lcd_vlineStip(x, y + yofs, yhgt, SOLID, FORCE);
|
lcd_vlineStip(x, y + yofs, yhgt, SOLID, FORCE);
|
||||||
|
@ -335,7 +335,7 @@ void title(const pm_char * s)
|
||||||
#define DEC(val, min, max) if (val>min) {val--;} else {val=max;}
|
#define DEC(val, min, max) if (val>min) {val--;} else {val=max;}
|
||||||
|
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
uint8_t scrollbar_X = LCD_W-1;
|
coord_t scrollbar_X = LCD_W-1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
|
@ -386,8 +386,6 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
||||||
if (p2valdiff || scrollUD || p1valdiff) backlightOn(); // on keypress turn the light on
|
if (p2valdiff || scrollUD || p1valdiff) backlightOn(); // on keypress turn the light on
|
||||||
|
|
||||||
if (menuTab) {
|
if (menuTab) {
|
||||||
uint8_t attr = 0;
|
|
||||||
|
|
||||||
int8_t cc = curr;
|
int8_t cc = curr;
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case EVT_KEY_LONG(KEY_MENU):
|
case EVT_KEY_LONG(KEY_MENU):
|
||||||
|
@ -427,10 +425,10 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(flags&CHECK_FLAG_NO_SCREEN_INDEX)) {
|
if (!(flags&CHECK_FLAG_NO_SCREEN_INDEX)) {
|
||||||
displayScreenIndex(curr, menuTabSize, attr);
|
displayScreenIndex(curr, menuTabSize, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
lcd_filled_rect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
lcd_filled_rect(0, 0, LCD_W, MENU_TITLE_HEIGHT, SOLID, FILL_WHITE|GREY_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
DISPLAY_PROGRESS_BAR(menuTab ? lcdLastPos-2*FW-((curr+1)/10*FWNUM)-2 : 20*FW+1);
|
DISPLAY_PROGRESS_BAR(menuTab ? lcdLastPos-2*FW-((curr+1)/10*FWNUM)-2 : 20*FW+1);
|
||||||
|
@ -631,7 +629,7 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maxrow > LCD_LINES-1 && scrollbar_X) {
|
if (maxrow > LCD_LINES-1 && scrollbar_X) {
|
||||||
displayScrollbar(scrollbar_X, FH, LCD_H-FH, s_pgOfs, menuTab ? maxrow : maxrow+1, LCD_LINES-1);
|
displayScrollbar(scrollbar_X, MENU_TITLE_HEIGHT, LCD_H-MENU_TITLE_HEIGHT-MENU_NAVIG_HEIGHT, s_pgOfs, menuTab ? maxrow : maxrow+1, LCD_LINES-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_posVert = l_posVert;
|
m_posVert = l_posVert;
|
||||||
|
@ -1095,7 +1093,7 @@ void displayWarning(uint8_t event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
select_menu_value_t selectMenuItem(uint8_t x, uint8_t y, const pm_char *label, const pm_char *values, select_menu_value_t value, select_menu_value_t min, select_menu_value_t max, LcdFlags attr, uint8_t event)
|
select_menu_value_t selectMenuItem(coord_t x, coord_t y, const pm_char *label, const pm_char *values, select_menu_value_t value, select_menu_value_t min, select_menu_value_t max, LcdFlags attr, uint8_t event)
|
||||||
{
|
{
|
||||||
lcd_putsColumnLeft(x, y, label);
|
lcd_putsColumnLeft(x, y, label);
|
||||||
if (values) lcd_putsiAtt(x, y, values, value-min, attr);
|
if (values) lcd_putsiAtt(x, y, values, value-min, attr);
|
||||||
|
@ -1103,7 +1101,7 @@ select_menu_value_t selectMenuItem(uint8_t x, uint8_t y, const pm_char *label, c
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t onoffMenuItem(uint8_t value, uint8_t x, uint8_t y, const pm_char *label, LcdFlags attr, uint8_t event )
|
uint8_t onoffMenuItem(uint8_t value, coord_t x, coord_t y, const pm_char *label, LcdFlags attr, uint8_t event )
|
||||||
{
|
{
|
||||||
#if defined(GRAPHICS)
|
#if defined(GRAPHICS)
|
||||||
menu_lcd_onoff(x, y, value, attr);
|
menu_lcd_onoff(x, y, value, attr);
|
||||||
|
@ -1113,7 +1111,7 @@ uint8_t onoffMenuItem(uint8_t value, uint8_t x, uint8_t y, const pm_char *label,
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int8_t switchMenuItem(uint8_t x, uint8_t y, int8_t value, LcdFlags attr, uint8_t event)
|
int8_t switchMenuItem(coord_t x, coord_t y, int8_t value, LcdFlags attr, uint8_t event)
|
||||||
{
|
{
|
||||||
lcd_putsColumnLeft(x, y, STR_SWITCH);
|
lcd_putsColumnLeft(x, y, STR_SWITCH);
|
||||||
putsSwitches(x, y, value, attr);
|
putsSwitches(x, y, value, attr);
|
||||||
|
@ -1122,14 +1120,14 @@ int8_t switchMenuItem(uint8_t x, uint8_t y, int8_t value, LcdFlags attr, uint8_t
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(CPUM64)
|
#if !defined(CPUM64)
|
||||||
void displaySlider(uint8_t x, uint8_t y, uint8_t value, uint8_t max, uint8_t attr)
|
void displaySlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr)
|
||||||
{
|
{
|
||||||
lcd_putc(x+(value*4*FW)/max, y, '$');
|
lcd_putc(x+(value*4*FW)/max, y, '$');
|
||||||
lcd_hline(x, y+3, 5*FW-1, SOLID);
|
lcd_hline(x, y+3, 5*FW-1, FORCE);
|
||||||
if (attr && (!(attr & BLINK) || !BLINK_ON_PHASE)) lcd_filled_rect(x, y, 5*FW-1, FH-1);
|
if (attr && (!(attr & BLINK) || !BLINK_ON_PHASE)) lcd_filled_rect(x, y, 5*FW-1, FH-1);
|
||||||
}
|
}
|
||||||
#elif defined(GRAPHICS)
|
#elif defined(GRAPHICS)
|
||||||
void display5posSlider(uint8_t x, uint8_t y, uint8_t value, uint8_t attr)
|
void display5posSlider(coord_t x, coord_t y, uint8_t value, uint8_t attr)
|
||||||
{
|
{
|
||||||
lcd_putc(x+2*FW+(value*FW), y, '$');
|
lcd_putc(x+2*FW+(value*FW), y, '$');
|
||||||
lcd_hline(x, y+3, 5*FW-1, SOLID);
|
lcd_hline(x, y+3, 5*FW-1, SOLID);
|
||||||
|
@ -1139,9 +1137,9 @@ int8_t switchMenuItem(uint8_t x, uint8_t y, int8_t value, LcdFlags attr, uint8_t
|
||||||
|
|
||||||
#if defined(GVARS)
|
#if defined(GVARS)
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
int16_t gvarMenuItem(uint8_t x, uint8_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, uint8_t editflags, uint8_t event)
|
int16_t gvarMenuItem(coord_t x, coord_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, uint8_t editflags, uint8_t event)
|
||||||
#else
|
#else
|
||||||
int16_t gvarMenuItem(uint8_t x, uint8_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, uint8_t event)
|
int16_t gvarMenuItem(coord_t x, coord_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, uint8_t event)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
uint16_t delta = GV_GET_GV1_VALUE(max);
|
uint16_t delta = GV_GET_GV1_VALUE(max);
|
||||||
|
@ -1198,7 +1196,7 @@ int16_t gvarMenuItem(uint8_t x, uint8_t y, int16_t value, int16_t min, int16_t m
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
int16_t gvarMenuItem(uint8_t x, uint8_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, uint8_t event)
|
int16_t gvarMenuItem(coord_t x, coord_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, uint8_t event)
|
||||||
{
|
{
|
||||||
lcd_outdezAtt(x, y, value, attr);
|
lcd_outdezAtt(x, y, value, attr);
|
||||||
if (attr&INVERS) value = checkIncDec(event, value, min, max, EE_MODEL);
|
if (attr&INVERS) value = checkIncDec(event, value, min, max, EE_MODEL);
|
||||||
|
|
|
@ -46,11 +46,11 @@ inline void displayColumnHeader(const char **headers, uint8_t index)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(CPUM64)
|
#if !defined(CPUM64)
|
||||||
void displayScrollbar(xcoord_t x, uint8_t y, uint8_t h, uint16_t offset, uint16_t count, uint8_t visible);
|
void displayScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
extern uint8_t scrollbar_X;
|
extern coord_t scrollbar_X;
|
||||||
#define SET_SCROLLBAR_X(x) scrollbar_X = (x);
|
#define SET_SCROLLBAR_X(x) scrollbar_X = (x);
|
||||||
#else
|
#else
|
||||||
#define SET_SCROLLBAR_X(x)
|
#define SET_SCROLLBAR_X(x)
|
||||||
|
@ -98,7 +98,7 @@ extern vertpos_t s_pgOfs;
|
||||||
extern uint8_t s_noHi;
|
extern uint8_t s_noHi;
|
||||||
extern uint8_t calibrationState;
|
extern uint8_t calibrationState;
|
||||||
|
|
||||||
void menu_lcd_onoff(uint8_t x, uint8_t y, uint8_t value, LcdFlags attr);
|
void menu_lcd_onoff(coord_t x, coord_t y, uint8_t value, LcdFlags attr);
|
||||||
|
|
||||||
typedef void (*MenuFuncP)(uint8_t event);
|
typedef void (*MenuFuncP)(uint8_t event);
|
||||||
typedef void (*MenuFuncP_PROGMEM)(uint8_t event);
|
typedef void (*MenuFuncP_PROGMEM)(uint8_t event);
|
||||||
|
@ -139,9 +139,9 @@ void menuStatisticsDebug(uint8_t event);
|
||||||
void menuAboutView(uint8_t event);
|
void menuAboutView(uint8_t event);
|
||||||
|
|
||||||
#if !defined(CPUM64)
|
#if !defined(CPUM64)
|
||||||
void displaySlider(uint8_t x, uint8_t y, uint8_t value, uint8_t max, uint8_t attr);
|
void displaySlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr);
|
||||||
#elif defined(GRAPHICS)
|
#elif defined(GRAPHICS)
|
||||||
void display5posSlider(uint8_t x, uint8_t y, uint8_t value, uint8_t attr);
|
void display5posSlider(coord_t x, coord_t y, uint8_t value, uint8_t attr);
|
||||||
#define displaySlider(x, y, value, max, attr) lcd_outdezAtt(x, y, value, attr|LEFT)
|
#define displaySlider(x, y, value, max, attr) lcd_outdezAtt(x, y, value, attr|LEFT)
|
||||||
#else
|
#else
|
||||||
#define displaySlider(x, y, value, max, attr) lcd_outdezAtt(x, y, value, attr|LEFT)
|
#define displaySlider(x, y, value, max, attr) lcd_outdezAtt(x, y, value, attr|LEFT)
|
||||||
|
@ -329,9 +329,9 @@ void title(const pm_char * s);
|
||||||
typedef int8_t select_menu_value_t;
|
typedef int8_t select_menu_value_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
select_menu_value_t selectMenuItem(uint8_t x, uint8_t y, const pm_char *label, const pm_char *values, select_menu_value_t value, select_menu_value_t min, select_menu_value_t max, LcdFlags attr, uint8_t event);
|
select_menu_value_t selectMenuItem(coord_t x, coord_t y, const pm_char *label, const pm_char *values, select_menu_value_t value, select_menu_value_t min, select_menu_value_t max, LcdFlags attr, uint8_t event);
|
||||||
uint8_t onoffMenuItem(uint8_t value, uint8_t x, uint8_t y, const pm_char *label, LcdFlags attr, uint8_t event );
|
uint8_t onoffMenuItem(uint8_t value, coord_t x, coord_t y, const pm_char *label, LcdFlags attr, uint8_t event );
|
||||||
int8_t switchMenuItem(uint8_t x, uint8_t y, int8_t value, LcdFlags attr, uint8_t event);
|
int8_t switchMenuItem(coord_t x, coord_t y, int8_t value, LcdFlags attr, uint8_t event);
|
||||||
|
|
||||||
#if defined(CPUARM) && defined(GVARS)
|
#if defined(CPUARM) && defined(GVARS)
|
||||||
#define GVAR_MENU_ITEM(x, y, v, min, max, lcdattr, editflags, event) gvarMenuItem(x, y, v, min, max, lcdattr, editflags, event)
|
#define GVAR_MENU_ITEM(x, y, v, min, max, lcdattr, editflags, event) gvarMenuItem(x, y, v, min, max, lcdattr, editflags, event)
|
||||||
|
@ -341,13 +341,13 @@ int8_t switchMenuItem(uint8_t x, uint8_t y, int8_t value, LcdFlags attr, uint8_t
|
||||||
|
|
||||||
#if defined(GVARS)
|
#if defined(GVARS)
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
int16_t gvarMenuItem(uint8_t x, uint8_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, uint8_t editflags, uint8_t event);
|
int16_t gvarMenuItem(coord_t x, coord_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, uint8_t editflags, uint8_t event);
|
||||||
#else
|
#else
|
||||||
int16_t gvarMenuItem(uint8_t x, uint8_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, uint8_t event); // @@@ open.20.fsguruh
|
int16_t gvarMenuItem(coord_t x, coord_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, uint8_t event); // @@@ open.20.fsguruh
|
||||||
#endif
|
#endif
|
||||||
#define displayGVar(x, y, v, min, max) GVAR_MENU_ITEM(x, y, v, min, max, 0, 0, 0)
|
#define displayGVar(x, y, v, min, max) GVAR_MENU_ITEM(x, y, v, min, max, 0, 0, 0)
|
||||||
#else
|
#else
|
||||||
int16_t gvarMenuItem(uint8_t x, uint8_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, uint8_t event);
|
int16_t gvarMenuItem(coord_t x, coord_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, uint8_t event);
|
||||||
#define displayGVar(x, y, v, min, max) lcd_outdez8(x, y, v)
|
#define displayGVar(x, y, v, min, max) lcd_outdez8(x, y, v)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ void drawPotsBars()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawStick(uint8_t centrex, int16_t xval, int16_t yval)
|
void drawStick(coord_t centrex, int16_t xval, int16_t yval)
|
||||||
{
|
{
|
||||||
lcd_square(centrex-BOX_WIDTH/2, BOX_CENTERY-BOX_WIDTH/2, BOX_WIDTH);
|
lcd_square(centrex-BOX_WIDTH/2, BOX_CENTERY-BOX_WIDTH/2, BOX_WIDTH);
|
||||||
DO_CROSS(centrex, BOX_CENTERY, 3);
|
DO_CROSS(centrex, BOX_CENTERY, 3);
|
||||||
|
@ -156,9 +156,9 @@ void doMainScreenGraphics()
|
||||||
void displayTrims(uint8_t phase)
|
void displayTrims(uint8_t phase)
|
||||||
{
|
{
|
||||||
for (uint8_t i=0; i<4; i++) {
|
for (uint8_t i=0; i<4; i++) {
|
||||||
static xcoord_t x[4] = {TRIM_LH_X, TRIM_LV_X, TRIM_RV_X, TRIM_RH_X};
|
static coord_t x[4] = {TRIM_LH_X, TRIM_LV_X, TRIM_RV_X, TRIM_RH_X};
|
||||||
static uint8_t vert[4] = {0,1,1,0};
|
static uint8_t vert[4] = {0,1,1,0};
|
||||||
uint8_t xm, ym;
|
coord_t xm, ym;
|
||||||
xm = x[CONVERT_MODE(i)];
|
xm = x[CONVERT_MODE(i)];
|
||||||
|
|
||||||
uint8_t att = ROUND;
|
uint8_t att = ROUND;
|
||||||
|
@ -232,7 +232,7 @@ void displaySliders()
|
||||||
if (i == POT3) {
|
if (i == POT3) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
xcoord_t x = ((i==POT1 || i==SLIDER1) ? 3 : LCD_W-5);
|
coord_t x = ((i==POT1 || i==SLIDER1) ? 3 : LCD_W-5);
|
||||||
int8_t y = (i>=SLIDER1 ? LCD_H/2+1 : 1);
|
int8_t y = (i>=SLIDER1 ? LCD_H/2+1 : 1);
|
||||||
lcd_vline(x, y, LCD_H/2-2);
|
lcd_vline(x, y, LCD_H/2-2);
|
||||||
lcd_vline(x+1, y, LCD_H/2-2);
|
lcd_vline(x+1, y, LCD_H/2-2);
|
||||||
|
@ -251,7 +251,7 @@ void displaySliders()
|
||||||
#define BAR_VOLUME_X BAR_X+147
|
#define BAR_VOLUME_X BAR_X+147
|
||||||
#define BAR_TIME_X BAR_X+159
|
#define BAR_TIME_X BAR_X+159
|
||||||
|
|
||||||
void displayTopBarGauge(xcoord_t x, int count, bool blinking=false)
|
void displayTopBarGauge(coord_t x, int count, bool blinking=false)
|
||||||
{
|
{
|
||||||
if (!blinking || BLINK_ON_PHASE)
|
if (!blinking || BLINK_ON_PHASE)
|
||||||
lcd_filled_rect(x+1, BAR_Y+2, 11, 5, SOLID, ERASE);
|
lcd_filled_rect(x+1, BAR_Y+2, 11, 5, SOLID, ERASE);
|
||||||
|
@ -311,7 +311,7 @@ void displayTopBar()
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Notifs icons */
|
/* Notifs icons */
|
||||||
xcoord_t x = BAR_NOTIFS_X;
|
coord_t x = BAR_NOTIFS_X;
|
||||||
if (unexpectedShutdown) {
|
if (unexpectedShutdown) {
|
||||||
LCD_NOTIF_ICON(x, ICON_REBOOT);
|
LCD_NOTIF_ICON(x, ICON_REBOOT);
|
||||||
x -= 12;
|
x -= 12;
|
||||||
|
|
|
@ -393,9 +393,9 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
|
||||||
getvalue_t value = getValue(MIXSRC_FIRST_TELEM+field-1);
|
getvalue_t value = getValue(MIXSRC_FIRST_TELEM+field-1);
|
||||||
uint8_t att = (i==3 ? NO_UNIT : DBLSIZE|NO_UNIT);
|
uint8_t att = (i==3 ? NO_UNIT : DBLSIZE|NO_UNIT);
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
xcoord_t pos[] = {0, 71, 143, 214};
|
coord_t pos[] = {0, 71, 143, 214};
|
||||||
#else
|
#else
|
||||||
xcoord_t pos[] = {0, 65, 130};
|
coord_t pos[] = {0, 65, 130};
|
||||||
#endif
|
#endif
|
||||||
putsTelemetryChannel(pos[j+1]-2, FH+2*FH*i, field-1, value, att);
|
putsTelemetryChannel(pos[j+1]-2, FH+2*FH*i, field-1, value, att);
|
||||||
|
|
||||||
|
|
154
radio/src/lcd.h
154
radio/src/lcd.h
|
@ -40,7 +40,8 @@
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define LCD_W 212
|
#define LCD_W 212
|
||||||
#define LCD_H 64
|
#define LCD_H 64
|
||||||
#define xcoord_t uint16_t
|
#define coord_t int
|
||||||
|
#define scoord_t int
|
||||||
#define CENTER "\015"
|
#define CENTER "\015"
|
||||||
#define CENTER_OFS (7*FW-FW/2)
|
#define CENTER_OFS (7*FW-FW/2)
|
||||||
#define CONTRAST_MIN 0
|
#define CONTRAST_MIN 0
|
||||||
|
@ -48,7 +49,8 @@
|
||||||
#else
|
#else
|
||||||
#define LCD_W 128
|
#define LCD_W 128
|
||||||
#define LCD_H 64
|
#define LCD_H 64
|
||||||
#define xcoord_t uint8_t
|
#define coord_t uint8_t
|
||||||
|
#define scoord_t int8_t
|
||||||
#define CENTER
|
#define CENTER
|
||||||
#define CENTER_OFS 0
|
#define CENTER_OFS 0
|
||||||
#define CONTRAST_MIN 10
|
#define CONTRAST_MIN 10
|
||||||
|
@ -67,6 +69,9 @@
|
||||||
#define FWNUM 5
|
#define FWNUM 5
|
||||||
#define FH 8
|
#define FH 8
|
||||||
|
|
||||||
|
#define MENU_TITLE_HEIGHT FH
|
||||||
|
#define MENU_NAVIG_HEIGHT 0
|
||||||
|
|
||||||
#define LCD_LINES (LCD_H/FH)
|
#define LCD_LINES (LCD_H/FH)
|
||||||
#define LCD_COLS (LCD_W/FW)
|
#define LCD_COLS (LCD_W/FW)
|
||||||
|
|
||||||
|
@ -75,7 +80,6 @@
|
||||||
|
|
||||||
/* lcd text flags */
|
/* lcd text flags */
|
||||||
#define INVERS 0x02
|
#define INVERS 0x02
|
||||||
#define DBLSIZE 0x04
|
|
||||||
#ifdef BOLD_FONT
|
#ifdef BOLD_FONT
|
||||||
#define BOLD 0x40
|
#define BOLD 0x40
|
||||||
#else
|
#else
|
||||||
|
@ -111,48 +115,53 @@
|
||||||
#define NO_UNIT 0x40
|
#define NO_UNIT 0x40
|
||||||
|
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
#define MIDSIZE 0x0100
|
#define FONTSIZE(x) ((x) & 0x0F00)
|
||||||
|
#define TINSIZE 0x0100
|
||||||
#define SMLSIZE 0x0200
|
#define SMLSIZE 0x0200
|
||||||
#define TINSIZE 0x0400
|
#define MIDSIZE 0x0300
|
||||||
#define XXLSIZE 0x0800
|
#define DBLSIZE 0x0400
|
||||||
|
#define XXLSIZE 0x0500
|
||||||
|
#define ERASEBG 0x8000
|
||||||
#else
|
#else
|
||||||
|
#define DBLSIZE 0x04
|
||||||
#define MIDSIZE DBLSIZE
|
#define MIDSIZE DBLSIZE
|
||||||
#define SMLSIZE 0x00
|
#define SMLSIZE 0x00
|
||||||
#define TINSIZE 0x00
|
#define TINSIZE 0x00
|
||||||
#define XXLSIZE 0x00
|
#define XXLSIZE 0x00
|
||||||
#endif
|
#define ERASEBG 0x00
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
|
||||||
#define GREY(x) ((x) * 0x1000)
|
|
||||||
#define GREY_DEFAULT GREY(11)
|
|
||||||
#define GREY_MASK(x) ((x) & 0xF000)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
#define TIMEBLINK 0x010000
|
#define TIMEBLINK 0x1000
|
||||||
#define TIMEHOUR 0x020000
|
#define TIMEHOUR 0x2000
|
||||||
#define STREXPANDED 0x040000
|
#define STREXPANDED 0x4000
|
||||||
#else
|
#else
|
||||||
#define STREXPANDED 0x00
|
#define STREXPANDED 0x00
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(PCBTARANIS)
|
||||||
|
#define GREY(x) ((x) * 0x010000)
|
||||||
|
#define GREY_DEFAULT GREY(11)
|
||||||
|
#define COLOUR_MASK(x) ((x) & 0x0F0000)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
#define LcdFlags uint32_t
|
#define LcdFlags uint32_t
|
||||||
#else
|
#else
|
||||||
#define LcdFlags uint8_t
|
#define LcdFlags uint8_t
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DISPLAY_PLAN_SIZE (LCD_W*((LCD_H+7)/8))
|
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define DISPLAY_BUF_SIZE (4*DISPLAY_PLAN_SIZE)
|
#define display_t uint8_t
|
||||||
|
#define DISPLAY_BUF_SIZE (LCD_W*LCD_H*4/8)
|
||||||
#else
|
#else
|
||||||
#define DISPLAY_BUF_SIZE DISPLAY_PLAN_SIZE
|
#define display_t uint8_t
|
||||||
|
#define DISPLAY_BUF_SIZE (LCD_W*((LCD_H+7)/8))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern uint8_t displayBuf[DISPLAY_BUF_SIZE];
|
extern display_t displayBuf[DISPLAY_BUF_SIZE];
|
||||||
extern uint8_t lcdLastPos;
|
extern coord_t lcdLastPos;
|
||||||
extern uint8_t lcdNextPos;
|
extern coord_t lcdNextPos;
|
||||||
|
|
||||||
#define DISPLAY_END (displayBuf + DISPLAY_BUF_SIZE)
|
#define DISPLAY_END (displayBuf + DISPLAY_BUF_SIZE)
|
||||||
#define ASSERT_IN_DISPLAY(p) assert((p) >= displayBuf && (p) < DISPLAY_END)
|
#define ASSERT_IN_DISPLAY(p) assert((p) >= displayBuf && (p) < DISPLAY_END)
|
||||||
|
@ -172,42 +181,42 @@ typedef const unsigned char pm_uchar;
|
||||||
typedef const char pm_char;
|
typedef const char pm_char;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void lcd_putc(xcoord_t x, uint8_t y, const unsigned char c);
|
void lcd_putc(coord_t x, coord_t y, const unsigned char c);
|
||||||
void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags mode);
|
void lcd_putcAtt(coord_t x, coord_t y, const unsigned char c, LcdFlags mode);
|
||||||
void lcd_putsAtt(xcoord_t x, uint8_t y, const pm_char * s, LcdFlags mode);
|
void lcd_putsAtt(coord_t x, coord_t y, const pm_char * s, LcdFlags mode);
|
||||||
void lcd_putsiAtt(xcoord_t x, uint8_t y, const pm_char * s,uint8_t idx, LcdFlags mode);
|
void lcd_putsiAtt(coord_t x, coord_t y, const pm_char * s,uint8_t idx, LcdFlags mode);
|
||||||
void lcd_putsnAtt(xcoord_t x, uint8_t y, const pm_char * s,unsigned char len, LcdFlags mode);
|
void lcd_putsnAtt(coord_t x, coord_t y, const pm_char * s,unsigned char len, LcdFlags mode);
|
||||||
void lcd_puts(xcoord_t x, uint8_t y, const pm_char * s);
|
void lcd_puts(coord_t x, coord_t y, const pm_char * s);
|
||||||
void lcd_putsn(xcoord_t x, uint8_t y, const pm_char * s, unsigned char len);
|
void lcd_putsn(coord_t x, coord_t y, const pm_char * s, unsigned char len);
|
||||||
void lcd_putsLeft(uint8_t y, const pm_char * s);
|
void lcd_putsLeft(coord_t y, const pm_char * s);
|
||||||
#define lcd_putsCenter(y, s) lcd_puts((LCD_W-sizeof(TR_##s)*FW+FW-2)/2, y, STR_##s)
|
#define lcd_putsCenter(y, s) lcd_puts((LCD_W-sizeof(TR_##s)*FW+FW-2)/2, y, STR_##s)
|
||||||
|
|
||||||
void lcd_outhex4(xcoord_t x, uint8_t y, uint16_t val);
|
void lcd_outhex4(coord_t x, coord_t y, uint16_t val);
|
||||||
void lcd_outdezAtt(xcoord_t x, uint8_t y, lcdint_t val, LcdFlags mode=0);
|
void lcd_outdezAtt(coord_t x, coord_t y, lcdint_t val, LcdFlags mode=0);
|
||||||
void lcd_outdezNAtt(xcoord_t x, uint8_t y, lcdint_t val, LcdFlags mode=0, uint8_t len=0);
|
void lcd_outdezNAtt(coord_t x, coord_t y, lcdint_t val, LcdFlags mode=0, uint8_t len=0);
|
||||||
void lcd_outdez8(xcoord_t x, uint8_t y, int8_t val);
|
void lcd_outdez8(coord_t x, coord_t y, int8_t val);
|
||||||
|
|
||||||
void putsStrIdx(xcoord_t x, uint8_t y, const pm_char *str, uint8_t idx, LcdFlags att=0);
|
void putsStrIdx(coord_t x, coord_t y, const pm_char *str, uint8_t idx, LcdFlags att=0);
|
||||||
void putsModelName(xcoord_t x, uint8_t y, char *name, uint8_t id, LcdFlags att);
|
void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att);
|
||||||
void putsSwitches(xcoord_t x, uint8_t y, int8_t swtch, LcdFlags att=0);
|
void putsSwitches(coord_t x, coord_t y, int8_t swtch, LcdFlags att=0);
|
||||||
void putsMixerSource(xcoord_t x, uint8_t y, uint8_t idx, LcdFlags att=0);
|
void putsMixerSource(coord_t x, coord_t y, uint8_t idx, LcdFlags att=0);
|
||||||
void putsFlightMode(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att=0);
|
void putsFlightMode(coord_t x, coord_t y, int8_t idx, LcdFlags att=0);
|
||||||
#if defined(PCBTARANIS) && !defined(BOOT)
|
#if defined(PCBTARANIS) && !defined(BOOT)
|
||||||
void putsCurveRef(xcoord_t x, uint8_t y, CurveRef &curve, LcdFlags att);
|
void putsCurveRef(coord_t x, coord_t y, CurveRef &curve, LcdFlags att);
|
||||||
#endif
|
#endif
|
||||||
void putsCurve(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att=0);
|
void putsCurve(coord_t x, coord_t y, int8_t idx, LcdFlags att=0);
|
||||||
void putsTimerMode(xcoord_t x, uint8_t y, int8_t mode, LcdFlags att=0);
|
void putsTimerMode(coord_t x, coord_t y, int8_t mode, LcdFlags att=0);
|
||||||
void putsTrimMode(xcoord_t x, uint8_t y, uint8_t phase, uint8_t idx, LcdFlags att);
|
void putsTrimMode(coord_t x, coord_t y, uint8_t phase, uint8_t idx, LcdFlags att);
|
||||||
#if defined(ROTARY_ENCODERS)
|
#if defined(ROTARY_ENCODERS)
|
||||||
void putsRotaryEncoderMode(xcoord_t x, uint8_t y, uint8_t phase, uint8_t idx, LcdFlags att);
|
void putsRotaryEncoderMode(coord_t x, coord_t y, uint8_t phase, uint8_t idx, LcdFlags att);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define putsChn(x, y, idx, att) putsMixerSource(x, y, MIXSRC_CH1+idx-1, att)
|
#define putsChn(x, y, idx, att) putsMixerSource(x, y, MIXSRC_CH1+idx-1, att)
|
||||||
void putsChnLetter(xcoord_t x, uint8_t y, uint8_t idx, LcdFlags attr);
|
void putsChnLetter(coord_t x, coord_t y, uint8_t idx, LcdFlags attr);
|
||||||
|
|
||||||
void putsVolts(xcoord_t x, uint8_t y, uint16_t volts, LcdFlags att);
|
void putsVolts(coord_t x, coord_t y, uint16_t volts, LcdFlags att);
|
||||||
void putsVBat(xcoord_t x, uint8_t y, LcdFlags att);
|
void putsVBat(coord_t x, coord_t y, LcdFlags att);
|
||||||
void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val, LcdFlags att=0);
|
void putsTelemetryChannel(coord_t x, coord_t y, uint8_t channel, lcdint_t val, LcdFlags att=0);
|
||||||
|
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
#define putstime_t int32_t
|
#define putstime_t int32_t
|
||||||
|
@ -215,31 +224,33 @@ void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val,
|
||||||
#define putstime_t int16_t
|
#define putstime_t int16_t
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void putsRtcTime(xcoord_t x, uint8_t y, LcdFlags att);
|
void putsRtcTime(coord_t x, coord_t y, LcdFlags att);
|
||||||
void putsTimer(xcoord_t x, uint8_t y, putstime_t tme, LcdFlags att, LcdFlags att2);
|
void putsTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2);
|
||||||
|
|
||||||
#define SOLID 0xff
|
#define SOLID 0xff
|
||||||
#define DOTTED 0x55
|
#define DOTTED 0x55
|
||||||
|
|
||||||
void lcd_plot(xcoord_t x, uint8_t y, LcdFlags att=0);
|
void lcd_plot(coord_t x, coord_t y, LcdFlags att=0);
|
||||||
void lcd_mask(uint8_t *p, uint8_t mask, LcdFlags att=0);
|
void lcd_mask(uint8_t *p, uint8_t mask, LcdFlags att=0);
|
||||||
void lcd_hline(xcoord_t x, uint8_t y, xcoord_t w, LcdFlags att=0);
|
void lcd_hline(coord_t x, coord_t y, coord_t w, LcdFlags att=0);
|
||||||
void lcd_hlineStip(xcoord_t x, uint8_t y, xcoord_t w, uint8_t pat, LcdFlags att=0);
|
void lcd_hlineStip(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlags att=0);
|
||||||
void lcd_vline(xcoord_t x, int8_t y, int8_t h);
|
void lcd_vline(coord_t x, scoord_t y, scoord_t h);
|
||||||
#if defined(CPUM64)
|
#if defined(CPUM64)
|
||||||
void lcd_vlineStip(xcoord_t x, int8_t y, int8_t h, uint8_t pat);
|
void lcd_vlineStip(coord_t x, scoord_t y, int8_t h, uint8_t pat);
|
||||||
#else
|
#else
|
||||||
void lcd_vlineStip(xcoord_t x, int8_t y, int8_t h, uint8_t pat, LcdFlags att=0);
|
void lcd_vlineStip(coord_t x, scoord_t y, scoord_t h, uint8_t pat, LcdFlags att=0);
|
||||||
#endif
|
|
||||||
#if defined(CPUARM)
|
|
||||||
void lcd_line(xcoord_t x1, int8_t y1, xcoord_t x2, int8_t y2, uint8_t pat=SOLID, LcdFlags att=0);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void lcd_rect(xcoord_t x, uint8_t y, xcoord_t w, uint8_t h, uint8_t pat=SOLID, LcdFlags att=0);
|
#if defined(CPUARM)
|
||||||
void lcd_filled_rect(xcoord_t x, int8_t y, xcoord_t w, uint8_t h, uint8_t pat=SOLID, LcdFlags att=0);
|
void lcd_line(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat=SOLID, LcdFlags att=0);
|
||||||
void lcd_invert_line(int8_t y);
|
#endif
|
||||||
|
|
||||||
|
void lcd_filled_rect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_t pat=SOLID, LcdFlags att=0);
|
||||||
|
void lcd_rect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat=SOLID, LcdFlags att=0);
|
||||||
|
|
||||||
|
void lcd_invert_line(int8_t line);
|
||||||
#define lcd_status_line() lcd_invert_line(LCD_LINES-1)
|
#define lcd_status_line() lcd_invert_line(LCD_LINES-1)
|
||||||
inline void lcd_square(xcoord_t x, uint8_t y, xcoord_t w, LcdFlags att=0) { lcd_rect(x, y, w, w, SOLID, att); }
|
inline void lcd_square(coord_t x, coord_t y, coord_t w, LcdFlags att=0) { lcd_rect(x, y, w, w, SOLID, att); }
|
||||||
|
|
||||||
void lcdDrawTelemetryTopBar();
|
void lcdDrawTelemetryTopBar();
|
||||||
|
|
||||||
|
@ -251,16 +262,9 @@ void lcdDrawTelemetryTopBar();
|
||||||
lcd_vline(xx-1,yy-ll,ll); \
|
lcd_vline(xx-1,yy-ll,ll); \
|
||||||
lcd_vline(xx ,yy-ll,ll); \
|
lcd_vline(xx ,yy-ll,ll); \
|
||||||
lcd_vline(xx+1,yy-ll,ll);
|
lcd_vline(xx+1,yy-ll,ll);
|
||||||
/*
|
|
||||||
#define LCD_2DOTS(x, y, att) \
|
void lcd_img(coord_t x, coord_t y, const pm_uchar * img, uint8_t idx, LcdFlags att=0);
|
||||||
lcd_putcAtt(x, y, ' ', att); \
|
void lcd_bmp(coord_t x, coord_t y, const pm_uchar * img, uint8_t offset=0, uint8_t width=0);
|
||||||
lcd_vline(x+4, y+3, 2); \
|
|
||||||
lcd_vline(x+5, y+3, 2); \
|
|
||||||
lcd_vline(x+4, y+8, 2); \
|
|
||||||
lcd_vline(x+5, y+8, 2);
|
|
||||||
*/
|
|
||||||
void lcd_img(xcoord_t x, uint8_t y, const pm_uchar * img, uint8_t idx, LcdFlags att=0);
|
|
||||||
void lcd_bmp(xcoord_t x, uint8_t y, const pm_uchar * img, uint8_t offset=0, uint8_t width=0);
|
|
||||||
#define LCD_ICON(x, y, icon) lcd_bmp(x, y, icons, icon)
|
#define LCD_ICON(x, y, icon) lcd_bmp(x, y, icons, icon)
|
||||||
void lcdSetRefVolt(unsigned char val);
|
void lcdSetRefVolt(unsigned char val);
|
||||||
void lcdInit();
|
void lcdInit();
|
||||||
|
@ -276,7 +280,7 @@ void lcdSetContrast();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
const pm_char * bmpLoad(uint8_t *dest, const char *filename, const xcoord_t width, const uint8_t height);
|
const pm_char * bmpLoad(uint8_t *dest, const char *filename, const unsigned int width, const unsigned int height);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(BOOT)
|
#if defined(BOOT)
|
||||||
|
@ -287,7 +291,7 @@ void lcdSetContrast();
|
||||||
|
|
||||||
#ifdef SIMU
|
#ifdef SIMU
|
||||||
extern bool lcd_refresh;
|
extern bool lcd_refresh;
|
||||||
extern uint8_t lcd_buf[DISPLAY_BUF_SIZE];
|
extern display_t lcd_buf[DISPLAY_BUF_SIZE];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(LUA)
|
#if defined(LUA)
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
#include "opentx.h"
|
#include "opentx.h"
|
||||||
|
|
||||||
uint8_t displayBuf[DISPLAY_BUF_SIZE];
|
display_t displayBuf[DISPLAY_BUF_SIZE];
|
||||||
|
|
||||||
#if defined(LUA)
|
#if defined(LUA)
|
||||||
bool lcd_locked = false;
|
bool lcd_locked = false;
|
||||||
|
@ -47,11 +47,11 @@ void lcd_clear()
|
||||||
memset(displayBuf, 0, sizeof(displayBuf));
|
memset(displayBuf, 0, sizeof(displayBuf));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t lcdLastPos;
|
coord_t lcdLastPos;
|
||||||
uint8_t lcdNextPos;
|
coord_t lcdNextPos;
|
||||||
|
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
void lcdPutPattern(xcoord_t x, uint8_t y, const uint8_t * pattern, uint8_t width, uint8_t height, LcdFlags flags)
|
void lcdPutPattern(coord_t x, coord_t y, const uint8_t * pattern, uint8_t width, uint8_t height, LcdFlags flags)
|
||||||
{
|
{
|
||||||
bool blink = false;
|
bool blink = false;
|
||||||
bool inv = false;
|
bool inv = false;
|
||||||
|
@ -114,6 +114,7 @@ void lcdPutPattern(xcoord_t x, uint8_t y, const uint8_t * pattern, uint8_t width
|
||||||
plot = false;
|
plot = false;
|
||||||
if (height >= 12) continue;
|
if (height >= 12) continue;
|
||||||
if (j<0 && !inv) continue;
|
if (j<0 && !inv) continue;
|
||||||
|
if (y+j < 0) continue;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uint8_t line = (j / 8);
|
uint8_t line = (j / 8);
|
||||||
|
@ -132,16 +133,17 @@ void lcdPutPattern(xcoord_t x, uint8_t y, const uint8_t * pattern, uint8_t width
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags)
|
void lcd_putcAtt(coord_t x, coord_t y, const unsigned char c, LcdFlags flags)
|
||||||
{
|
{
|
||||||
const pm_uchar * q;
|
const pm_uchar * q;
|
||||||
|
uint32_t fontsize = FONTSIZE(flags);
|
||||||
|
|
||||||
lcdNextPos = x-1;
|
lcdNextPos = x-1;
|
||||||
|
|
||||||
#if !defined(BOOT)
|
#if !defined(BOOT)
|
||||||
unsigned char c_remapped = 0;
|
unsigned char c_remapped = 0;
|
||||||
|
|
||||||
if (flags & (DBLSIZE+BOLD)) {
|
if (fontsize == DBLSIZE || (flags&BOLD)) {
|
||||||
// To save space only some DBLSIZE and BOLD chars are available
|
// To save space only some DBLSIZE and BOLD chars are available
|
||||||
// c has to be remapped. All non existing chars mapped to 0 (space)
|
// c has to be remapped. All non existing chars mapped to 0 (space)
|
||||||
if (c>=',' && c<=':')
|
if (c>=',' && c<=':')
|
||||||
|
@ -156,7 +158,7 @@ void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags)
|
||||||
flags &= ~BOLD;
|
flags &= ~BOLD;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & DBLSIZE) {
|
if (fontsize == DBLSIZE) {
|
||||||
if (c >= 0xC0) {
|
if (c >= 0xC0) {
|
||||||
q = &font_10x14_extra[((uint16_t)(c-0xC0))*20];
|
q = &font_10x14_extra[((uint16_t)(c-0xC0))*20];
|
||||||
}
|
}
|
||||||
|
@ -167,19 +169,19 @@ void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags)
|
||||||
}
|
}
|
||||||
lcdPutPattern(x, y, q, 10, 16, flags);
|
lcdPutPattern(x, y, q, 10, 16, flags);
|
||||||
}
|
}
|
||||||
else if (flags & XXLSIZE) {
|
else if (fontsize == XXLSIZE) {
|
||||||
q = &font_22x38_num[((uint16_t)c-'0'+5)*110];
|
q = &font_22x38_num[((uint16_t)c-'0'+5)*110];
|
||||||
lcdPutPattern(x, y, q, 22, 38, flags);
|
lcdPutPattern(x, y, q, 22, 38, flags);
|
||||||
}
|
}
|
||||||
else if (flags & MIDSIZE) {
|
else if (fontsize == MIDSIZE) {
|
||||||
q = &font_8x10[((uint16_t)c-0x20)*16];
|
q = &font_8x10[((uint16_t)c-0x20)*16];
|
||||||
lcdPutPattern(x, y, q, 8, 12, flags);
|
lcdPutPattern(x, y, q, 8, 12, flags);
|
||||||
}
|
}
|
||||||
else if (flags & SMLSIZE) {
|
else if (fontsize == SMLSIZE) {
|
||||||
q = (c < 0xc0 ? &font_4x6[(c-0x20)*5] : &font_4x6_extra[(c-0xc0)*5]);
|
q = (c < 0xc0 ? &font_4x6[(c-0x20)*5] : &font_4x6_extra[(c-0xc0)*5]);
|
||||||
lcdPutPattern(x, y, q, 5, 7, flags);
|
lcdPutPattern(x, y, q, 5, 7, flags);
|
||||||
}
|
}
|
||||||
else if (flags & TINSIZE) {
|
else if (fontsize == TINSIZE) {
|
||||||
q = &font_3x5[((uint16_t)c-0x2d)*3];
|
q = &font_3x5[((uint16_t)c-0x2d)*3];
|
||||||
lcdPutPattern(x, y, q, 3, 5, flags);
|
lcdPutPattern(x, y, q, 3, 5, flags);
|
||||||
}
|
}
|
||||||
|
@ -202,21 +204,22 @@ void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void lcd_putc(xcoord_t x, uint8_t y, const unsigned char c)
|
void lcd_putc(coord_t x, coord_t y, const unsigned char c)
|
||||||
{
|
{
|
||||||
lcd_putcAtt(x, y, c, 0);
|
lcd_putcAtt(x, y, c, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_putsnAtt(xcoord_t x, uint8_t y, const pm_char * s, uint8_t len, LcdFlags mode)
|
void lcd_putsnAtt(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdFlags flags)
|
||||||
{
|
{
|
||||||
const xcoord_t orig_x = x;
|
const coord_t orig_x = x;
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
const uint8_t orig_len = len;
|
const uint8_t orig_len = len;
|
||||||
|
uint32_t fontsize = FONTSIZE(flags);
|
||||||
#endif
|
#endif
|
||||||
bool setx = false;
|
bool setx = false;
|
||||||
while (len--) {
|
while (len--) {
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
switch (mode & (BSS+ZCHAR)) {
|
switch (flags & (BSS+ZCHAR)) {
|
||||||
case BSS:
|
case BSS:
|
||||||
c = *s;
|
c = *s;
|
||||||
break;
|
break;
|
||||||
|
@ -238,7 +241,7 @@ void lcd_putsnAtt(xcoord_t x, uint8_t y, const pm_char * s, uint8_t len, LcdFlag
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (c >= 0x20) {
|
else if (c >= 0x20) {
|
||||||
lcd_putcAtt(x, y, c, mode);
|
lcd_putcAtt(x, y, c, flags);
|
||||||
x = lcdNextPos;
|
x = lcdNextPos;
|
||||||
}
|
}
|
||||||
else if (setx) {
|
else if (setx) {
|
||||||
|
@ -255,9 +258,12 @@ void lcd_putsnAtt(xcoord_t x, uint8_t y, const pm_char * s, uint8_t len, LcdFlag
|
||||||
x = orig_x;
|
x = orig_x;
|
||||||
y += FH;
|
y += FH;
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
if (mode & DBLSIZE) y += FH;
|
if (fontsize == DBLSIZE)
|
||||||
else if (mode & MIDSIZE) y += 4;
|
y += FH;
|
||||||
else if (mode & SMLSIZE) y--;
|
else if (fontsize == MIDSIZE)
|
||||||
|
y += 4;
|
||||||
|
else if (fontsize == SMLSIZE)
|
||||||
|
y--;
|
||||||
#endif
|
#endif
|
||||||
if (y >= LCD_H) break;
|
if (y >= LCD_H) break;
|
||||||
}
|
}
|
||||||
|
@ -275,40 +281,40 @@ void lcd_putsnAtt(xcoord_t x, uint8_t y, const pm_char * s, uint8_t len, LcdFlag
|
||||||
lcdLastPos = x;
|
lcdLastPos = x;
|
||||||
lcdNextPos = x;
|
lcdNextPos = x;
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
if (mode&MIDSIZE)
|
if (fontsize == MIDSIZE)
|
||||||
lcdLastPos += 1;
|
lcdLastPos += 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_putsn(xcoord_t x, uint8_t y, const pm_char * s, uint8_t len)
|
void lcd_putsn(coord_t x, coord_t y, const pm_char * s, uint8_t len)
|
||||||
{
|
{
|
||||||
lcd_putsnAtt(x, y, s, len, 0);
|
lcd_putsnAtt(x, y, s, len, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_putsAtt(xcoord_t x, uint8_t y, const pm_char * s, LcdFlags flags)
|
void lcd_putsAtt(coord_t x, coord_t y, const pm_char * s, LcdFlags flags)
|
||||||
{
|
{
|
||||||
lcd_putsnAtt(x, y, s, 255, flags);
|
lcd_putsnAtt(x, y, s, 255, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_puts(xcoord_t x, uint8_t y, const pm_char * s)
|
void lcd_puts(coord_t x, coord_t y, const pm_char * s)
|
||||||
{
|
{
|
||||||
lcd_putsAtt(x, y, s, 0);
|
lcd_putsAtt(x, y, s, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_putsLeft(uint8_t y, const pm_char * s)
|
void lcd_putsLeft(coord_t y, const pm_char * s)
|
||||||
{
|
{
|
||||||
lcd_puts(0, y, s);
|
lcd_puts(0, y, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(BOOT)
|
#if !defined(BOOT)
|
||||||
void lcd_putsiAtt(xcoord_t x, uint8_t y,const pm_char * s,uint8_t idx, LcdFlags flags)
|
void lcd_putsiAtt(coord_t x, coord_t y, const pm_char * s,uint8_t idx, LcdFlags flags)
|
||||||
{
|
{
|
||||||
uint8_t length;
|
uint8_t length;
|
||||||
length = pgm_read_byte(s++);
|
length = pgm_read_byte(s++);
|
||||||
lcd_putsnAtt(x, y, s+length*idx, length, flags & ~(BSS|ZCHAR));
|
lcd_putsnAtt(x, y, s+length*idx, length, flags & ~(BSS|ZCHAR));
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_outhex4(xcoord_t x, uint8_t y, uint16_t val)
|
void lcd_outhex4(coord_t x, coord_t y, uint16_t val)
|
||||||
{
|
{
|
||||||
x += FWNUM*4+1;
|
x += FWNUM*4+1;
|
||||||
for(int i=0; i<4; i++) {
|
for(int i=0; i<4; i++) {
|
||||||
|
@ -320,28 +326,30 @@ void lcd_outhex4(xcoord_t x, uint8_t y, uint16_t val)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_outdez8(xcoord_t x, uint8_t y, int8_t val)
|
void lcd_outdez8(coord_t x, coord_t y, int8_t val)
|
||||||
{
|
{
|
||||||
lcd_outdezAtt(x, y, val);
|
lcd_outdezAtt(x, y, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_outdezAtt(xcoord_t x, uint8_t y, lcdint_t val, LcdFlags flags)
|
void lcd_outdezAtt(coord_t x, coord_t y, lcdint_t val, LcdFlags flags)
|
||||||
{
|
{
|
||||||
lcd_outdezNAtt(x, y, val, flags);
|
lcd_outdezNAtt(x, y, val, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_outdezNAtt(xcoord_t x, uint8_t y, lcdint_t val, LcdFlags flags, uint8_t len)
|
void lcd_outdezNAtt(coord_t x, coord_t y, lcdint_t val, LcdFlags flags, uint8_t len)
|
||||||
{
|
{
|
||||||
uint8_t fw = FWNUM;
|
uint8_t fw = FWNUM;
|
||||||
int8_t mode = MODE(flags);
|
int8_t mode = MODE(flags);
|
||||||
flags &= ~LEADING0;
|
flags &= ~LEADING0;
|
||||||
bool dblsize = flags & DBLSIZE;
|
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
bool xxlsize = flags & XXLSIZE;
|
uint32_t fontsize = FONTSIZE(flags);
|
||||||
bool midsize = flags & MIDSIZE;
|
bool dblsize = (fontsize == DBLSIZE);
|
||||||
bool smlsize = flags & SMLSIZE;
|
bool xxlsize = (fontsize == XXLSIZE);
|
||||||
bool tinsize = flags & TINSIZE;
|
bool midsize = (fontsize == MIDSIZE);
|
||||||
|
bool smlsize = (fontsize == SMLSIZE);
|
||||||
|
bool tinsize = (fontsize == TINSIZE);
|
||||||
#else
|
#else
|
||||||
|
bool dblsize = flags & DBLSIZE;
|
||||||
#define xxlsize 0
|
#define xxlsize 0
|
||||||
#define midsize 0
|
#define midsize 0
|
||||||
#define smlsize 0
|
#define smlsize 0
|
||||||
|
@ -357,7 +365,7 @@ void lcd_outdezNAtt(xcoord_t x, uint8_t y, lcdint_t val, LcdFlags flags, uint8_t
|
||||||
val = -val;
|
val = -val;
|
||||||
}
|
}
|
||||||
|
|
||||||
xcoord_t xn = 0;
|
coord_t xn = 0;
|
||||||
uint8_t ln = 2;
|
uint8_t ln = 2;
|
||||||
|
|
||||||
if (mode != MODE(LEADING0)) {
|
if (mode != MODE(LEADING0)) {
|
||||||
|
@ -488,13 +496,13 @@ void lcd_outdezNAtt(xcoord_t x, uint8_t y, lcdint_t val, LcdFlags flags, uint8_t
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void lcd_hline(xcoord_t x, uint8_t y, xcoord_t w, LcdFlags att)
|
void lcd_hline(coord_t x, coord_t y, coord_t w, LcdFlags att)
|
||||||
{
|
{
|
||||||
lcd_hlineStip(x, y, w, 0xff, att);
|
lcd_hlineStip(x, y, w, 0xff, att);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
void lcd_line(xcoord_t x1, int8_t y1, xcoord_t x2, int8_t y2, uint8_t pat, LcdFlags att)
|
void lcd_line(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat, LcdFlags att)
|
||||||
{
|
{
|
||||||
int dx = x2-x1; /* the horizontal distance of the line */
|
int dx = x2-x1; /* the horizontal distance of the line */
|
||||||
int dy = y2-y1; /* the vertical distance of the line */
|
int dy = y2-y1; /* the vertical distance of the line */
|
||||||
|
@ -536,12 +544,12 @@ void lcd_line(xcoord_t x1, int8_t y1, xcoord_t x2, int8_t y2, uint8_t pat, LcdFl
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void lcd_vline(xcoord_t x, int8_t y, int8_t h)
|
void lcd_vline(coord_t x, scoord_t y, scoord_t h)
|
||||||
{
|
{
|
||||||
lcd_vlineStip(x, y, h, SOLID);
|
lcd_vlineStip(x, y, h, SOLID);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_rect(xcoord_t x, uint8_t y, xcoord_t w, uint8_t h, uint8_t pat, LcdFlags att)
|
void lcd_rect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat, LcdFlags att)
|
||||||
{
|
{
|
||||||
lcd_vlineStip(x, y, h, pat);
|
lcd_vlineStip(x, y, h, pat);
|
||||||
lcd_vlineStip(x+w-1, y, h, pat);
|
lcd_vlineStip(x+w-1, y, h, pat);
|
||||||
|
@ -551,15 +559,15 @@ void lcd_rect(xcoord_t x, uint8_t y, xcoord_t w, uint8_t h, uint8_t pat, LcdFlag
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(BOOT)
|
#if !defined(BOOT)
|
||||||
void lcd_filled_rect(xcoord_t x, int8_t y, xcoord_t w, uint8_t h, uint8_t pat, LcdFlags att)
|
void lcd_filled_rect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_t pat, LcdFlags att)
|
||||||
{
|
{
|
||||||
#if defined(CPUM64)
|
#if defined(CPUM64)
|
||||||
for (int8_t i=y; i<y+h; i++) {
|
for (scoord_t i=y; i<y+h; i++) {
|
||||||
lcd_hlineStip(x, i, w, pat, att);
|
lcd_hlineStip(x, i, w, pat, att);
|
||||||
pat = (pat >> 1) + ((pat & 1) << 7);
|
pat = (pat >> 1) + ((pat & 1) << 7);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
for (int8_t i=y; i<y+h; i++) {
|
for (scoord_t i=y; i<y+h; i++) {
|
||||||
if ((att&ROUND) && (i==y || i==y+h-1))
|
if ((att&ROUND) && (i==y || i==y+h-1))
|
||||||
lcd_hlineStip(x+1, i, w-2, pat, att);
|
lcd_hlineStip(x+1, i, w-2, pat, att);
|
||||||
else
|
else
|
||||||
|
@ -602,13 +610,13 @@ void lcdDrawTelemetryTopBar()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CPUARM) && defined(RTCLOCK)
|
#if defined(CPUARM) && defined(RTCLOCK)
|
||||||
void putsRtcTime(xcoord_t x, uint8_t y, LcdFlags att)
|
void putsRtcTime(coord_t x, coord_t y, LcdFlags att)
|
||||||
{
|
{
|
||||||
putsTimer(x, y, getValue(MIXSRC_FIRST_TELEM-1+TELEM_TX_TIME), att, att);
|
putsTimer(x, y, getValue(MIXSRC_FIRST_TELEM-1+TELEM_TX_TIME), att, att);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void putsTimer(xcoord_t x, uint8_t y, putstime_t tme, LcdFlags att, LcdFlags att2)
|
void putsTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2)
|
||||||
{
|
{
|
||||||
div_t qr;
|
div_t qr;
|
||||||
|
|
||||||
|
@ -660,24 +668,24 @@ void putsTimer(xcoord_t x, uint8_t y, putstime_t tme, LcdFlags att, LcdFlags att
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO to be optimized with putsTelemetryValue
|
// TODO to be optimized with putsTelemetryValue
|
||||||
void putsVolts(xcoord_t x, uint8_t y, uint16_t volts, LcdFlags att)
|
void putsVolts(coord_t x, coord_t y, uint16_t volts, LcdFlags att)
|
||||||
{
|
{
|
||||||
lcd_outdezAtt(x, y, (int16_t)volts, (~NO_UNIT) & (att | ((att&PREC2)==PREC2 ? 0 : PREC1)));
|
lcd_outdezAtt(x, y, (int16_t)volts, (~NO_UNIT) & (att | ((att&PREC2)==PREC2 ? 0 : PREC1)));
|
||||||
if (~att & NO_UNIT) lcd_putcAtt(lcdLastPos, y, 'v', att);
|
if (~att & NO_UNIT) lcd_putcAtt(lcdLastPos, y, 'v', att);
|
||||||
}
|
}
|
||||||
|
|
||||||
void putsVBat(xcoord_t x, uint8_t y, LcdFlags att)
|
void putsVBat(coord_t x, coord_t y, LcdFlags att)
|
||||||
{
|
{
|
||||||
putsVolts(x, y, g_vbat100mV, att);
|
putsVolts(x, y, g_vbat100mV, att);
|
||||||
}
|
}
|
||||||
|
|
||||||
void putsStrIdx(xcoord_t x, uint8_t y, const pm_char *str, uint8_t idx, LcdFlags att)
|
void putsStrIdx(coord_t x, coord_t y, const pm_char *str, uint8_t idx, LcdFlags att)
|
||||||
{
|
{
|
||||||
lcd_putsAtt(x, y, str, att & ~LEADING0);
|
lcd_putsAtt(x, y, str, att & ~LEADING0);
|
||||||
lcd_outdezNAtt(lcdNextPos, y, idx, att|LEFT, 2);
|
lcd_outdezNAtt(lcdNextPos, y, idx, att|LEFT, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void putsMixerSource(xcoord_t x, uint8_t y, uint8_t idx, LcdFlags att)
|
void putsMixerSource(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
||||||
{
|
{
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
if (idx == 0) {
|
if (idx == 0) {
|
||||||
|
@ -742,12 +750,12 @@ void putsMixerSource(xcoord_t x, uint8_t y, uint8_t idx, LcdFlags att)
|
||||||
lcd_putsiAtt(x, y, STR_VTELEMCHNS, idx-MIXSRC_FIRST_TELEM+1, att);
|
lcd_putsiAtt(x, y, STR_VTELEMCHNS, idx-MIXSRC_FIRST_TELEM+1, att);
|
||||||
}
|
}
|
||||||
|
|
||||||
void putsChnLetter(xcoord_t x, uint8_t y, uint8_t idx, LcdFlags att)
|
void putsChnLetter(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
||||||
{
|
{
|
||||||
lcd_putsiAtt(x, y, STR_RETA123, idx-1, att);
|
lcd_putsiAtt(x, y, STR_RETA123, idx-1, att);
|
||||||
}
|
}
|
||||||
|
|
||||||
void putsModelName(xcoord_t x, uint8_t y, char *name, uint8_t id, LcdFlags att)
|
void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att)
|
||||||
{
|
{
|
||||||
uint8_t len = sizeof(g_model.header.name);
|
uint8_t len = sizeof(g_model.header.name);
|
||||||
while (len>0 && !name[len-1]) --len;
|
while (len>0 && !name[len-1]) --len;
|
||||||
|
@ -759,7 +767,7 @@ void putsModelName(xcoord_t x, uint8_t y, char *name, uint8_t id, LcdFlags att)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void putsSwitches(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att)
|
void putsSwitches(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
||||||
{
|
{
|
||||||
if (idx == SWSRC_OFF)
|
if (idx == SWSRC_OFF)
|
||||||
return lcd_putsiAtt(x, y, STR_OFFON, 0, att);
|
return lcd_putsiAtt(x, y, STR_OFFON, 0, att);
|
||||||
|
@ -776,7 +784,7 @@ void putsSwitches(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FLIGHT_MODES)
|
#if defined(FLIGHT_MODES)
|
||||||
void putsFlightMode(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att)
|
void putsFlightMode(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
||||||
{
|
{
|
||||||
if (idx==0) { lcd_putsiAtt(x, y, STR_MMMINV, 0, att); return; }
|
if (idx==0) { lcd_putsiAtt(x, y, STR_MMMINV, 0, att); return; }
|
||||||
if (idx < 0) { lcd_putcAtt(x-2, y, '!', att); idx = -idx; }
|
if (idx < 0) { lcd_putcAtt(x-2, y, '!', att); idx = -idx; }
|
||||||
|
@ -788,7 +796,7 @@ void putsFlightMode(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
void putsCurveRef(xcoord_t x, uint8_t y, CurveRef &curve, LcdFlags att)
|
void putsCurveRef(coord_t x, coord_t y, CurveRef &curve, LcdFlags att)
|
||||||
{
|
{
|
||||||
if (curve.value != 0) {
|
if (curve.value != 0) {
|
||||||
switch (curve.type) {
|
switch (curve.type) {
|
||||||
|
@ -813,7 +821,7 @@ void putsCurveRef(xcoord_t x, uint8_t y, CurveRef &curve, LcdFlags att)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void putsCurve(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att)
|
void putsCurve(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
||||||
{
|
{
|
||||||
if (idx == 0) {
|
if (idx == 0) {
|
||||||
return lcd_putsiAtt(x, y, STR_MMMINV, 0, att);
|
return lcd_putsiAtt(x, y, STR_MMMINV, 0, att);
|
||||||
|
@ -827,7 +835,7 @@ void putsCurve(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att)
|
||||||
putsStrIdx(x, y, STR_CV, idx, att);
|
putsStrIdx(x, y, STR_CV, idx, att);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void putsCurve(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att)
|
void putsCurve(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
||||||
{
|
{
|
||||||
if (idx < 0) {
|
if (idx < 0) {
|
||||||
lcd_putcAtt(x-1*FW, y, '!', att);
|
lcd_putcAtt(x-1*FW, y, '!', att);
|
||||||
|
@ -840,7 +848,7 @@ void putsCurve(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void putsTimerMode(xcoord_t x, uint8_t y, int8_t mode, LcdFlags att)
|
void putsTimerMode(coord_t x, coord_t y, int8_t mode, LcdFlags att)
|
||||||
{
|
{
|
||||||
if (mode >= 0) {
|
if (mode >= 0) {
|
||||||
if (mode < TMRMODE_COUNT)
|
if (mode < TMRMODE_COUNT)
|
||||||
|
@ -852,7 +860,7 @@ void putsTimerMode(xcoord_t x, uint8_t y, int8_t mode, LcdFlags att)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
void putsTrimMode(xcoord_t x, uint8_t y, uint8_t phase, uint8_t idx, LcdFlags att)
|
void putsTrimMode(coord_t x, coord_t y, uint8_t phase, uint8_t idx, LcdFlags att)
|
||||||
{
|
{
|
||||||
trim_t v = getRawTrimValue(phase, idx);
|
trim_t v = getRawTrimValue(phase, idx);
|
||||||
unsigned int mode = v.mode;
|
unsigned int mode = v.mode;
|
||||||
|
@ -870,7 +878,7 @@ void putsTrimMode(xcoord_t x, uint8_t y, uint8_t phase, uint8_t idx, LcdFlags at
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void putsTrimMode(xcoord_t x, uint8_t y, uint8_t phase, uint8_t idx, LcdFlags att)
|
void putsTrimMode(coord_t x, coord_t y, uint8_t phase, uint8_t idx, LcdFlags att)
|
||||||
{
|
{
|
||||||
trim_t v = getRawTrimValue(phase, idx);
|
trim_t v = getRawTrimValue(phase, idx);
|
||||||
|
|
||||||
|
@ -886,7 +894,7 @@ void putsTrimMode(xcoord_t x, uint8_t y, uint8_t phase, uint8_t idx, LcdFlags at
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ROTARY_ENCODERS > 0
|
#if ROTARY_ENCODERS > 0
|
||||||
void putsRotaryEncoderMode(xcoord_t x, uint8_t y, uint8_t phase, uint8_t idx, LcdFlags att)
|
void putsRotaryEncoderMode(coord_t x, coord_t y, uint8_t phase, uint8_t idx, LcdFlags att)
|
||||||
{
|
{
|
||||||
int16_t v = flightModeAddress(phase)->rotaryEncoders[idx];
|
int16_t v = flightModeAddress(phase)->rotaryEncoders[idx];
|
||||||
|
|
||||||
|
@ -902,7 +910,7 @@ void putsRotaryEncoderMode(xcoord_t x, uint8_t y, uint8_t phase, uint8_t idx, Lc
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(FRSKY) || defined(CPUARM)
|
#if defined(FRSKY) || defined(CPUARM)
|
||||||
void putsTelemetryValue(xcoord_t x, uint8_t y, lcdint_t val, uint8_t unit, LcdFlags att)
|
void putsTelemetryValue(coord_t x, coord_t y, lcdint_t val, uint8_t unit, LcdFlags att)
|
||||||
{
|
{
|
||||||
convertUnit(val, unit);
|
convertUnit(val, unit);
|
||||||
lcd_outdezAtt(x, y, val, att & (~NO_UNIT));
|
lcd_outdezAtt(x, y, val, att & (~NO_UNIT));
|
||||||
|
@ -922,7 +930,7 @@ const pm_uint8_t bchunit_ar[] PROGMEM = {
|
||||||
UNIT_DIST, // GPS Alt
|
UNIT_DIST, // GPS Alt
|
||||||
};
|
};
|
||||||
|
|
||||||
void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val, LcdFlags att)
|
void putsTelemetryChannel(coord_t x, coord_t y, uint8_t channel, lcdint_t val, LcdFlags att)
|
||||||
{
|
{
|
||||||
switch (channel) {
|
switch (channel) {
|
||||||
#if defined(CPUARM) && defined(RTCLOCK)
|
#if defined(CPUARM) && defined(RTCLOCK)
|
||||||
|
@ -1064,7 +1072,7 @@ void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else // defined(FRSKY)
|
#else // defined(FRSKY)
|
||||||
void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val, uint8_t att)
|
void putsTelemetryChannel(coord_t x, coord_t y, uint8_t channel, lcdint_t val, uint8_t att)
|
||||||
{
|
{
|
||||||
switch (channel) {
|
switch (channel) {
|
||||||
case TELEM_TIMER1-1:
|
case TELEM_TIMER1-1:
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#define LCD_BYTE_FILTER(p, keep, add) *(p) = (*(p) & (keep)) | (add)
|
#define LCD_BYTE_FILTER(p, keep, add) *(p) = (*(p) & (keep)) | (add)
|
||||||
|
|
||||||
#if !defined(CPUARM)
|
#if !defined(CPUARM)
|
||||||
void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags)
|
void lcd_putcAtt(coord_t x, uint8_t y, const unsigned char c, LcdFlags flags)
|
||||||
{
|
{
|
||||||
uint8_t *p = &displayBuf[ y / 8 * LCD_W + x ];
|
uint8_t *p = &displayBuf[ y / 8 * LCD_W + x ];
|
||||||
const pm_uchar *q = &font_5x7[(c-0x20)*5];
|
const pm_uchar *q = &font_5x7[(c-0x20)*5];
|
||||||
|
@ -202,14 +202,14 @@ void lcd_mask(uint8_t *p, uint8_t mask, LcdFlags att)
|
||||||
*p ^= mask;
|
*p ^= mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_plot(xcoord_t x, uint8_t y, LcdFlags att)
|
void lcd_plot(coord_t x, coord_t y, LcdFlags att)
|
||||||
{
|
{
|
||||||
uint8_t *p = &displayBuf[ y / 8 * LCD_W + x ];
|
uint8_t *p = &displayBuf[ y / 8 * LCD_W + x ];
|
||||||
if (p<DISPLAY_END)
|
if (p<DISPLAY_END)
|
||||||
lcd_mask(p, BITMASK(y%8), att);
|
lcd_mask(p, BITMASK(y%8), att);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_hlineStip(xcoord_t x, uint8_t y, xcoord_t w, uint8_t pat, LcdFlags att)
|
void lcd_hlineStip(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlags att)
|
||||||
{
|
{
|
||||||
if (y >= LCD_H) return;
|
if (y >= LCD_H) return;
|
||||||
if (x+w > LCD_W) { w = LCD_W - x; }
|
if (x+w > LCD_W) { w = LCD_W - x; }
|
||||||
|
@ -229,7 +229,7 @@ void lcd_hlineStip(xcoord_t x, uint8_t y, xcoord_t w, uint8_t pat, LcdFlags att)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CPUM64)
|
#if defined(CPUM64)
|
||||||
void lcd_vlineStip(xcoord_t x, int8_t y, int8_t h, uint8_t pat)
|
void lcd_vlineStip(coord_t x, int8_t y, int8_t h, uint8_t pat)
|
||||||
{
|
{
|
||||||
if (x >= LCD_W) return;
|
if (x >= LCD_W) return;
|
||||||
if (h<0) { y+=h; h=-h; }
|
if (h<0) { y+=h; h=-h; }
|
||||||
|
@ -262,7 +262,7 @@ void lcd_vlineStip(xcoord_t x, int8_t y, int8_t h, uint8_t pat)
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// allows the att parameter...
|
// allows the att parameter...
|
||||||
void lcd_vlineStip(xcoord_t x, int8_t y, int8_t h, uint8_t pat, LcdFlags att)
|
void lcd_vlineStip(coord_t x, scoord_t y, scoord_t h, uint8_t pat, LcdFlags att)
|
||||||
{
|
{
|
||||||
if (x >= LCD_W) return;
|
if (x >= LCD_W) return;
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
|
@ -304,18 +304,18 @@ void lcd_vlineStip(xcoord_t x, int8_t y, int8_t h, uint8_t pat, LcdFlags att)
|
||||||
void lcd_invert_line(int8_t y)
|
void lcd_invert_line(int8_t y)
|
||||||
{
|
{
|
||||||
uint8_t *p = &displayBuf[y * LCD_W];
|
uint8_t *p = &displayBuf[y * LCD_W];
|
||||||
for (xcoord_t x=0; x<LCD_W; x++) {
|
for (coord_t x=0; x<LCD_W; x++) {
|
||||||
ASSERT_IN_DISPLAY(p);
|
ASSERT_IN_DISPLAY(p);
|
||||||
*p++ ^= 0xff;
|
*p++ ^= 0xff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(BOOT)
|
#if !defined(BOOT)
|
||||||
void lcd_img(xcoord_t x, uint8_t y, const pm_uchar * img, uint8_t idx, LcdFlags att)
|
void lcd_img(coord_t x, coord_t y, const pm_uchar * img, uint8_t idx, LcdFlags att)
|
||||||
{
|
{
|
||||||
const pm_uchar *q = img;
|
const pm_uchar *q = img;
|
||||||
#if LCD_W >= 260
|
#if LCD_W >= 260
|
||||||
xcoord_t w = pgm_read_byte(q++);
|
coord_t w = pgm_read_byte(q++);
|
||||||
if (w == 255) w += pgm_read_byte(q++);
|
if (w == 255) w += pgm_read_byte(q++);
|
||||||
#else
|
#else
|
||||||
uint8_t w = pgm_read_byte(q++);
|
uint8_t w = pgm_read_byte(q++);
|
||||||
|
@ -325,7 +325,7 @@ void lcd_img(xcoord_t x, uint8_t y, const pm_uchar * img, uint8_t idx, LcdFlags
|
||||||
q += idx*w*hb;
|
q += idx*w*hb;
|
||||||
for (uint8_t yb = 0; yb < hb; yb++) {
|
for (uint8_t yb = 0; yb < hb; yb++) {
|
||||||
uint8_t *p = &displayBuf[ (y / 8 + yb) * LCD_W + x ];
|
uint8_t *p = &displayBuf[ (y / 8 + yb) * LCD_W + x ];
|
||||||
for (xcoord_t i=0; i<w; i++){
|
for (coord_t i=0; i<w; i++){
|
||||||
uint8_t b = pgm_read_byte(q);
|
uint8_t b = pgm_read_byte(q);
|
||||||
q++;
|
q++;
|
||||||
ASSERT_IN_DISPLAY(p);
|
ASSERT_IN_DISPLAY(p);
|
||||||
|
|
|
@ -57,9 +57,9 @@ void lcd_mask(uint8_t *p, uint8_t mask, LcdFlags att)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PIXEL_GREY_MASK(y, att) (((y) & 1) ? (0xF0 - (GREY_MASK(att) >> 8)) : (0x0F - (GREY_MASK(att) >> 12)))
|
#define PIXEL_GREY_MASK(y, att) (((y) & 1) ? (0xF0 - (COLOUR_MASK(att) >> 12)) : (0x0F - (COLOUR_MASK(att) >> 16)))
|
||||||
|
|
||||||
void lcd_plot(xcoord_t x, uint8_t y, LcdFlags att)
|
void lcd_plot(coord_t x, coord_t y, LcdFlags att)
|
||||||
{
|
{
|
||||||
uint8_t *p = &displayBuf[ y / 2 * LCD_W + x ];
|
uint8_t *p = &displayBuf[ y / 2 * LCD_W + x ];
|
||||||
uint8_t mask = PIXEL_GREY_MASK(y, att);
|
uint8_t mask = PIXEL_GREY_MASK(y, att);
|
||||||
|
@ -68,7 +68,7 @@ void lcd_plot(xcoord_t x, uint8_t y, LcdFlags att)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_hlineStip(xcoord_t x, uint8_t y, xcoord_t w, uint8_t pat, LcdFlags att)
|
void lcd_hlineStip(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlags att)
|
||||||
{
|
{
|
||||||
if (y >= LCD_H) return;
|
if (y >= LCD_H) return;
|
||||||
if (x+w > LCD_W) { w = LCD_W - x; }
|
if (x+w > LCD_W) { w = LCD_W - x; }
|
||||||
|
@ -87,7 +87,7 @@ void lcd_hlineStip(xcoord_t x, uint8_t y, xcoord_t w, uint8_t pat, LcdFlags att)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_vlineStip(xcoord_t x, int8_t y, int8_t h, uint8_t pat, LcdFlags att)
|
void lcd_vlineStip(coord_t x, scoord_t y, scoord_t h, uint8_t pat, LcdFlags att)
|
||||||
{
|
{
|
||||||
if (x >= LCD_W) return;
|
if (x >= LCD_W) return;
|
||||||
if (y >= LCD_H) return;
|
if (y >= LCD_H) return;
|
||||||
|
@ -111,17 +111,17 @@ void lcd_vlineStip(xcoord_t x, int8_t y, int8_t h, uint8_t pat, LcdFlags att)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_invert_line(int8_t y)
|
void lcd_invert_line(int8_t line)
|
||||||
{
|
{
|
||||||
uint8_t *p = &displayBuf[y * 4 * LCD_W];
|
uint8_t *p = &displayBuf[line * 4 * LCD_W];
|
||||||
for (xcoord_t x=0; x<LCD_W*4; x++) {
|
for (coord_t x=0; x<LCD_W*4; x++) {
|
||||||
ASSERT_IN_DISPLAY(p);
|
ASSERT_IN_DISPLAY(p);
|
||||||
*p++ ^= 0xff;
|
*p++ ^= 0xff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(BOOT)
|
#if !defined(BOOT)
|
||||||
void lcd_img(xcoord_t x, uint8_t y, const pm_uchar * img, uint8_t idx, LcdFlags att)
|
void lcd_img(coord_t x, coord_t y, const pm_uchar * img, uint8_t idx, LcdFlags att)
|
||||||
{
|
{
|
||||||
const pm_uchar *q = img;
|
const pm_uchar *q = img;
|
||||||
uint8_t w = pgm_read_byte(q++);
|
uint8_t w = pgm_read_byte(q++);
|
||||||
|
@ -129,7 +129,7 @@ void lcd_img(xcoord_t x, uint8_t y, const pm_uchar * img, uint8_t idx, LcdFlags
|
||||||
bool inv = (att & INVERS) ? true : (att & BLINK ? BLINK_ON_PHASE : false);
|
bool inv = (att & INVERS) ? true : (att & BLINK ? BLINK_ON_PHASE : false);
|
||||||
q += idx*w*hb;
|
q += idx*w*hb;
|
||||||
for (uint8_t yb = 0; yb < hb; yb++) {
|
for (uint8_t yb = 0; yb < hb; yb++) {
|
||||||
for (xcoord_t i=0; i<w; i++) {
|
for (coord_t i=0; i<w; i++) {
|
||||||
uint8_t b = pgm_read_byte(q++);
|
uint8_t b = pgm_read_byte(q++);
|
||||||
uint8_t val = inv ? ~b : b;
|
uint8_t val = inv ? ~b : b;
|
||||||
for (int k=0; k<8; k++) {
|
for (int k=0; k<8; k++) {
|
||||||
|
@ -141,7 +141,7 @@ void lcd_img(xcoord_t x, uint8_t y, const pm_uchar * img, uint8_t idx, LcdFlags
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_bmp(xcoord_t x, uint8_t y, const pm_uchar * img, uint8_t offset, uint8_t width)
|
void lcd_bmp(coord_t x, coord_t y, const pm_uchar * img, uint8_t offset, uint8_t width)
|
||||||
{
|
{
|
||||||
const pm_uchar *q = img;
|
const pm_uchar *q = img;
|
||||||
uint8_t w = pgm_read_byte(q++);
|
uint8_t w = pgm_read_byte(q++);
|
||||||
|
@ -156,7 +156,7 @@ void lcd_bmp(xcoord_t x, uint8_t y, const pm_uchar * img, uint8_t offset, uint8_
|
||||||
for (uint8_t row=0; row<rows; row++) {
|
for (uint8_t row=0; row<rows; row++) {
|
||||||
q = img + 2 + row*w + offset;
|
q = img + 2 + row*w + offset;
|
||||||
uint8_t *p = &displayBuf[(row + (y/2)) * LCD_W + x];
|
uint8_t *p = &displayBuf[(row + (y/2)) * LCD_W + x];
|
||||||
for (xcoord_t i=0; i<width; i++) {
|
for (coord_t i=0; i<width; i++) {
|
||||||
uint8_t b = pgm_read_byte(q++);
|
uint8_t b = pgm_read_byte(q++);
|
||||||
if (y & 1) {
|
if (y & 1) {
|
||||||
*p = (*p & 0x0f) + ((b & 0x0f) << 4);
|
*p = (*p & 0x0f) + ((b & 0x0f) << 4);
|
||||||
|
|
|
@ -1225,31 +1225,29 @@ void message(const pm_char *title, const pm_char *t, const char *last MESSAGE_SO
|
||||||
|
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
lcd_bmp(0, 0, asterisk_lbm);
|
lcd_bmp(0, 0, asterisk_lbm);
|
||||||
#define TITLE_LCD_OFFSET 60
|
|
||||||
#define MESSAGE_LCD_OFFSET 60
|
#define MESSAGE_LCD_OFFSET 60
|
||||||
#else
|
#else
|
||||||
lcd_img(2, 0, asterisk_lbm, 0, 0);
|
lcd_img(2, 0, asterisk_lbm, 0, 0);
|
||||||
#define TITLE_LCD_OFFSET 6*FW
|
#define MESSAGE_LCD_OFFSET 6*FW
|
||||||
#define MESSAGE_LCD_OFFSET 0
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TRANSLATIONS_FR) || defined(TRANSLATIONS_IT) || defined(TRANSLATIONS_CZ)
|
#if defined(TRANSLATIONS_FR) || defined(TRANSLATIONS_IT) || defined(TRANSLATIONS_CZ)
|
||||||
lcd_putsAtt(TITLE_LCD_OFFSET, 0, STR_WARNING, DBLSIZE);
|
lcd_putsAtt(MESSAGE_LCD_OFFSET, 0, STR_WARNING, DBLSIZE);
|
||||||
lcd_putsAtt(TITLE_LCD_OFFSET, 2*FH, title, DBLSIZE);
|
lcd_putsAtt(MESSAGE_LCD_OFFSET, 2*FH, title, DBLSIZE);
|
||||||
#else
|
#else
|
||||||
lcd_putsAtt(TITLE_LCD_OFFSET, 0, title, DBLSIZE);
|
lcd_putsAtt(MESSAGE_LCD_OFFSET, 0, title, DBLSIZE);
|
||||||
lcd_putsAtt(TITLE_LCD_OFFSET, 2*FH, STR_WARNING, DBLSIZE);
|
lcd_putsAtt(MESSAGE_LCD_OFFSET, 2*FH, STR_WARNING, DBLSIZE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
lcd_filled_rect(60, 0, LCD_W-MESSAGE_LCD_OFFSET, 32);
|
lcd_filled_rect(MESSAGE_LCD_OFFSET, 0, LCD_W-MESSAGE_LCD_OFFSET, 32);
|
||||||
if (t) lcd_puts(MESSAGE_LCD_OFFSET, 5*FH, t);
|
if (t) lcd_puts(MESSAGE_LCD_OFFSET, 5*FH, t);
|
||||||
if (last) {
|
if (last) {
|
||||||
lcd_puts(MESSAGE_LCD_OFFSET, 7*FH, last);
|
lcd_puts(MESSAGE_LCD_OFFSET, 7*FH, last);
|
||||||
AUDIO_ERROR_MESSAGE(sound);
|
AUDIO_ERROR_MESSAGE(sound);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
lcd_filled_rect(0, 0, LCD_W-MESSAGE_LCD_OFFSET, 32);
|
lcd_filled_rect(0, 0, LCD_W, 32);
|
||||||
if (t) lcd_putsLeft(5*FH, t);
|
if (t) lcd_putsLeft(5*FH, t);
|
||||||
if (last) {
|
if (last) {
|
||||||
lcd_putsLeft(7*FH, last);
|
lcd_putsLeft(7*FH, last);
|
||||||
|
|
|
@ -42,6 +42,12 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#if defined(SIMU)
|
||||||
|
#define SWITCH_SIMU(a, b) (a)
|
||||||
|
#else
|
||||||
|
#define SWITCH_SIMU(a, b) (b)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(PCBSKY9X)
|
#if defined(PCBSKY9X)
|
||||||
#define IS_PCBSKY9X true
|
#define IS_PCBSKY9X true
|
||||||
#define CASE_PCBSKY9X(x) x,
|
#define CASE_PCBSKY9X(x) x,
|
||||||
|
@ -1568,7 +1574,7 @@ void checkFlashOnBeep();
|
||||||
|
|
||||||
#if defined(FRSKY) || defined(CPUARM)
|
#if defined(FRSKY) || defined(CPUARM)
|
||||||
void convertUnit(getvalue_t & val, uint8_t & unit); // TODO check FORCEINLINE on stock
|
void convertUnit(getvalue_t & val, uint8_t & unit); // TODO check FORCEINLINE on stock
|
||||||
void putsTelemetryValue(xcoord_t x, uint8_t y, lcdint_t val, uint8_t unit, LcdFlags att);
|
void putsTelemetryValue(coord_t x, coord_t y, lcdint_t val, uint8_t unit, LcdFlags att);
|
||||||
#else
|
#else
|
||||||
#define convertUnit(...)
|
#define convertUnit(...)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -70,10 +70,10 @@ class Open9xSim: public FXMainWindow
|
||||||
FXSlider *sliders[8];
|
FXSlider *sliders[8];
|
||||||
FXKnob *knobs[NUM_POTS];
|
FXKnob *knobs[NUM_POTS];
|
||||||
};
|
};
|
||||||
|
|
||||||
// Message Map
|
// Message Map
|
||||||
FXDEFMAP(Open9xSim) Open9xSimMap[] = {
|
FXDEFMAP(Open9xSim) Open9xSimMap[] = {
|
||||||
|
//Message_Type _________ ID____Message_Handler_______
|
||||||
//________Message_Type_________ID_____________________Message_Handler_______
|
|
||||||
FXMAPFUNC(SEL_TIMEOUT, 2, Open9xSim::onTimeout),
|
FXMAPFUNC(SEL_TIMEOUT, 2, Open9xSim::onTimeout),
|
||||||
FXMAPFUNC(SEL_KEYPRESS, 0, Open9xSim::onKeypress),
|
FXMAPFUNC(SEL_KEYPRESS, 0, Open9xSim::onKeypress),
|
||||||
};
|
};
|
||||||
|
@ -84,7 +84,7 @@ Open9xSim::Open9xSim(FXApp* a):
|
||||||
FXMainWindow(a, "OpenTX Simu", NULL, NULL, DECOR_ALL, 20, 90, 0, 0)
|
FXMainWindow(a, "OpenTX Simu", NULL, NULL, DECOR_ALL, 20, 90, 0, 0)
|
||||||
{
|
{
|
||||||
firstTime = true;
|
firstTime = true;
|
||||||
for(int i=0; i<(LCD_W*LCD_H/8); i++) displayBuf[i]=0;//rand();
|
memset(displayBuf, 0, sizeof(displayBuf));
|
||||||
bmp = new FXPPMImage(getApp(),NULL,IMAGE_OWNED|IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP, W2, H2);
|
bmp = new FXPPMImage(getApp(),NULL,IMAGE_OWNED|IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP, W2, H2);
|
||||||
|
|
||||||
FXHorizontalFrame *hf11=new FXHorizontalFrame(this,LAYOUT_CENTER_X);
|
FXHorizontalFrame *hf11=new FXHorizontalFrame(this,LAYOUT_CENTER_X);
|
||||||
|
@ -92,8 +92,7 @@ Open9xSim::Open9xSim(FXApp* a):
|
||||||
|
|
||||||
//rh lv rv lh
|
//rh lv rv lh
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
switch(i)
|
switch (i) {
|
||||||
{
|
|
||||||
#define L LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT|LAYOUT_FIX_X|LAYOUT_FIX_Y
|
#define L LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT|LAYOUT_FIX_X|LAYOUT_FIX_Y
|
||||||
#undef X0
|
#undef X0
|
||||||
#define X0 10
|
#define X0 10
|
||||||
|
@ -164,6 +163,7 @@ void Open9xSim::makeSnapshot(const FXDrawable* drawable)
|
||||||
printf("Cannot create snapshot %s\n", buf);
|
printf("Cannot create snapshot %s\n", buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Open9xSim::doEvents()
|
void Open9xSim::doEvents()
|
||||||
{
|
{
|
||||||
getApp()->runOneEvent(false);
|
getApp()->runOneEvent(false);
|
||||||
|
@ -305,7 +305,7 @@ void Open9xSim::refreshDisplay()
|
||||||
for (int x=0; x<LCD_W; x++) {
|
for (int x=0; x<LCD_W; x++) {
|
||||||
for (int y=0; y<LCD_H; y++) {
|
for (int y=0; y<LCD_H; y++) {
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
uint8_t * p = & lcd_buf[y / 2 * LCD_W + x];
|
display_t * p = &lcd_buf[y / 2 * LCD_W + x];
|
||||||
uint8_t z = (y & 1) ? (*p >> 4) : (*p & 0x0F);
|
uint8_t z = (y & 1) ? (*p >> 4) : (*p & 0x0F);
|
||||||
if (z) {
|
if (z) {
|
||||||
FXColor color;
|
FXColor color;
|
||||||
|
|
|
@ -119,7 +119,7 @@ void lcdRefresh()
|
||||||
#endif
|
#endif
|
||||||
PORTC_LCD_CTRL |= (1<<OUT_C_LCD_A0);
|
PORTC_LCD_CTRL |= (1<<OUT_C_LCD_A0);
|
||||||
PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_RnW);
|
PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_RnW);
|
||||||
for (xcoord_t x=LCD_W; x>0; --x) {
|
for (coord_t x=LCD_W; x>0; --x) {
|
||||||
PORTA_LCD_DAT = *p++;
|
PORTA_LCD_DAT = *p++;
|
||||||
PORTC_LCD_CTRL |= (1<<OUT_C_LCD_E);
|
PORTC_LCD_CTRL |= (1<<OUT_C_LCD_E);
|
||||||
PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_E);
|
PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_E);
|
||||||
|
|
|
@ -634,7 +634,7 @@ uint32_t Card_CSD[4]; // TODO elsewhere
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool lcd_refresh = true;
|
bool lcd_refresh = true;
|
||||||
uint8_t lcd_buf[DISPLAY_BUF_SIZE];
|
display_t lcd_buf[DISPLAY_BUF_SIZE];
|
||||||
|
|
||||||
void lcdSetRefVolt(uint8_t val)
|
void lcdSetRefVolt(uint8_t val)
|
||||||
{
|
{
|
||||||
|
@ -642,7 +642,7 @@ void lcdSetRefVolt(uint8_t val)
|
||||||
|
|
||||||
void lcdRefresh()
|
void lcdRefresh()
|
||||||
{
|
{
|
||||||
memcpy(lcd_buf, displayBuf, DISPLAY_BUF_SIZE);
|
memcpy(lcd_buf, displayBuf, sizeof(lcd_buf));
|
||||||
lcd_refresh = true;
|
lcd_refresh = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ void lcdRefresh()
|
||||||
#endif
|
#endif
|
||||||
PORTC_LCD_CTRL |= (1<<OUT_C_LCD_A0);
|
PORTC_LCD_CTRL |= (1<<OUT_C_LCD_A0);
|
||||||
PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_RnW);
|
PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_RnW);
|
||||||
for (xcoord_t x=LCD_W; x>0; --x) {
|
for (coord_t x=LCD_W; x>0; --x) {
|
||||||
PORTA_LCD_DAT = *p++;
|
PORTA_LCD_DAT = *p++;
|
||||||
PORTC_LCD_CTRL |= (1<<OUT_C_LCD_E);
|
PORTC_LCD_CTRL |= (1<<OUT_C_LCD_E);
|
||||||
PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_E);
|
PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_E);
|
||||||
|
|
|
@ -330,7 +330,7 @@ enum AlarmLevel {
|
||||||
|
|
||||||
#define TELEMETRY_CELL_VOLTAGE_MUTLIPLIER 1
|
#define TELEMETRY_CELL_VOLTAGE_MUTLIPLIER 1
|
||||||
|
|
||||||
#define TELEMETRY_BARO_ALT_AVAILABLE() (frskyData.hub.baroAltitudeOffset)
|
#define TELEMETRY_BARO_ALT_AVAILABLE() SWITCH_SIMU(true, frskyData.hub.baroAltitudeOffset)
|
||||||
#define TELEMETRY_BARO_ALT_UNIT (IS_IMPERIAL_ENABLE() ? LENGTH_UNIT_IMP : LENGTH_UNIT_METR)
|
#define TELEMETRY_BARO_ALT_UNIT (IS_IMPERIAL_ENABLE() ? LENGTH_UNIT_IMP : LENGTH_UNIT_METR)
|
||||||
|
|
||||||
#define TELEMETRY_GPS_SPEED_BP frskyData.hub.gpsSpeed_bp
|
#define TELEMETRY_GPS_SPEED_BP frskyData.hub.gpsSpeed_bp
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue