From 0070ff461e22ebfe0a2b482267993c132fa0631a Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Mon, 15 Apr 2019 11:48:12 +0200 Subject: [PATCH] Fix receiver output mapping bug introduced in a previous commit --- radio/src/gui/128x64/model_receiver_options.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/radio/src/gui/128x64/model_receiver_options.cpp b/radio/src/gui/128x64/model_receiver_options.cpp index ee6636e85..b1eae6f10 100644 --- a/radio/src/gui/128x64/model_receiver_options.cpp +++ b/radio/src/gui/128x64/model_receiver_options.cpp @@ -122,8 +122,7 @@ void menuModelReceiverOptions(event_t event) // Pin { uint8_t pin = i - ITEM_RECEIVER_PINMAP_FIRST; - uint8_t lastChan = g_model.moduleData[g_moduleIdx].channelsStart + 8 + g_model.moduleData[g_moduleIdx].channelsCount - 1; - uint8_t channel = limit(g_model.moduleData[g_moduleIdx].channelsStart, reusableBuffer.hardwareAndSettings.receiverSettings.outputsMapping[pin], lastChan); + uint8_t channel = g_model.moduleData[g_moduleIdx].channelsStart + reusableBuffer.hardwareAndSettings.receiverSettings.outputsMapping[pin]; int32_t channelValue = channelOutputs[channel]; lcdDrawText(0, y, "Pin"); lcdDrawNumber(lcdLastRightPos + 1, y, pin + 1); @@ -131,7 +130,7 @@ void menuModelReceiverOptions(event_t event) // Channel if (attr) { - channel = checkIncDec(event, channel, g_model.moduleData[g_moduleIdx].channelsStart, g_model.moduleData[g_moduleIdx].channelsStart + 8 + g_model.moduleData[g_moduleIdx].channelsCount - 1); + channel = checkIncDec(event, channel, 0, sentModuleChannels(g_moduleIdx) - 1); if (checkIncDec_Ret) { reusableBuffer.hardwareAndSettings.receiverSettings.outputsMapping[pin] = channel; reusableBuffer.hardwareAndSettings.receiverSettings.dirty = true;