feat(bw): add 'Set Screen' special function to B&W radios (#5589)
This commit is contained in:
@@ -326,6 +326,11 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
lcdDrawTextAtIndex(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, STR_FUNCSOUNDS, val_displayed, attr);
|
||||
}
|
||||
#endif
|
||||
else if (func == FUNC_SET_SCREEN) {
|
||||
val_min = 0;
|
||||
val_max = 4;
|
||||
lcdDrawNumber(MODEL_SPECIAL_FUNC_3RD_COLUMN + 3*FW, y, val_displayed, attr|LEFT);
|
||||
}
|
||||
#if defined(HAPTIC)
|
||||
else if (func == FUNC_HAPTIC) {
|
||||
val_max = 3;
|
||||
@@ -496,7 +501,11 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
else {
|
||||
lcdDrawNumber(MODEL_SPECIAL_FUNC_4TH_COLUMN+2+FW, y, CFN_PLAY_REPEAT(cfn)*CFN_PLAY_REPEAT_MUL, RIGHT | attr);
|
||||
}
|
||||
if (active) CFN_PLAY_REPEAT(cfn) = checkIncDec(event, CFN_PLAY_REPEAT(cfn)==CFN_PLAY_REPEAT_NOSTART?-1:CFN_PLAY_REPEAT(cfn), -1, 60/CFN_PLAY_REPEAT_MUL, eeFlags);
|
||||
if (active)
|
||||
CFN_PLAY_REPEAT(cfn) = checkIncDec(event, CFN_PLAY_REPEAT(cfn)==CFN_PLAY_REPEAT_NOSTART?-1:CFN_PLAY_REPEAT(cfn),
|
||||
-1,
|
||||
(func == FUNC_SET_SCREEN ? 0 : 60/CFN_PLAY_REPEAT_MUL),
|
||||
eeFlags);
|
||||
}
|
||||
}
|
||||
else if (attr) {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#define STATUS_BAR_Y (7*FH+1)
|
||||
|
||||
uint8_t s_frsky_view = 0;
|
||||
uint8_t selectedTelemView = 0;
|
||||
|
||||
#define BAR_LEFT 25
|
||||
#define BAR_WIDTH 100
|
||||
@@ -163,7 +163,7 @@ bool displayCustomTelemetryScreen(uint8_t index)
|
||||
{
|
||||
TelemetryScreenData & screen = g_model.screens[index];
|
||||
|
||||
if (IS_BARS_SCREEN(s_frsky_view)) {
|
||||
if (IS_BARS_SCREEN(selectedTelemView)) {
|
||||
return displayGaugesTelemetryScreen(screen);
|
||||
}
|
||||
|
||||
@@ -175,19 +175,19 @@ bool displayCustomTelemetryScreen(uint8_t index)
|
||||
bool displayTelemetryScreen()
|
||||
{
|
||||
#if defined(LUA)
|
||||
if (TELEMETRY_SCREEN_TYPE(s_frsky_view) == TELEMETRY_SCREEN_TYPE_SCRIPT) {
|
||||
if (TELEMETRY_SCREEN_TYPE(selectedTelemView) == TELEMETRY_SCREEN_TYPE_SCRIPT) {
|
||||
return isTelemetryScriptAvailable(); // contents will be drawn by Lua Task
|
||||
}
|
||||
#endif
|
||||
|
||||
if (TELEMETRY_SCREEN_TYPE(s_frsky_view) == TELEMETRY_SCREEN_TYPE_NONE) {
|
||||
if (TELEMETRY_SCREEN_TYPE(selectedTelemView) == TELEMETRY_SCREEN_TYPE_NONE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
drawTelemetryTopBar();
|
||||
|
||||
if (s_frsky_view < MAX_TELEMETRY_SCREENS) {
|
||||
return displayCustomTelemetryScreen(s_frsky_view);
|
||||
if (selectedTelemView < MAX_TELEMETRY_SCREENS) {
|
||||
return displayCustomTelemetryScreen(selectedTelemView);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user