Display receiver name in telemetry field details
This commit is contained in:
@@ -576,6 +576,14 @@ void lcdDrawVerticalLine(coord_t x, scoord_t y, scoord_t h, uint8_t pat, LcdFlag
|
||||
}
|
||||
}
|
||||
|
||||
void drawReceiverName(coord_t x, coord_t y, uint8_t moduleIdx, uint8_t receiverIdx, LcdFlags flags)
|
||||
{
|
||||
if (g_model.moduleData[moduleIdx].pxx2.receiverName[receiverIdx][0] != '\0')
|
||||
lcdDrawSizedText(x, y, g_model.moduleData[moduleIdx].pxx2.receiverName[receiverIdx], PXX2_LEN_RX_NAME, flags);
|
||||
else
|
||||
lcdDrawText(x, y, "---", flags);
|
||||
}
|
||||
|
||||
void lcdDrawSolidVerticalLine(coord_t x, scoord_t y, scoord_t h, LcdFlags att)
|
||||
{
|
||||
lcdDrawVerticalLine(x, y, h, SOLID, att);
|
||||
|
||||
@@ -160,6 +160,7 @@ void putsVBat(coord_t x, coord_t y, LcdFlags att);
|
||||
|
||||
void drawRtcTime(coord_t x, coord_t y, LcdFlags att);
|
||||
void drawTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2);
|
||||
void drawReceiverName(coord_t x, coord_t y, uint8_t moduleIdx, uint8_t receiverIdx, LcdFlags flags=0);
|
||||
inline void drawTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att)
|
||||
{
|
||||
drawTimer(x, y, tme, att, att);
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#define RECEIVER_OPTIONS_2ND_COLUMN 80
|
||||
|
||||
extern uint8_t g_moduleIdx;
|
||||
extern void drawReceiverName(uint8_t x, uint8_t y, uint8_t moduleIndex, uint8_t receiverIndex, LcdFlags flags=0);
|
||||
|
||||
void onRxOptionsUpdateConfirm(const char * result)
|
||||
{
|
||||
|
||||
@@ -29,14 +29,6 @@
|
||||
|
||||
uint8_t g_moduleIdx;
|
||||
|
||||
void drawReceiverName(uint8_t x, uint8_t y, uint8_t moduleIdx, uint8_t receiverIdx, LcdFlags flags=0)
|
||||
{
|
||||
if (g_model.moduleData[moduleIdx].pxx2.receiverName[receiverIdx][0] != '\0')
|
||||
lcdDrawSizedText(x, y, g_model.moduleData[moduleIdx].pxx2.receiverName[receiverIdx], PXX2_LEN_RX_NAME, flags);
|
||||
else
|
||||
lcdDrawText(x, y, "---", flags);
|
||||
}
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
uint8_t getSwitchWarningsCount()
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@ enum SensorFields {
|
||||
SENSOR_FIELD_TYPE,
|
||||
SENSOR_FIELD_ID,
|
||||
SENSOR_FIELD_FORMULA=SENSOR_FIELD_ID,
|
||||
SENSOR_FILED_RECEIVER_NAME,
|
||||
SENSOR_FIELD_UNIT,
|
||||
SENSOR_FIELD_PRECISION,
|
||||
SENSOR_FIELD_PARAM1,
|
||||
@@ -50,6 +51,7 @@ void menuModelSensor(event_t event)
|
||||
0, // Name
|
||||
0, // Type
|
||||
sensor->type == TELEM_TYPE_CALCULATED ? (uint8_t)0 : (uint8_t)1, // ID / Formula
|
||||
sensor->type == TELEM_TYPE_CALCULATED ? HIDDEN_ROW : LABEL(Receiver), // Receiver name
|
||||
((sensor->type == TELEM_TYPE_CALCULATED && (sensor->formula == TELEM_FORMULA_DIST)) || sensor->isConfigurable() ? (uint8_t)0 : HIDDEN_ROW), // Unit
|
||||
(sensor->isPrecConfigurable() && sensor->unit != UNIT_FAHRENHEIT ? (uint8_t)0 : HIDDEN_ROW), // Precision
|
||||
(sensor->unit >= UNIT_FIRST_VIRTUAL ? HIDDEN_ROW : (uint8_t)0), // Param1
|
||||
@@ -103,7 +105,7 @@ void menuModelSensor(event_t event)
|
||||
if (sensor->type == TELEM_TYPE_CUSTOM) {
|
||||
lcdDrawTextAlignedLeft(y, STR_ID);
|
||||
lcdDrawHexNumber(SENSOR_2ND_COLUMN, y, sensor->id, LEFT|(menuHorizontalPosition==0 ? attr : 0));
|
||||
lcdDrawNumber(SENSOR_3RD_COLUMN, y, sensor->instance, LEFT|(menuHorizontalPosition==1 ? attr : 0));
|
||||
lcdDrawHexChar(SENSOR_3RD_COLUMN, y, sensor->instance & 0x1f, LEFT|(menuHorizontalPosition==1 ? attr : 0));
|
||||
if (attr) {
|
||||
switch (menuHorizontalPosition) {
|
||||
case 0:
|
||||
@@ -111,7 +113,11 @@ void menuModelSensor(event_t event)
|
||||
break;
|
||||
|
||||
case 1:
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, sensor->instance, 0xff);
|
||||
uint8_t instance = sensor->instance & 0x1f;
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, instance, 0x1b);
|
||||
if (checkIncDec_Ret) {
|
||||
sensor->instance = (sensor->instance & 0x01f) + instance;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -136,6 +142,12 @@ void menuModelSensor(event_t event)
|
||||
}
|
||||
break;
|
||||
|
||||
case SENSOR_FILED_RECEIVER_NAME:
|
||||
lcdDrawTextAlignedLeft(y, STR_RECEIVER);
|
||||
drawReceiverName(SENSOR_2ND_COLUMN, y, (sensor->instance >> 7) & 0x01, (sensor->instance >> 5) & 0x03, 0);
|
||||
break;
|
||||
|
||||
|
||||
case SENSOR_FIELD_UNIT:
|
||||
lcdDrawTextAlignedLeft(y, "Unit");
|
||||
// TODO flash saving with editChoice where I copied those 2 lines?
|
||||
|
||||
Reference in New Issue
Block a user