allow mixes without source (#665)

This commit is contained in:
eshifri
2021-09-03 19:05:54 +10:00
committed by GitHub
parent e700870f70
commit c1cd083476
2 changed files with 9 additions and 2 deletions
+5 -2
View File
@@ -24,6 +24,7 @@
#include "bitfield.h"
#include "model_inputs.h"
#include "gvar_numberedit.h"
#include "dataconstants.h"
#define SET_DIRTY() storageDirty(EE_MODEL)
@@ -374,7 +375,7 @@ void ModelMixesPage::build(FormWindow * window, int8_t focusMixIndex)
int mixIndex = 0;
MixData * mix = g_model.mixData;
for (uint8_t ch = 0; ch < MAX_OUTPUT_CHANNELS; ch++) {
if (mixIndex < MAX_MIXERS && mix->srcRaw > 0 && mix->destCh == ch) {
if (mixIndex < MAX_MIXERS && mix->destCh == ch) {
coord_t h = grid.getWindowHeight();
auto txt = new MixLineTitle(window, grid.getLabelSlot(),
@@ -382,7 +383,9 @@ void ModelMixesPage::build(FormWindow * window, int8_t focusMixIndex)
BUTTON_BACKGROUND, COLOR_THEME_PRIMARY1 | CENTERED);
uint8_t count = 0;
while (mixIndex < MAX_MIXERS && mix->srcRaw > 0 && mix->destCh == ch) {
while (mixIndex < MAX_MIXERS && mix->destCh == ch) {
// First mix cannot be empty
if(!mixIndex && !mix->srcRaw) break;
Button * button = new MixLineButton(window, grid.getFieldSlot(), mixIndex);
button->setPressHandler([=]() -> uint8_t {
button->bringToTop();
+4
View File
@@ -648,7 +648,11 @@ void evalFlightModeMixes(uint8_t mode, uint8_t tick10ms)
MixData * md = mixAddress(i);
if (md->srcRaw == 0)
#if defined(COLORLCD)
continue;
#else
break;
#endif
mixsrc_t stickIndex = md->srcRaw - MIXSRC_Rud;