Taranis 128x64

This commit is contained in:
Raphael Coeffic
2022-06-11 15:38:08 +02:00
committed by Raphael Coeffic
parent 352c273d32
commit cf06efea87
8 changed files with 38 additions and 12 deletions
+11 -1
View File
@@ -21,12 +21,22 @@
#include <limits.h>
#include <memory.h>
#include <assert.h>
#include "lcd.h"
#include "thirdparty/libopenui/src/bitfield.h"
#include "gui/common/stdlcd/fonts.h"
#include "gui/common/stdlcd/utf8.h"
#if !defined(SIMU)
#define assert(x)
#else
#include <assert.h>
#endif
#if !defined(BOOT)
#include "opentx.h"
#endif
pixel_t displayBuf[DISPLAY_BUFFER_SIZE] __DMA;
void lcdClear()
+3 -1
View File
@@ -63,6 +63,8 @@ enum GVarFields {
#define GVAR_2ND_COLUMN (12*FW)
static const char* _str_units[] = { "-", "%" };
void menuModelGVarOne(event_t event)
{
GVarData * gvar = &g_model.gvars[s_currIdxSubMenu];
@@ -87,7 +89,7 @@ void menuModelGVarOne(event_t event)
break;
case GVAR_FIELD_UNIT:
gvar->unit = editChoice(GVAR_2ND_COLUMN, y, STR_UNIT, "\001-%", gvar->unit, 0, 1, attr, event);
gvar->unit = editChoice(GVAR_2ND_COLUMN, y, STR_UNIT, _str_units, gvar->unit, 0, 1, attr, event);
break;
case GVAR_FIELD_PREC:
+9 -6
View File
@@ -424,6 +424,8 @@ void editTimerCountdown(int timerIdx, coord_t y, LcdFlags attr, event_t event)
NUM_SWITCHES - 1, /* Switch warning */
#endif
static const char* _pots_warn_modes[] = { "OFF", "Man", "Auto" };
void menuModelSetup(event_t event)
{
int8_t old_editMode = s_editMode;
@@ -781,9 +783,9 @@ void menuModelSetup(event_t event)
case ITEM_MODEL_SETUP_SWITCHES_WARNING1:
{
#define FIRSTSW_STR STR_VSRCRAW+(MIXSRC_FIRST_SWITCH-MIXSRC_Rud+1)*length
#define FIRSTSW_STR (&STR_VSRCRAW[MIXSRC_FIRST_SWITCH-MIXSRC_FIRST_STICK+1])
uint8_t switchWarningsCount = getSwitchWarningsCount();
uint8_t length = STR_VSRCRAW[0];
//uint8_t length = STR_VSRCRAW[0];
horzpos_t l_posHorz = menuHorizontalPosition;
if (i>=NUM_BODY_LINES-2 && getSwitchWarningsCount() > MAX_SWITCH_PER_LINE*(NUM_BODY_LINES-i)) {
@@ -856,7 +858,7 @@ void menuModelSetup(event_t event)
c = (" " STR_CHAR_UP "-" STR_CHAR_DOWN)[states & 0x03];
lcdDrawSizedText(
MODEL_SETUP_2ND_COLUMN + qr.rem * ((2 * FW) + 1),
y + FH * qr.quot, FIRSTSW_STR + (i * length) + 3, 1,
y + FH * qr.quot, FIRSTSW_STR[i] + sizeof(STR_CHAR_SWITCH) - 1, 1,
attr && (menuHorizontalPosition == current) ? INVERS : 0);
lcdDrawChar(lcdNextPos, y + FH * qr.quot, c);
++current;
@@ -873,7 +875,7 @@ void menuModelSetup(event_t event)
case ITEM_MODEL_SETUP_POTS_WARNING:
lcdDrawTextAlignedLeft(y, STR_POTWARNING);
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, "\004""OFF\0""Man\0""Auto", g_model.potsWarnMode, (menuHorizontalPosition == 0) ? attr : 0);
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, _pots_warn_modes, g_model.potsWarnMode, (menuHorizontalPosition == 0) ? attr : 0);
if (attr && (menuHorizontalPosition == 0)) {
CHECK_INCDEC_MODELVAR(event, g_model.potsWarnMode, POTS_WARN_OFF, POTS_WARN_AUTO);
storageDirty(EE_MODEL);
@@ -910,8 +912,9 @@ void menuModelSetup(event_t event)
flags |= INVERS;
}
// TODO add a new function
lcdDrawSizedText(x, y, STR_VSRCRAW+2+STR_VSRCRAW[0]*(NUM_STICKS+1+i), STR_VSRCRAW[0]-1, flags);
// skip "---" (+1) and source symbol (+2)
const char* source = STR_VSRCRAW[NUM_STICKS + 1 + i] + 2;
lcdDrawSizedText(x, y, source, UINT8_MAX, flags);
x = lcdNextPos+3;
}
}
+3 -1
View File
@@ -571,7 +571,9 @@ char *getSourceString(char (&dest)[L], mixsrc_t idx)
char* pos = strAppend(dest, STR_CHAR_INPUT, sizeof(STR_CHAR_INPUT) - 1);
if (g_model.inputNames[idx][0] != '\0' && (dest_len > sizeof(g_model.inputNames[idx]))) {
memset(pos, 0, sizeof(g_model.inputNames[idx]) + 1);
strncpy(pos, g_model.inputNames[idx], sizeof(g_model.inputNames[idx]));
size_t input_len = std::min(dest_len - 1, sizeof(g_model.inputNames[idx]));
strncpy(pos, g_model.inputNames[idx], input_len);
pos[input_len] = '\0';
} else {
strAppendUnsigned(pos, idx + 1, 2);
}
@@ -20,6 +20,7 @@
*/
#include "board.h"
#include "debug.h"
#if !defined(BOOT)
Fifo<uint8_t, BT_TX_FIFO_SIZE> btTxFifo;
@@ -123,7 +124,6 @@ extern "C" void BT_USART_IRQHandler(void)
USART_ClearITPendingBit(BT_USART, USART_IT_RXNE);
uint8_t byte = USART_ReceiveData(BT_USART);
btRxFifo.push(byte);
BLUETOOTH_TRACE_VERBOSE("BT %02X" CRLF, byte);
#if defined(BLUETOOTH_PROBE)
if (!btChipPresent) {
// This is to differentiate X7 and X7S and X-Lite with/without BT
@@ -22,6 +22,11 @@
#include "board.h"
#include "hal.h"
#include "board_common.h"
#include "heartbeat_driver.h"
#if !defined(BOOT)
#include "opentx.h"
#endif
static uint8_t rotencPosition;
volatile rotenc_t rotencValue;
+4
View File
@@ -30,6 +30,10 @@
#include "dataconstants.h"
#if !defined(BOOT)
#include "opentx.h"
#endif
#if defined(AUX_SERIAL)
#include "aux_serial_driver.h"
#endif
+2 -2
View File
@@ -54,7 +54,7 @@
STR_CHAR_SWITCH "SD", STR_CHAR_SWITCH "SG", STR_CHAR_SWITCH "SH", \
STR_CHAR_SWITCH "SI", STR_CHAR_SWITCH "SJ",
#elif defined(RADIO_TX12)
#define TR_POTS_VSRCRAW STR_CHAR_POT "S1", STR_CHAR_POT "S2",
#define TR_POTS_VSRCRAW STR_CHAR_POT "S1", STR_CHAR_POT "S2"
#define TR_SW_VSRCRAW \
STR_CHAR_SWITCH "SA", STR_CHAR_SWITCH "SB", STR_CHAR_SWITCH \
"SC", STR_CHAR_SWITCH "SD", STR_CHAR_SWITCH \
@@ -64,7 +64,7 @@
#define TR_POTS_VSRCRAW STR_CHAR_POT"S1", STR_CHAR_POT"S2"
#define TR_SW_VSRCRAW STR_CHAR_SWITCH "SA", STR_CHAR_SWITCH "SB", STR_CHAR_SWITCH "SC", STR_CHAR_SWITCH "SD", STR_CHAR_SWITCH "SE", STR_CHAR_SWITCH "SF", STR_CHAR_SWITCH "SG", STR_CHAR_SWITCH "SH"
#elif defined(PCBX7)
#define TR_POTS_VSRCRAW STR_CHAR_POT"S1", STR_CHAR_POT"S2",
#define TR_POTS_VSRCRAW STR_CHAR_POT"S1", STR_CHAR_POT"S2"
#define TR_SW_VSRCRAW STR_CHAR_SWITCH"SA", STR_CHAR_SWITCH"SB", STR_CHAR_SWITCH"SC", STR_CHAR_SWITCH"SD", STR_CHAR_SWITCH"SF", STR_CHAR_SWITCH"SH", STR_CHAR_SWITCH"SI", STR_CHAR_SWITCH"SJ"
#elif defined(PCBX9LITES)
#define TR_POTS_VSRCRAW STR_CHAR_POT"S1"