Add a reminder of internal CRSF speed in model setup
This commit is contained in:
@@ -966,14 +966,7 @@ void menuModelSetup(event_t event)
|
||||
case ITEM_MODEL_SETUP_EXTERNAL_MODULE_TYPE:
|
||||
#endif
|
||||
lcdDrawTextAlignedLeft(y, INDENT TR_MODE);
|
||||
lcdDrawTextAtIndex(
|
||||
MODEL_SETUP_2ND_COLUMN, y,
|
||||
moduleIdx == EXTERNAL_MODULE ? STR_EXTERNAL_MODULE_PROTOCOLS
|
||||
: STR_INTERNAL_MODULE_PROTOCOLS,
|
||||
moduleIdx == EXTERNAL_MODULE ? reusableBuffer.moduleSetup.newType
|
||||
: g_model.moduleData[moduleIdx].type,
|
||||
menuHorizontalPosition == 0 ? attr : 0);
|
||||
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y,moduleIdx == EXTERNAL_MODULE ? STR_EXTERNAL_MODULE_PROTOCOLS : STR_INTERNAL_MODULE_PROTOCOLS,moduleIdx == EXTERNAL_MODULE ? reusableBuffer.moduleSetup.newType: g_model.moduleData[moduleIdx].type,menuHorizontalPosition == 0 ? attr : 0);
|
||||
if (isModuleXJT(moduleIdx))
|
||||
lcdDrawTextAtIndex(lcdNextPos + 3, y, STR_XJT_ACCST_RF_PROTOCOLS, 1+g_model.moduleData[moduleIdx].subType, menuHorizontalPosition==1 ? attr : 0);
|
||||
else if (isModuleISRM(moduleIdx))
|
||||
@@ -982,6 +975,8 @@ void menuModelSetup(event_t event)
|
||||
lcdDrawTextAtIndex(lcdNextPos + 3, y, STR_DSM_PROTOCOLS, g_model.moduleData[moduleIdx].rfProtocol, menuHorizontalPosition==1 ? attr : 0);
|
||||
else if (isModuleR9MNonAccess(moduleIdx))
|
||||
lcdDrawTextAtIndex(lcdNextPos + 3, y, STR_R9M_REGION, g_model.moduleData[moduleIdx].subType, (menuHorizontalPosition==1 ? attr : 0));
|
||||
else if (moduleIdx == INTERNAL_MODULE && isModuleCrossfire(INTERNAL_MODULE))
|
||||
lcdDrawTextAtIndex(lcdNextPos + 3, y, STR_CRSF_BAUDRATE, g_eeGeneral.internalModuleBaudrate,0);
|
||||
|
||||
if (attr && menuHorizontalPosition == 0 && moduleIdx == EXTERNAL_MODULE) {
|
||||
if (s_editMode > 0) {
|
||||
|
||||
@@ -109,7 +109,7 @@ enum MenuModelSetupItems {
|
||||
ITEM_MODEL_SETUP_EXTERNAL_MODULE_TYPE,
|
||||
#if defined(CROSSFIRE) || defined(GHOST)
|
||||
ITEM_MODEL_SETUP_EXTERNAL_MODULE_BAUDRATE,
|
||||
ITEM_MODEL_SETUP_EXTERNAL_MODULE_SERIALSTATUS,
|
||||
ITEM_MODEL_SETUP_EXTERNAL_MODULE_SERIALSTATUS,
|
||||
#endif
|
||||
#if defined (MULTIMODULE)
|
||||
ITEM_MODEL_SETUP_EXTERNAL_MODULE_PROTOCOL,
|
||||
@@ -888,6 +888,8 @@ void menuModelSetup(event_t event)
|
||||
lcdDrawTextAtIndex(lcdNextPos + 3, y, STR_XJT_ACCST_RF_PROTOCOLS, 1 + g_model.moduleData[INTERNAL_MODULE].subType, menuHorizontalPosition==1 ? attr : 0);
|
||||
else if (isModuleISRM(INTERNAL_MODULE))
|
||||
lcdDrawTextAtIndex(lcdNextPos + 3, y, STR_ISRM_RF_PROTOCOLS, 1 + g_model.moduleData[INTERNAL_MODULE].subType, menuHorizontalPosition==1 ? attr : 0);
|
||||
else if (isModuleCrossfire(INTERNAL_MODULE))
|
||||
lcdDrawTextAtIndex(lcdNextPos + 3, y, STR_CRSF_BAUDRATE, c,0);
|
||||
if (attr) {
|
||||
if (menuHorizontalPosition == 0) {
|
||||
uint8_t moduleType = checkIncDec(event, g_model.moduleData[INTERNAL_MODULE].type, MODULE_TYPE_NONE, MODULE_TYPE_MAX, EE_MODEL, isInternalModuleAvailable);
|
||||
|
||||
@@ -305,8 +305,7 @@ class TrainerModuleWindow : public FormGroup
|
||||
FormGridLayout grid;
|
||||
clear();
|
||||
|
||||
new StaticText(this, grid.getLabelSlot(true), STR_MODE, 0,
|
||||
COLOR_THEME_PRIMARY1);
|
||||
new StaticText(this, grid.getLabelSlot(true), STR_MODE, 0,COLOR_THEME_PRIMARY1);
|
||||
trainerChoice = new TrChoice(
|
||||
this, grid.getFieldSlot(), STR_VTRAINERMODES, 0, TRAINER_MODE_MAX(),
|
||||
GET_DEFAULT(g_model.trainerData.mode),
|
||||
@@ -590,8 +589,7 @@ class ModuleWindow : public FormGroup {
|
||||
clear();
|
||||
|
||||
// Module Type
|
||||
new StaticText(this, grid.getLabelSlot(true), STR_MODE, 0,
|
||||
COLOR_THEME_PRIMARY1);
|
||||
new StaticText(this, grid.getLabelSlot(true), STR_MODE, 0,COLOR_THEME_PRIMARY1);
|
||||
moduleChoice = new Choice(
|
||||
this, grid.getFieldSlot(2, 0), STR_INTERNAL_MODULE_PROTOCOLS,
|
||||
MODULE_TYPE_NONE, MODULE_TYPE_COUNT - 1,
|
||||
@@ -608,6 +606,10 @@ class ModuleWindow : public FormGroup {
|
||||
: isExternalModuleAvailable(moduleType);
|
||||
});
|
||||
|
||||
if (moduleIdx == INTERNAL_MODULE && isModuleCrossfire(moduleIdx)) {
|
||||
new StaticText(this, grid.getFieldSlot(2, 1), getStringAtIndex(STR_CRSF_BAUDRATE, CROSSFIRE_STORE_TO_INDEX(g_eeGeneral.internalModuleBaudrate)), 0,COLOR_THEME_PRIMARY1);
|
||||
}
|
||||
|
||||
// Module parameters
|
||||
if (moduleIdx== EXTERNAL_MODULE && isModuleCrossfire(moduleIdx)) {
|
||||
grid.nextLine();
|
||||
@@ -627,7 +629,7 @@ class ModuleWindow : public FormGroup {
|
||||
new StaticText(this, grid.getLabelSlot(true), STR_STATUS, 0,COLOR_THEME_PRIMARY1);
|
||||
new DynamicText(this, grid.getFieldSlot(), [=] {
|
||||
char msg[64] = "";
|
||||
sprintf(msg,"%d Hz %lu Err", 1000000 / getMixerSchedulerPeriod(), telemetryErrors);
|
||||
sprintf(msg,"%d Hz %u Err", 1000000 / getMixerSchedulerPeriod(), telemetryErrors);
|
||||
return std::string(msg);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -158,6 +158,13 @@ char *getStringAtIndex(char *dest, const char *s, int idx)
|
||||
return dest;
|
||||
}
|
||||
|
||||
const char *getStringAtIndex(const char *s, int idx)
|
||||
{
|
||||
uint8_t len = s[0];
|
||||
return s + 1 + len * idx;
|
||||
}
|
||||
|
||||
|
||||
char *strAppendStringWithIndex(char *dest, const char *s, int idx)
|
||||
{
|
||||
return strAppendUnsigned(strAppend(dest, s), abs(idx));
|
||||
|
||||
@@ -66,6 +66,7 @@ char *strAppendFilename(char *dest, const char *filename, const int size);
|
||||
|
||||
#if !defined(BOOT)
|
||||
char *getStringAtIndex(char *dest, const char *s, int idx);
|
||||
const char *getStringAtIndex(const char *s, int idx);
|
||||
char *strAppendStringWithIndex(char *dest, const char *s, int idx);
|
||||
#define LEN_TIMER_STRING 10 // "-00:00:00"
|
||||
char *getTimerString(char *dest, int32_t tme, TimerOptions timerOptions = {.options = 0});
|
||||
|
||||
Reference in New Issue
Block a user