SRGBmods.net Raspeberry Pi Pico updated version needs new support
Description of Bug
https://srgbmods.net/lcv1/ now produces Arduino sketches for RP2040 based devices that are incompatible with the current support in OpenRGB:
- The NeoPXL8 Arduino library is used now to control LEDs on up to 8 pins via DMA.
- Only one channel (Channel 1) is applicable.
- There's now support to select one out of a range of HW effects via USB packets, applied to all LEDs, and the selection gets persisted to "EEPROM".
- The Product ID has changed to
0x1205
. - The Product Name has changed to
LED Controller v1
. - The USB protocol has changed in order to include the new functions. Even the direct RGB control packet has changed with a simplified, reordered header. The current keepalive packet is now rejected.
The following patch contains minimal changes that make the current functionality "work", with these caveats:
- It doesn't remove the now-not-existing "Channel 2".
- It doesn't support the HW lighting effect configuration.
- It doesn't really support previous versions of the sketch anymore.
diff --git a/Controllers/SRGBmodsController/SRGBmodsControllerDetect.cpp b/Controllers/SRGBmodsController/SRGBmodsControllerDetect.cpp
index 69dc467b..f413ba32 100644
--- a/Controllers/SRGBmodsController/SRGBmodsControllerDetect.cpp
+++ b/Controllers/SRGBmodsController/SRGBmodsControllerDetect.cpp
@@ -6,7 +6,7 @@
#include <hidapi/hidapi.h>
#define SRGBMODS_PICO_VID 0x16D0
-#define SRGBMODS_PICO_PID 0x1123
+#define SRGBMODS_PICO_PID 0x1205
/******************************************************************************************\
* *
@@ -31,7 +31,7 @@ void DetectSRGBmodsControllers(hid_device_info* info, const std::string& name)
| Test the product string in case this USB ID is reused for other Pi Pico |
| projects |
\*-------------------------------------------------------------------------*/
- if(product_str == L"SRGBmods Pico LED Controller" || product_str == L"Pico LED Controller")
+ if(product_str == L"SRGBmods Pico LED Controller" || product_str == L"Pico LED Controller" || product_str == L"LED Controller v1")
{
SRGBmodsPicoController* controller = new SRGBmodsPicoController(dev, info->path);
RGBController_SRGBmodsPico* rgb_controller = new RGBController_SRGBmodsPico(controller);
diff --git a/Controllers/SRGBmodsController/SRGBmodsPicoController.cpp b/Controllers/SRGBmodsController/SRGBmodsPicoController.cpp
index ec013ec5..472b0fde 100644
--- a/Controllers/SRGBmodsController/SRGBmodsPicoController.cpp
+++ b/Controllers/SRGBmodsController/SRGBmodsPicoController.cpp
@@ -42,7 +42,7 @@ void SRGBmodsPicoController::KeepaliveThread()
{
if((std::chrono::steady_clock::now() - last_commit_time) > std::chrono::seconds(1))
{
- SendPacket(1, 0, 0, false, NULL, 0);
+ SendPacket(1, 254, 1, false, NULL, 0);
}
std::this_thread::sleep_for(5s);
}
@@ -116,9 +116,9 @@ void SRGBmodsPicoController::SendPacket
\*-----------------------------------------------------*/
usb_buf[0x00] = 0x00; /* hidapi Report ID*/
usb_buf[0x01] = this_packet_id; /* This Packet ID */
- usb_buf[0x02] = reset; /* Reset Flag */
- usb_buf[0x03] = last_packet_id; /* Last Packet ID */
- usb_buf[0x04] = channel + 1; /* Channel (1 or 2)*/
+ usb_buf[0x02] = last_packet_id; /* Last Packet ID */
+ usb_buf[0x03] = reset; /* Not really used */
+ usb_buf[0x04] = 0xAA; /* Color update */
for(unsigned int color_idx = 0; color_idx < num_colors; color_idx++)
{
Attached Log
Operating System
OS - Linux OS - MacOS OS - Windows
Hardware Configuration
Edited by Juan Jesús García de Soria Lucena