respect CHANNEL_MAX in channels API

This commit is contained in:
Tester23
2025-01-27 06:22:11 +01:00
parent 3df11217c7
commit ed1d815d20

View File

@ -757,9 +757,6 @@ static int http_rest_get_pins(http_request_t* request) {
static int http_rest_get_channelTypes(http_request_t* request) {
int i;
int maxToPrint;
maxToPrint = 32;
http_setup(request, httpMimeTypeJson);
poststr(request, "{\"typenames\":[");
@ -773,7 +770,7 @@ static int http_rest_get_channelTypes(http_request_t* request) {
}
poststr(request, "],\"types\":[");
for (i = 0; i < maxToPrint; i++) {
for (i = 0; i < CHANNEL_MAX; i++) {
if (i) {
hprintf255(request, ",%d", g_cfg.pins.channelTypes[i]);
}