revert(color): only show used channels in channel monitor (#6807)

This commit is contained in:
philmoz
2025-11-20 17:54:01 +10:00
committed by GitHub
parent 000668bf0b
commit 127b1061d5
@@ -26,6 +26,9 @@
#include "model_select.h" #include "model_select.h"
#include "edgetx.h" #include "edgetx.h"
// TODO: find better way to detect only used channels!
#define ALL_CHANNELS true
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class ChannelsViewFooter : public Window class ChannelsViewFooter : public Window
@@ -96,7 +99,7 @@ class ChannelsViewPage : public PageGroupItem
for (uint8_t i = 0, j = 0; j < rows * cols; i += 1) { for (uint8_t i = 0, j = 0; j < rows * cols; i += 1) {
uint8_t chan = startChan + i; uint8_t chan = startChan + i;
if (chan >= MAX_OUTPUT_CHANNELS) break; if (chan >= MAX_OUTPUT_CHANNELS) break;
if (isChannelUsed(chan)) { if (ALL_CHANNELS || isChannelUsed(chan)) {
#if PORTRAIT #if PORTRAIT
coord_t xPos = PAD_SMALL; coord_t xPos = PAD_SMALL;
coord_t yPos = j * ((window->height() - PAD_LARGE * 3) / rows); coord_t yPos = j * ((window->height() - PAD_LARGE * 3) / rows);
@@ -137,7 +140,7 @@ ChannelsViewMenu::ChannelsViewMenu() :
for (int i = 0; i < MAX_OUTPUT_CHANNELS;) { for (int i = 0; i < MAX_OUTPUT_CHANNELS;) {
int start = i; int start = i;
while (!isChannelUsed(start)) { while (!ALL_CHANNELS && !isChannelUsed(start)) {
start += 1; start += 1;
if (start >= MAX_OUTPUT_CHANNELS) break; if (start >= MAX_OUTPUT_CHANNELS) break;
} }
@@ -146,7 +149,7 @@ ChannelsViewMenu::ChannelsViewMenu() :
int last = start; int last = start;
int end = start + 1; int end = start + 1;
while (end < MAX_OUTPUT_CHANNELS && count < chansPerPage) { while (end < MAX_OUTPUT_CHANNELS && count < chansPerPage) {
if (isChannelUsed(end)) { if (ALL_CHANNELS || isChannelUsed(end)) {
count += 1; count += 1;
last = end; last = end;
} }