allow mixes without source (#665)
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
#include "bitfield.h"
|
#include "bitfield.h"
|
||||||
#include "model_inputs.h"
|
#include "model_inputs.h"
|
||||||
#include "gvar_numberedit.h"
|
#include "gvar_numberedit.h"
|
||||||
|
#include "dataconstants.h"
|
||||||
|
|
||||||
#define SET_DIRTY() storageDirty(EE_MODEL)
|
#define SET_DIRTY() storageDirty(EE_MODEL)
|
||||||
|
|
||||||
@@ -374,7 +375,7 @@ void ModelMixesPage::build(FormWindow * window, int8_t focusMixIndex)
|
|||||||
int mixIndex = 0;
|
int mixIndex = 0;
|
||||||
MixData * mix = g_model.mixData;
|
MixData * mix = g_model.mixData;
|
||||||
for (uint8_t ch = 0; ch < MAX_OUTPUT_CHANNELS; ch++) {
|
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();
|
coord_t h = grid.getWindowHeight();
|
||||||
auto txt = new MixLineTitle(window, grid.getLabelSlot(),
|
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);
|
BUTTON_BACKGROUND, COLOR_THEME_PRIMARY1 | CENTERED);
|
||||||
|
|
||||||
uint8_t count = 0;
|
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 * button = new MixLineButton(window, grid.getFieldSlot(), mixIndex);
|
||||||
button->setPressHandler([=]() -> uint8_t {
|
button->setPressHandler([=]() -> uint8_t {
|
||||||
button->bringToTop();
|
button->bringToTop();
|
||||||
|
|||||||
@@ -648,7 +648,11 @@ void evalFlightModeMixes(uint8_t mode, uint8_t tick10ms)
|
|||||||
MixData * md = mixAddress(i);
|
MixData * md = mixAddress(i);
|
||||||
|
|
||||||
if (md->srcRaw == 0)
|
if (md->srcRaw == 0)
|
||||||
|
#if defined(COLORLCD)
|
||||||
|
continue;
|
||||||
|
#else
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
mixsrc_t stickIndex = md->srcRaw - MIXSRC_Rud;
|
mixsrc_t stickIndex = md->srcRaw - MIXSRC_Rud;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user