diff --git a/.github/workflows/libdmdutil.yml b/.github/workflows/libdmdutil.yml index 4414547..0f0a25e 100644 --- a/.github/workflows/libdmdutil.yml +++ b/.github/workflows/libdmdutil.yml @@ -69,7 +69,7 @@ jobs: - if: (matrix.os == 'macos-latest') name: Add autoconf and automake (mac runner) run: | - brew install autoconf automake + brew install autoconf automake libtool - if: (!(matrix.platform == 'linux' && matrix.arch == 'aarch64')) name: Build libdmdutil-${{ matrix.platform }}-${{ matrix.arch }} run: | diff --git a/README.md b/README.md index 623b1ad..ec8d638 100644 --- a/README.md +++ b/README.md @@ -209,8 +209,6 @@ SaveSettings = 0 Enabled = 1 # Disable auto-detection and provide a fixed serial port Device = -# Set to 0 if RGB, 1 if RBG. -Matrix = 0 ``` ## Building: diff --git a/dmdserver.ini b/dmdserver.ini index 9c8aea4..ab737ed 100644 --- a/dmdserver.ini +++ b/dmdserver.ini @@ -39,5 +39,3 @@ SaveSettings = 0 Enabled = 1 # Disable auto-detection and provide a fixed serial port Device = -# Set to 0 if RGB, 1 if RBG. -Matrix = 0 diff --git a/include/DMDUtil/Config.h b/include/DMDUtil/Config.h index 9dad5e4..cc640dd 100644 --- a/include/DMDUtil/Config.h +++ b/include/DMDUtil/Config.h @@ -66,8 +66,6 @@ class DMDUTILAPI Config void SetPixelcade(bool pixelcade) { m_pixelcade = pixelcade; } void SetPixelcadeDevice(const char* port) { m_pixelcadeDevice = port; } const char* GetPixelcadeDevice() const { return m_pixelcadeDevice.c_str(); } - int GetPixelcadeMatrix() const { return m_pixelcadeMatrix; } - void SetPixelcadeMatrix(int matrix) { m_pixelcadeMatrix = matrix; } void SetDMDServer(bool dmdServer) { m_dmdServer = dmdServer; } bool IsDmdServer() { return m_dmdServer; } void SetDMDServerAddr(const char* addr) { m_dmdServerAddr = addr; } @@ -108,7 +106,6 @@ class DMDUTILAPI Config int m_dmdServerPort; bool m_pixelcade; std::string m_pixelcadeDevice; - int m_pixelcadeMatrix; DMDUtil_LogLevel m_logLevel; DMDUtil_LogCallback m_logCallback; DMDUtil_PUPTriggerCallbackContext m_pupTriggerCallbackContext; diff --git a/src/Config.cpp b/src/Config.cpp index 7b77b1f..edc5461 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -31,7 +31,6 @@ Config::Config() m_zedmdSaveSettings = false; m_pixelcade = true; m_pixelcadeDevice.clear(); - m_pixelcadeMatrix = 0; m_dmdServer = false; m_dmdServerAddr = "localhost"; m_dmdServerPort = 6789; diff --git a/src/DMD.cpp b/src/DMD.cpp index fe2fa35..f12a200 100644 --- a/src/DMD.cpp +++ b/src/DMD.cpp @@ -505,7 +505,7 @@ void DMD::FindDisplays() if (pConfig->IsPixelcade()) { pPixelcadeDMD = - PixelcadeDMD::Connect(pConfig->GetPixelcadeDevice(), pConfig->GetPixelcadeMatrix(), 128, 32); + PixelcadeDMD::Connect(pConfig->GetPixelcadeDevice(), 128, 32); if (pPixelcadeDMD) m_pPixelcadeDMDThread = new std::thread(&DMD::PixelcadeDMDThread, this); } diff --git a/src/PixelcadeDMD.cpp b/src/PixelcadeDMD.cpp index fe32a3b..60060a1 100644 --- a/src/PixelcadeDMD.cpp +++ b/src/PixelcadeDMD.cpp @@ -16,12 +16,12 @@ namespace DMDUtil { -PixelcadeDMD::PixelcadeDMD(struct sp_port* pSerialPort, int matrix, int width, int height) +PixelcadeDMD::PixelcadeDMD(struct sp_port* pSerialPort, int width, int height, bool colorSwap) { m_pSerialPort = pSerialPort; m_width = width; m_height = height; - m_matrix = matrix; + m_colorSwap = colorSwap; m_length = width * height; m_pThread = nullptr; m_running = false; @@ -47,7 +47,7 @@ PixelcadeDMD::~PixelcadeDMD() } } -PixelcadeDMD* PixelcadeDMD::Connect(const char* pDevice, int matrix, int width, int height) +PixelcadeDMD* PixelcadeDMD::Connect(const char* pDevice, int width, int height) { PixelcadeDMD* pPixelcadeDMD = nullptr; @@ -55,7 +55,7 @@ PixelcadeDMD* PixelcadeDMD::Connect(const char* pDevice, int matrix, int width, { Log(DMDUtil_LogLevel_INFO, "Connecting to Pixelcade on %s...", pDevice); - pPixelcadeDMD = Open(pDevice, matrix, width, height); + pPixelcadeDMD = Open(pDevice, width, height); if (!pPixelcadeDMD) Log(DMDUtil_LogLevel_INFO, "Unable to connect to Pixelcade on %s", pDevice); } @@ -69,7 +69,7 @@ PixelcadeDMD* PixelcadeDMD::Connect(const char* pDevice, int matrix, int width, { for (int i = 0; ppPorts[i]; i++) { - pPixelcadeDMD = Open(sp_get_port_name(ppPorts[i]), matrix, width, height); + pPixelcadeDMD = Open(sp_get_port_name(ppPorts[i]), width, height); if (pPixelcadeDMD) break; } sp_free_port_list(ppPorts); @@ -81,7 +81,7 @@ PixelcadeDMD* PixelcadeDMD::Connect(const char* pDevice, int matrix, int width, return pPixelcadeDMD; } -PixelcadeDMD* PixelcadeDMD::Open(const char* pDevice, int matrix, int width, int height) +PixelcadeDMD* PixelcadeDMD::Open(const char* pDevice, int width, int height) { struct sp_port* pSerialPort = nullptr; enum sp_return result = sp_get_port_by_name(pDevice, &pSerialPort); @@ -141,7 +141,7 @@ PixelcadeDMD* PixelcadeDMD::Open(const char* pDevice, int matrix, int width, int Log(DMDUtil_LogLevel_INFO, "Pixelcade found: device=%s, Hardware ID=%s, Bootloader ID=%s, Firmware=%s", pDevice, hardwareId, bootloaderId, firmware); - return new PixelcadeDMD(pSerialPort, matrix, width, height); + return new PixelcadeDMD(pSerialPort, width, height, (firmware[4] == 'C')); } void PixelcadeDMD::Update(uint16_t* pData) @@ -176,7 +176,7 @@ void PixelcadeDMD::Run() int errors = 0; FrameUtil::ColorMatrix colorMatrix = - (m_matrix == 0) ? FrameUtil::ColorMatrix::Rgb : FrameUtil::ColorMatrix::Rbg; + (!m_colorSwap) ? FrameUtil::ColorMatrix::Rgb : FrameUtil::ColorMatrix::Rbg; while (m_running) { diff --git a/src/PixelcadeDMD.h b/src/PixelcadeDMD.h index 3bd873e..742b3c4 100644 --- a/src/PixelcadeDMD.h +++ b/src/PixelcadeDMD.h @@ -27,21 +27,21 @@ namespace DMDUtil class PixelcadeDMD { public: - PixelcadeDMD(struct sp_port* pSerialPort, int matrix, int width, int height); + PixelcadeDMD(struct sp_port* pSerialPort, int width, int height, bool colorSwap); ~PixelcadeDMD(); - static PixelcadeDMD* Connect(const char* pDevice, int matrix, int width, int height); + static PixelcadeDMD* Connect(const char* pDevice, int width, int height); void Update(uint16_t* pData); private: - static PixelcadeDMD* Open(const char* pDevice, int matrix, int width, int height); + static PixelcadeDMD* Open(const char* pDevice, int width, int height); void Run(); void EnableRgbLedMatrix(int shifterLen32, int rows); struct sp_port* m_pSerialPort; - int m_matrix; int m_width; int m_height; + bool m_colorSwap; int m_length; std::thread* m_pThread; diff --git a/src/dmdServer.cpp b/src/dmdServer.cpp index 385c87a..daf394d 100644 --- a/src/dmdServer.cpp +++ b/src/dmdServer.cpp @@ -289,7 +289,6 @@ int main(int argc, char* argv[]) // Pixelcade pConfig->SetPixelcade(r.Get("Pixelcade", "Enabled", true)); pConfig->SetPixelcadeDevice(r.Get("Pixelcade", "Device", "").c_str()); - pConfig->SetPixelcadeMatrix(r.Get("Pixelcade", "Matrix", -1)); if (opt_verbose) DMDUtil::Log(DMDUtil_LogLevel_INFO, "Loaded config file"); }