From e111b6e1b732a10fb7a794ebac4035c44dec092b Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sun, 22 Sep 2024 15:53:40 +0100 Subject: [PATCH] Hub75 - PIN_COUNT const --- wled00/bus_manager.cpp | 8 ++++---- wled00/bus_manager.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/wled00/bus_manager.cpp b/wled00/bus_manager.cpp index a2670518..5413873f 100644 --- a/wled00/bus_manager.cpp +++ b/wled00/bus_manager.cpp @@ -902,9 +902,9 @@ BusHub75Matrix::BusHub75Matrix(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWh #endif - int8_t pins[14]; + int8_t pins[PIN_COUNT]; memcpy(pins, &mxconfig.gpio, sizeof(mxconfig.gpio)); - pinManager.allocateMultiplePins(pins, 14, PinOwner::HUB75, true); + PinManager::allocateMultiplePins(pins, PIN_COUNT, PinOwner::HUB75, true); DEBUG_PRINTF("MatrixPanel_I2S_DMA config - %ux%u length: %u\n", mxconfig.mx_width, mxconfig.mx_height, mxconfig.chain_length); DEBUG_PRINTF("R1_PIN=%u, G1_PIN=%u, B1_PIN=%u, R2_PIN=%u, G2_PIN=%u, B2_PIN=%u, A_PIN=%u, B_PIN=%u, C_PIN=%u, D_PIN=%u, E_PIN=%u, LAT_PIN=%u, OE_PIN=%u, CLK_PIN=%u\n", @@ -1075,9 +1075,9 @@ void BusHub75Matrix::cleanup() { } void BusHub75Matrix::deallocatePins() { - uint8_t pins[14]; + uint8_t pins[PIN_COUNT]; memcpy(pins, &mxconfig.gpio, sizeof(mxconfig.gpio)); - pinManager.deallocateMultiplePins(pins, 14, PinOwner::HUB75); + PinManager::deallocateMultiplePins(pins, PIN_COUNT, PinOwner::HUB75); } std::vector BusHub75Matrix::getLEDTypes() { diff --git a/wled00/bus_manager.h b/wled00/bus_manager.h index dc54b27b..bc6a25db 100644 --- a/wled00/bus_manager.h +++ b/wled00/bus_manager.h @@ -358,6 +358,7 @@ class BusHub75Matrix : public Bus { // workaround for missing constants on include path for non-MM uint32_t IS_BLACK = 0x000000; uint32_t IS_DARKGREY = 0x333333; + const int PIN_COUNT = 14; }; #endif