fix(radio): Better iteration through mixers on display, sanitize invalid sources (#3999)

* fix: mixer lines with empty source

Fixes #3367

* Fix color mixes display.

---------

Co-authored-by: Phil Mitchell <phil.a.mitchell@gmail.com>
This commit is contained in:
Raphael Coeffic
2023-09-24 15:51:18 +10:00
committed by GitHub
co-authored by Phil Mitchell
parent c502dbeaee
commit 47ff7284fd
19 changed files with 248 additions and 259 deletions
+3 -3
View File
@@ -28,6 +28,7 @@
#include "../timers.h"
#include "model_init.h"
#include "gvars.h"
#include "mixes.h"
#if defined(SDCARD_YAML)
#include <storage/sdcard_yaml.h>
@@ -887,10 +888,9 @@ static int luaModelInsertMix(lua_State *L)
unsigned int first = getFirstMix(chn);
unsigned int count = getMixesCountFromFirst(chn, first);
if (chn<MAX_OUTPUT_CHANNELS && getMixesCount()<MAX_MIXERS && idx<=count) {
if (chn<MAX_OUTPUT_CHANNELS && getMixCount()<MAX_MIXERS && idx<=count) {
idx += first;
s_currCh = chn+1;
insertMix(idx);
insertMix(idx, chn + 1);
MixData *mix = mixAddress(idx);
luaL_checktype(L, -1, LUA_TTABLE);
for (lua_pushnil(L); lua_next(L, -2); lua_pop(L, 1)) {