From a60cf67fb2b300668734c0564537540e31c13205 Mon Sep 17 00:00:00 2001 From: philmoz Date: Fri, 29 Sep 2023 11:34:34 +1000 Subject: [PATCH] fix(radio): Lua insertMix function not working (#4129) --- radio/src/lua/api_model.cpp | 2 +- radio/src/mixes.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/lua/api_model.cpp b/radio/src/lua/api_model.cpp index 2e59feefd..4a76aebeb 100644 --- a/radio/src/lua/api_model.cpp +++ b/radio/src/lua/api_model.cpp @@ -890,7 +890,7 @@ static int luaModelInsertMix(lua_State *L) if (chndestCh = channel; mix->srcRaw = channel + 1; if (!isSourceAvailable(mix->srcRaw)) { - if (s_currCh > adcGetMaxInputs(ADC_INPUT_MAIN)) { + if (channel >= adcGetMaxInputs(ADC_INPUT_MAIN)) { mix->srcRaw = MIXSRC_FIRST_STICK + channel; } else { mix->srcRaw = MIXSRC_FIRST_STICK + inputMappingChannelOrder(channel);