Taranis 212x64

This commit is contained in:
Raphael Coeffic
2022-06-11 15:38:08 +02:00
committed by Raphael Coeffic
parent 0eb11ae4b6
commit 352c273d32
28 changed files with 171 additions and 113 deletions
+1 -1
View File
@@ -184,7 +184,7 @@ void title(const char * s);
title(name)
typedef int choice_t;
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event, IsValueAvailable isValueAvailable = nullptr);
choice_t editChoice(coord_t x, coord_t y, const char * label, const char** values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event, IsValueAvailable isValueAvailable = nullptr);
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char * label, LcdFlags attr, event_t event);
swsrc_t editSwitch(coord_t x, coord_t y, swsrc_t value, LcdFlags attr, event_t event);
+2 -4
View File
@@ -415,11 +415,9 @@ void lcdDrawTextAlignedLeft(coord_t y, const char * s)
}
#if !defined(BOOT)
void lcdDrawTextAtIndex(coord_t x, coord_t y, const char * s,uint8_t idx, LcdFlags flags)
void lcdDrawTextAtIndex(coord_t x, coord_t y, const char** s,uint8_t idx, LcdFlags flags)
{
uint8_t length;
length = *(s++);
lcdDrawSizedText(x, y, s+length*idx, length, flags);
lcdDrawSizedText(x, y, s[idx], UINT8_MAX, flags);
}
void lcdDrawHexNumber(coord_t x, coord_t y, uint32_t val, LcdFlags flags)
+1 -1
View File
@@ -102,7 +102,7 @@ void lcdDrawChar(coord_t x, coord_t y, uint8_t c);
void lcdDrawChar(coord_t x, coord_t y, uint8_t c, LcdFlags flags);
void lcdDrawCenteredText(coord_t y, const char * s, LcdFlags flags = 0);
void lcdDrawText(coord_t x, coord_t y, const char * s, LcdFlags flags);
void lcdDrawTextAtIndex(coord_t x, coord_t y, const char * s, uint8_t idx, LcdFlags flags);
void lcdDrawTextAtIndex(coord_t x, coord_t y, const char** s, uint8_t idx, LcdFlags flags);
void lcdDrawSizedText(coord_t x, coord_t y, const char * s, unsigned char len, LcdFlags flags);
void lcdDrawText(coord_t x, coord_t y, const char * s);
void lcdDrawSizedText(coord_t x, coord_t y, const char * s, unsigned char len);
+1 -1
View File
@@ -86,7 +86,7 @@ void title(const char * s)
lcdDrawText(0, 0, s, INVERS);
}
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event, IsValueAvailable isValueAvailable)
choice_t editChoice(coord_t x, coord_t y, const char * label, const char** values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event, IsValueAvailable isValueAvailable)
{
if (label) {
drawFieldLabel(x, y, label);
+1 -1
View File
@@ -210,7 +210,7 @@ void title(const char * s);
typedef int choice_t;
choice_t editChoice(coord_t x, coord_t y, const char *label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event, IsValueAvailable isValueAvailable = nullptr);
choice_t editChoice(coord_t x, coord_t y, const char *label, const char** values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event, IsValueAvailable isValueAvailable = nullptr);
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char *label, LcdFlags attr, event_t event);
swsrc_t editSwitch(coord_t x, coord_t y, swsrc_t value, LcdFlags attr, event_t event);
+17 -6
View File
@@ -21,11 +21,21 @@
#include <limits.h>
#include <memory.h>
#include <assert.h>
#include "lcd.h"
#include "common/stdlcd/fonts.h"
#include "common/stdlcd/utf8.h"
#if !defined(SIMU)
#define assert(x)
#else
#include <assert.h>
#endif
#if !defined(BOOT)
#include "opentx.h"
#endif
#if (defined(PCBX9E) || defined(PCBX9DP)) && defined(LCD_DUAL_BUFFER)
pixel_t displayBuf1[DISPLAY_BUFFER_SIZE] __DMA;
pixel_t displayBuf2[DISPLAY_BUFFER_SIZE] __DMA;
@@ -386,10 +396,9 @@ void lcdDrawTextAlignedLeft(coord_t y, const char * s)
}
#if !defined(BOOT)
void lcdDrawTextAtIndex(coord_t x, coord_t y, const char * s,uint8_t idx, LcdFlags flags)
void lcdDrawTextAtIndex(coord_t x, coord_t y, const char** s,uint8_t idx, LcdFlags flags)
{
uint8_t length = *(s++);
lcdDrawSizedText(x, y, s+length*idx, length, flags);
lcdDrawSizedText(x, y, s[idx], UINT8_MAX, flags);
}
void lcdDrawHexNumber(coord_t x, coord_t y, uint32_t val, LcdFlags flags)
@@ -608,8 +617,10 @@ void putsVBat(coord_t x, coord_t y, LcdFlags att)
void drawStickName(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
{
uint8_t length = STR_VSRCRAW[0];
lcdDrawSizedText(x, y, STR_VSRCRAW+2+length*(idx+1), length-1, att);
// Skip "---": idx + 1
// Skip source symbol: + 2
const char* stickName = STR_VSRCRAW[idx + 1] + 2;
lcdDrawSizedText(x, y, stickName, UINT8_MAX, att);
}
void drawSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att)
+1 -1
View File
@@ -111,7 +111,7 @@ void lcdDrawChar(coord_t x, coord_t y, uint8_t c);
void lcdDrawChar(coord_t x, coord_t y, uint8_t c, LcdFlags mode);
void lcdDrawCenteredText(coord_t y, const char * s, LcdFlags flags = 0);
void lcdDrawText(coord_t x, coord_t y, const char * s, LcdFlags mode);
void lcdDrawTextAtIndex(coord_t x, coord_t y, const char * s,uint8_t idx, LcdFlags mode);
void lcdDrawTextAtIndex(coord_t x, coord_t y, const char** s,uint8_t idx, LcdFlags mode);
void lcdDrawSizedText(coord_t x, coord_t y, const char * s, unsigned char len, LcdFlags mode);
void lcdDrawText(coord_t x, coord_t y, const char * s);
void lcdDrawSizedText(coord_t x, coord_t y, const char * s, unsigned char len);
+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_currIdx];
@@ -86,7 +88,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:
+6 -4
View File
@@ -363,6 +363,7 @@ void onBluetoothConnectMenu(const char * result)
#include "common/stdlcd/model_setup_afhds3.cpp"
#endif
static const char* _pots_warn_modes[] = { "OFF", "Man", "Auto" };
void menuModelSetup(event_t event)
{
@@ -783,7 +784,7 @@ void menuModelSetup(event_t event)
#endif
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);
@@ -826,8 +827,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 & ~ZCHAR);
// 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;
}
}
@@ -1669,7 +1671,7 @@ void menuModelSetup(event_t event)
if (isDefaultModelRegistrationID())
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, STR_PXX2_DEFAULT);
else
lcdDrawSizedText(MODEL_SETUP_2ND_COLUMN, y, g_model.modelRegistrationID, PXX2_LEN_REGISTRATION_ID, ZCHAR);
lcdDrawSizedText(MODEL_SETUP_2ND_COLUMN, y, g_model.modelRegistrationID, PXX2_LEN_REGISTRATION_ID);
break;
case ITEM_MODEL_SETUP_INTERNAL_MODULE_PXX2_MODEL_NUM:
+1 -1
View File
@@ -82,7 +82,7 @@ void title(const char * s)
lcdDrawText(0, 0, s, INVERS);
}
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event, IsValueAvailable isValueAvailable)
choice_t editChoice(coord_t x, coord_t y, const char * label, const char** values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event, IsValueAvailable isValueAvailable)
{
if (label) {
drawFieldLabel(x, y, label);
+3 -1
View File
@@ -104,6 +104,8 @@ void menuModelCurvesAll(event_t event)
}
}
static const char* _curve_types[] = {"Diff","Expo","Func","Cstm"};
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, event_t event, LcdFlags flags)
{
coord_t x1 = x;
@@ -125,7 +127,7 @@ void editCurveRef(coord_t x, coord_t y, CurveRef & curve, event_t event, LcdFlag
flags1 = 0;
}
lcdDrawTextAtIndex(x1, y, "\004DiffExpoFuncCstm", curve.type, flags1);
lcdDrawTextAtIndex(x1, y, _curve_types, curve.type, flags1);
if (active && menuHorizontalPosition==0) {
CHECK_INCDEC_MODELVAR_ZERO(event, curve.type, CURVE_REF_CUSTOM);
+1 -1
View File
@@ -177,7 +177,7 @@ void displayExpoLine(coord_t y, ExpoData * ed)
drawSource(EXPO_LINE_SRC_POS, y, ed->srcRaw, 0);
if (ed->carryTrim != TRIM_ON) {
lcdDrawChar(EXPO_LINE_TRIM_POS, y, ed->carryTrim > 0 ? '-' : STR_RETA123[-ed->carryTrim]);
lcdDrawChar(EXPO_LINE_TRIM_POS, y, ed->carryTrim > 0 ? '-' : STR_RETA123[-ed->carryTrim][0]);
}
if (!ed->flightModes || ((ed->curve.value || ed->swtch) && ((get_tmr10ms() / 200) & 1)))
@@ -25,6 +25,8 @@
#include "mixer_scheduler.h"
#endif
#include "fw_version.h"
// TODO duplicated code
#if defined(ROTARY_ENCODER_NAVIGATION)
#define EVT_KEY_NEXT_LINE EVT_ROTARY_RIGHT
+60 -60
View File
@@ -996,66 +996,66 @@ int convertMultiToOtx(int type)
// we don't need the special eeprom/flash string handling, just define them as
// local strings
const char STR_SUBTYPE_FLYSKY[] = "\004""Std\0""V9x9""V6x6""V912""CX20";
const char STR_SUBTYPE_HUBSAN[] = "\004""H107""H301""H501";
const char STR_SUBTYPE_FRSKY[] = "\011""D16\0 ""D8\0 ""D16 8ch\0 ""V8\0 ""LBT(EU)\0 ""LBT 8ch\0 ""D8Cloned\0""D16Cloned";
const char STR_SUBTYPE_HISKY[] = "\005""Std\0 ""HK310";
const char STR_SUBTYPE_V2X2[] = "\006""Std\0 ""JXD506""MR101\0";
const char STR_SUBTYPE_DSM[] = "\004""2 1F""2 2F""X 1F""X 2F""Auto""R 1F";
const char STR_SUBTYPE_DEVO[] = "\004""8ch\0""10ch""12ch""6ch\0""7ch\0";
const char STR_SUBTYPE_YD717[] = "\007""Std\0 ""SkyWlkr""Syma X4""XINXUN\0""NIHUI\0 ";
const char STR_SUBTYPE_KN[] = "\006""WLtoys""FeiLun";
const char STR_SUBTYPE_SYMAX[] = "\003""Std""X5C";
const char STR_SUBTYPE_SLT[] = "\006""V1_6ch""V2_8ch""Q100\0 ""Q200\0 ""MR100\0";
const char STR_SUBTYPE_CX10[] = "\007""Green\0 ""Blue\0 ""DM007\0 ""-\0 ""JC3015a""JC3015b""MK33041";
const char STR_SUBTYPE_CG023[] = "\005""Std\0 ""YD829";
const char STR_SUBTYPE_BAYANG[] = "\007""Std\0 ""H8S3D\0 ""X16 AH\0""IRDrone""DHD D4\0""QX100\0 ";
const char STR_SUBTYPE_ESky[] = "\003""Std""ET4";
const char STR_SUBTYPE_MT99[] = "\006""MT99\0 ""H7\0 ""YZ\0 ""LS\0 ""FY805\0""A180\0 ""Dragon""F949G\0";
const char STR_SUBTYPE_MJXQ[] = "\007""WLH08\0 ""X600\0 ""X800\0 ""H26D\0 ""E010\0 ""H26WH\0 ""Phoenix";
const char STR_SUBTYPE_FY326[] = "\005""Std\0 ""FY319";
const char STR_SUBTYPE_FUTABA[] = "\005""SFHSS";
const char STR_SUBTYPE_HONTAI[] = "\007""Std\0 ""JJRC X1""X5C1\0 ""FQ_951";
const char STR_SUBTYPE_AFHDS2A[] = "\010""PWM,IBUS""PPM,IBUS""PWM,SBUS""PPM,SBUS""PWM,IB16""PPM,IB16";
const char STR_SUBTYPE_Q2X2[] = "\004""Q222""Q242""Q282";
const char STR_SUBTYPE_WK2x01[] = "\006""WK2801""WK2401""W6_5_1""W6_6_1""W6_HeL""W6_HeI";
const char STR_SUBTYPE_Q303[] = "\006""Std\0 ""CX35\0 ""CX10D\0""CX10WD";
const char STR_SUBTYPE_CABELL[] = "\007""V3\0 ""V3 Telm""-\0 ""-\0 ""-\0 ""-\0 ""F-Safe\0""Unbind\0";
const char STR_SUBTYPE_ESKY150[] = "\003""4ch""7ch";
const char STR_SUBTYPE_H83D[] = "\007""Std\0 ""H20H\0 ""H20Mini""H30Mini";
const char STR_SUBTYPE_CORONA[] = "\005""V1\0 ""V2\0 ""FD V3";
const char STR_SUBTYPE_HITEC[] = "\007""Optima\0""Opt Hub""Minima\0";
const char STR_SUBTYPE_WFLY[] = "\005""WFR0x";
const char STR_SUBTYPE_BUGS_MINI[] = "\006""Std\0 ""Bugs3H";
const char STR_SUBTYPE_TRAXXAS[] = "\004""6519";
const char STR_SUBTYPE_E01X[] = "\004""E012""E015";
const char STR_SUBTYPE_V911S[] = "\004""Std\0""E119";
const char STR_SUBTYPE_GD00X[] = "\005""GD_V1""GD_V2";
const char STR_SUBTYPE_V761[] = "\003""3ch""4ch";
const char STR_SUBTYPE_KF606[] = "\006""KF606\0""MIG320";
const char STR_SUBTYPE_REDPINE[] = "\004""Fast""Slow";
const char STR_SUBTYPE_POTENSIC[] = "\003""A20";
const char STR_SUBTYPE_ZSX[] = "\007""280JJRC";
const char STR_SUBTYPE_HEIGHT[] = "\003""5ch""8ch";
const char STR_SUBTYPE_FRSKYX_RX[] = "\007""RX\0 ""CloneTX";
const char STR_SUBTYPE_HOTT[] = "\007""Sync\0 ""No_Sync";
const char STR_SUBTYPE_FX816[] = "\003""P38";
const char STR_SUBTYPE_PELIKAN[] = "\005""Pro\0 ""Lite\0""SCX24";
const char STR_SUBTYPE_XK[] = "\004""X450""X420";
const char STR_SUBTYPE_XN297DUMP[] = "\006""250K\0 ""1M\0 ""2M\0 ""AUTO\0 ""NRF\0 ""CC2500";
const char STR_SUBTYPE_FRSKYX2[] = "\010""D16\0 ""D16 8ch\0""LBT(EU)\0""LBT 8ch\0""Cloned\0 ""Clone8ch";
const char STR_SUBTYPE_FRSKYR9[] = "\007""915MHz\0""868MHz\0""915 8ch""868 8ch""FCC\0 ""---\0 ""FCC 8ch";
const char STR_SUBTYPE_PROPEL[] = "\004""74-Z";
const char STR_SUBTYPE_FRSKYL[] = "\010""LR12\0 ""LR12 6ch";
const char STR_SUBTYPE_ESKY150V2[] = "\006""150 V2";
const char STR_SUBTYPE_JJRC345[] = "\007""Std\0 ""SkyTmbr";
const char STR_SUBTYPE_KYOSHO[] = "\004""FHSS""Hype";
const char STR_SUBTYPE_RLINK[] = "\007""Surface""Air\0 ""DumboRC";
const char STR_SUBTYPE_ELRS[] = "\007""N/A WIP";
const char STR_SUBTYPE_REALACC[] = "\003""R11";
const char STR_SUBTYPE_WFLY2[] = "\005""RF20x";
const char STR_SUBTYPE_MOULDKG[] = "\007""Analog\0""Digital";
const char STR_SUBTYPE_MT992[] = "\004""PA18";
const char* STR_SUBTYPE_FLYSKY[] = {"Std","V9x9","V6x6","V912","CX20"};
const char* STR_SUBTYPE_HUBSAN[] = {"H107","H301","H501"};
const char* STR_SUBTYPE_FRSKY[] = {"D16","D8","D16 8ch","V8","LBT(EU)","LBT 8ch","D8Cloned","D16Cloned"};
const char* STR_SUBTYPE_HISKY[] = {"Std","HK310"};
const char* STR_SUBTYPE_V2X2[] = {"Std","JXD506","MR101"};
const char* STR_SUBTYPE_DSM[] = {"2 1F","2 2F","X 1F,""X 2F,""Auto","R 1F"};
const char* STR_SUBTYPE_DEVO[] = {"8ch","10ch","12ch","6ch","7ch"};
const char* STR_SUBTYPE_YD717[] = {"Std","SkyWlkr","Syma X4","XINXUN","NIHUI"};
const char* STR_SUBTYPE_KN[] = {"WLtoys","FeiLun"};
const char* STR_SUBTYPE_SYMAX[] = {"Std","X5C"};
const char* STR_SUBTYPE_SLT[] = {"V1_6ch","V2_8ch","Q100","Q200","MR100"};
const char* STR_SUBTYPE_CX10[] = {"Green","Blue","DM007","-","JC3015a","JC3015b","MK33041"};
const char* STR_SUBTYPE_CG023[] = {"Std","YD829"};
const char* STR_SUBTYPE_BAYANG[] = {"Std","H8S3D","X16 AH","IRDrone","DHD D4","QX100"};
const char* STR_SUBTYPE_ESky[] = {"Std","ET4"};
const char* STR_SUBTYPE_MT99[] = {"MT99","H7","YZ","LS","FY805","A180","Dragon","F949G"};
const char* STR_SUBTYPE_MJXQ[] = {"WLH08","X600","X800","H26D","E010","H26WH","Phoenix"};
const char* STR_SUBTYPE_FY326[] = {"Std","FY319"};
const char* STR_SUBTYPE_FUTABA[] = {"SFHSS"};
const char* STR_SUBTYPE_HONTAI[] = {"Std","JJRC X1","X5C1","FQ_951"};
const char* STR_SUBTYPE_AFHDS2A[] = {"PWM,IBUS","PPM,IBUS","PWM,SBUS","PPM,SBUS","PWM,IB16","PPM,IB16"};
const char* STR_SUBTYPE_Q2X2[] = {"Q222","Q242","Q282"};
const char* STR_SUBTYPE_WK2x01[] = {"WK2801","WK2401","W6_5_1","W6_6_1","W6_HeL","W6_HeI"};
const char* STR_SUBTYPE_Q303[] = {"Std","CX35","CX10D","CX10WD"};
const char* STR_SUBTYPE_CABELL[] = {"V3","V3 Telm","-","-","-","-","F-Safe","Unbind"};
const char* STR_SUBTYPE_ESKY150[] = {"4ch","7ch"};
const char* STR_SUBTYPE_H83D[] = {"Std","H20H","H20Mini","H30Mini"};
const char* STR_SUBTYPE_CORONA[] = {"V1","V2","FD V3"};
const char* STR_SUBTYPE_HITEC[] = {"Optima","Opt Hub","Minima"};
const char* STR_SUBTYPE_WFLY[] = {"WFR0x"};
const char* STR_SUBTYPE_BUGS_MINI[] = {"Std","Bugs3H"};
const char* STR_SUBTYPE_TRAXXAS[] = {"6519"};
const char* STR_SUBTYPE_E01X[] = {"E012","E015"};
const char* STR_SUBTYPE_V911S[] = {"Std","E119"};
const char* STR_SUBTYPE_GD00X[] = {"GD_V1","GD_V2"};
const char* STR_SUBTYPE_V761[] = {"3ch","4ch"};
const char* STR_SUBTYPE_KF606[] = {"KF606","MIG320"};
const char* STR_SUBTYPE_REDPINE[] = {"Fast","Slow"};
const char* STR_SUBTYPE_POTENSIC[] = {"A20"};
const char* STR_SUBTYPE_ZSX[] = {"280JJRC"};
const char* STR_SUBTYPE_HEIGHT[] = {"5ch","8ch"};
const char* STR_SUBTYPE_FRSKYX_RX[] = {"RX","CloneTX"};
const char* STR_SUBTYPE_HOTT[] = {"Sync","No_Sync"};
const char* STR_SUBTYPE_FX816[] = {"P38"};
const char* STR_SUBTYPE_PELIKAN[] = {"Pro","Lite","SCX24"};
const char* STR_SUBTYPE_XK[] = {"X450","X420"};
const char* STR_SUBTYPE_XN297DUMP[] = {"250K","1M","2M","AUTO","NRF","CC2500"};
const char* STR_SUBTYPE_FRSKYX2[] = {"D16","D16 8ch","LBT(EU)","LBT 8ch","Cloned","Clone8ch"};
const char* STR_SUBTYPE_FRSKYR9[] = {"915MHz","868MHz","915 8ch","868 8ch","FCC","---","FCC 8ch"};
const char* STR_SUBTYPE_PROPEL[] = {"74-Z"};
const char* STR_SUBTYPE_FRSKYL[] = {"LR12","LR12 6ch"};
const char* STR_SUBTYPE_ESKY150V2[] = {"150 V2"};
const char* STR_SUBTYPE_JJRC345[] = {"Std","SkyTmbr"};
const char* STR_SUBTYPE_KYOSHO[] = {"FHSS","Hype"};
const char* STR_SUBTYPE_RLINK[] = {"Surface","Air","DumboRC"};
const char* STR_SUBTYPE_ELRS[] = {"N/A WIP"};
const char* STR_SUBTYPE_REALACC[] = {"R11"};
const char* STR_SUBTYPE_WFLY2[] = {"RF20x"};
const char* STR_SUBTYPE_MOULDKG[] = {"Analog","Digital"};
const char* STR_SUBTYPE_MT992[] = {"PA18"};
const char* mm_options_strings::options[] = {
nullptr,
+11
View File
@@ -226,8 +226,19 @@ uint16_t getBatteryVoltage()
{
// using filtered ADC value on purpose
int32_t instant_vbat = anaIn(TX_VOLTAGE);
#if defined(BATT_SCALE)
instant_vbat =
(instant_vbat * BATT_SCALE * (128 + g_eeGeneral.txVoltageCalibration)) /
BATTERY_DIVIDER;
// add voltage drop because of the diode TODO check if this is needed, but
// removal will break existing calibrations!
instant_vbat += VOLTAGE_DROP;
return (uint16_t)instant_vbat;
#else
return (uint16_t)((instant_vbat * (1000 + g_eeGeneral.txVoltageCalibration)) /
BATTERY_DIVIDER);
#endif
}
extern uint16_t get_flysky_hall_adc_value(uint8_t ch);
+2 -2
View File
@@ -114,8 +114,8 @@ struct mm_protocol_definition {
uint8_t maxSubtype;
bool failsafe;
bool disable_ch_mapping;
const char *subTypeString;
const char *optionsstr;
const char** subTypeString;
const char* optionsstr;
};
const mm_protocol_definition *getMultiProtocolDefinition (uint8_t protocol);
+3 -1
View File
@@ -27,7 +27,9 @@
#include <stdio.h>
#include "aux_serial_driver.h"
#include "hal/serial_port.h"
//#include "cli.h"
#include "opentx.h"
#include "lua/lua_api.h"
#define PRINTF_BUFFER_SIZE 128
@@ -24,8 +24,10 @@
#include "aux_serial_driver.h"
#include "board.h"
#include "fifo.h"
#include "dmafifo.h"
#include "debug.h"
#define AUX_SERIAL_TX_BUFFER 512
@@ -57,6 +57,7 @@ set(BOOTLOADER_SRC
../../../../../keys.cpp
../../../../../strhelpers.cpp
../../../../../stamp.cpp
../../../../../syscalls.c
../../../../../${STM32USB_DIR}/STM32_USB_OTG_Driver/src/usb_core.c
../../../../../${STM32USB_DIR}/STM32_USB_OTG_Driver/src/usb_dcd.c
../../../../../${STM32USB_DIR}/STM32_USB_OTG_Driver/src/usb_dcd_int.c
@@ -120,7 +121,6 @@ if(PCB STREQUAL X10 OR PCB STREQUAL X12S OR PCB STREQUAL NV14)
../../../../../targets/common/arm/stm32/sdio_sd.c
../../../../../targets/common/arm/stm32/rtc_driver.cpp
../../../../../targets/${TARGET_DIR}/haptic_driver.cpp
../../../../../syscalls.c
)
# Add LVGL sources
@@ -25,6 +25,11 @@ extern "C" {
#include "usb_conf.h"
#include "usb_dcd_int.h"
#include "usb_bsp.h"
#include "usbd_core.h"
#include "usbd_msc_core.h"
#include "usbd_desc.h"
#include "usbd_usr.h"
#include "usbd_hid_core.h"
}
#include "board.h"
+2 -25
View File
@@ -28,6 +28,8 @@
#include "../common/arm/stm32/timers_driver.h"
#include "dataconstants.h"
#if defined(AUX_SERIAL)
#include "aux_serial_driver.h"
#endif
@@ -335,31 +337,6 @@ void boardOff()
// this function must not return!
}
#if defined (RADIO_TX12)
#define BATTERY_DIVIDER 22830
#elif defined (RADIO_T8)
#define BATTERY_DIVIDER 50000
#elif defined (RADIO_ZORRO)
#define BATTERY_DIVIDER 23711 // = 2047*128*BATT_SCALE/(100*(VREF*(160+499)/160))
#else
#define BATTERY_DIVIDER 26214
#endif
#if defined(RADIO_ZORRO)
#define VOLTAGE_DROP 45
#else
#define VOLTAGE_DROP 20
#endif
#if !defined(BOOT)
uint16_t getBatteryVoltage()
{
int32_t instant_vbat = anaIn(TX_VOLTAGE); // using filtered ADC value on purpose
instant_vbat = (instant_vbat * BATT_SCALE * (128 + g_eeGeneral.txVoltageCalibration) ) / BATTERY_DIVIDER;
instant_vbat += VOLTAGE_DROP; // add voltage drop because of the diode TODO check if this is needed, but removal will break existing calibrations!
return (uint16_t)instant_vbat;
}
#endif
#if defined(AUDIO_SPEAKER_ENABLE_GPIO)
void initSpeakerEnable()
{
+16
View File
@@ -988,4 +988,20 @@ int gyroRead(uint8_t buffer[GYRO_BUFFER_LENGTH]);
#define GYRO_OFFSET_MIN -30
#define GYRO_OFFSET_MAX 10
#if defined (RADIO_TX12)
#define BATTERY_DIVIDER 22830
#elif defined (RADIO_T8)
#define BATTERY_DIVIDER 50000
#elif defined (RADIO_ZORRO)
#define BATTERY_DIVIDER 23711 // = 2047*128*BATT_SCALE/(100*(VREF*(160+499)/160))
#else
#define BATTERY_DIVIDER 26214
#endif
#if defined(RADIO_ZORRO)
#define VOLTAGE_DROP 45
#else
#define VOLTAGE_DROP 20
#endif
#endif // _BOARD_H_
+3
View File
@@ -24,6 +24,9 @@
#include "FatFs/diskio.h"
#include "FatFs/ff.h"
#include "sdcard.h"
#include "audio.h"
#define RAM_START 0x20000000
/* Definitions for MMC/SDC command */
@@ -176,6 +176,8 @@ bool keyDown()
break
#if !defined(BOOT)
#include "opentx.h"
uint32_t switchState(uint8_t index)
{
uint32_t xxx = 0;
@@ -23,6 +23,10 @@
#include "debug.h"
#include "lcd.h"
#if !defined(BOOT)
#include "opentx.h"
#endif
#if defined(RADIO_FAMILY_JUMPER_T12) || defined(RADIO_TX12) || defined(RADIO_ZORRO) || defined(RADIO_T8) || defined(RADIO_TPRO)
#define LCD_CONTRAST_OFFSET -10
#else
@@ -28,6 +28,7 @@ _Main_Stack_Size = 1024; /* required amount of stack for interrupt stack (Main s
/* Main stack end */
_main_stack_start = _estack - _Main_Stack_Size;
_heap_end = _main_stack_start;
/* Specify the memory areas */
MEMORY
@@ -20,6 +20,7 @@
*/
#include "board.h"
#include "opentx.h"
Fifo<uint8_t, TELEMETRY_FIFO_SIZE> telemetryFifo;
uint32_t telemetryErrors = 0;
+18 -1
View File
@@ -408,6 +408,7 @@
#define TR_PERSISTENT TR(INDENT "Persist.", INDENT "Persistent")
#define TR_BACKLIGHT_LABEL "Backlight"
#define TR_GHOST_MENU_LABEL "GHOST MENU"
#define TR_STATUS "Status"
#define TR_BLDELAY INDENT "Duration"
#define TR_BLONBRIGHTNESS INDENT "ON brightness"
#define TR_BLOFFBRIGHTNESS INDENT "OFF brightness"
@@ -710,16 +711,26 @@
#define TR_TEMP_CALIB "Temp. Calib"
#define TR_TIME "Time"
#define TR_MAXBAUDRATE "Max bauds"
#define TR_BAUDRATE "Baudrate"
#define TR_SAMPLE_MODE "Sample Mode"
#define TR_SAMPLE_MODES "Normal","OneBit"
#define TR_SELECT_TEMPLATE_FOLDER "SELECT A TEMPLATE FOLDER:"
#define TR_SELECT_TEMPLATE "SELECT A MODEL TEMPLATE:"
#define TR_NO_TEMPLATES "No model templates were found in this folder"
#define TR_SAVE_TEMPLATE "Save as template"
#define TR_BLANK_MODEL "Blank Model"
#define TR_BLANK_MODEL_INFO "Create a blank model"
#define TR_FILE_EXISTS "FILE ALREADY EXISTS"
#define TR_ASK_OVERWRITE "Do you want to overwrite?"
#define TR_BLUETOOTH "Bluetooth"
#define TR_BLUETOOTH_DISC "Discover"
#define TR_BLUETOOTH_INIT "Init"
#define TR_BLUETOOTH_DIST_ADDR "Dist addr"
#define TR_BLUETOOTH_LOCAL_ADDR "Local addr"
#define TR_BLUETOOTH_PIN_CODE "PIN code"
#define TR_BAUDRATE "BT Baudrate"
#define TR_BLUETOOTH_BAUDRATE "BT Baudrate"
#if defined(PCBX9E)
#define TR_BLUETOOTH_MODES "---","Enabled"
#else
@@ -740,6 +751,7 @@
#define TR_DATE "Date"
#define TR_MONTHS { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }
#define TR_ROTARY_ENCODER "R.E."
#define TR_INVERT_ROTARY "Invert Rotary"
#define TR_CHANNELS_MONITOR "CHANNELS MONITOR"
#define TR_MIXERS_MONITOR "MIXERS MONITOR"
#define TR_PATH_TOO_LONG "Path too long"
@@ -1248,6 +1260,11 @@
#define TR_USE_THEME_COLOR "Use theme color"
#define TR_ADD_ALL_TRIMS_TO_SUBTRIMS "Add all Trims to Subtrims"
#if LCD_W > LCD_H
#define TR_OPEN_CHANNEL_MONITORS "Open Channel Monitor"
#else
#define TR_OPEN_CHANNEL_MONITORS "Open Channel Mon."
#endif
#define TR_DUPLICATE "Duplicate"
#define TR_ACTIVATE "Set Active"
#define TR_RED "Red"