diff --git a/Controllers/HyperXMouseController/HyperXPulsefireSurgeController.cpp b/Controllers/HyperXMouseController/HyperXPulsefireSurgeController.cpp index cfb135910..170ccc68c 100644 --- a/Controllers/HyperXMouseController/HyperXPulsefireSurgeController.cpp +++ b/Controllers/HyperXMouseController/HyperXPulsefireSurgeController.cpp @@ -149,15 +149,15 @@ void HyperXPulsefireSurgeController::SendWakeup() void HyperXPulsefireSurgeController::SendData ( - RGBColor* color_data + unsigned char mode, + RGBColor* color_data ) { unsigned char buf[264]; - unsigned char dpi_1 = 100; - unsigned char dpi_2 = 100; - unsigned char dpi_3 = 100; - unsigned char effect = 0; + unsigned short dpi_1 = 0x000A; + unsigned short dpi_2 = 0x0014; + unsigned short dpi_3 = 0x001E; unsigned char dpi_r = 255; unsigned char dpi_g = 255; unsigned char dpi_b = 255; @@ -187,12 +187,12 @@ void HyperXPulsefireSurgeController::SendData /*-----------------------------------------------------*\ | DPI settings | \*-----------------------------------------------------*/ - buf[0x08] = dpi_1; - buf[0x09] = dpi_1; - buf[0x0A] = dpi_2; - buf[0x0B] = dpi_2; - buf[0x0C] = dpi_3; - buf[0x0D] = dpi_3; + buf[0x08] = (dpi_1 & 0xFF); + buf[0x09] = dpi_1 >> 8; + buf[0x0A] = (dpi_2 & 0xFF); + buf[0x0B] = dpi_2 >> 8; + buf[0x0C] = (dpi_3 & 0xFF); + buf[0x0D] = dpi_3 >> 8; buf[0x0E] = 0x80; @@ -203,12 +203,12 @@ void HyperXPulsefireSurgeController::SendData /*-----------------------------------------------------*\ | DPI settings | \*-----------------------------------------------------*/ - buf[0x14] = dpi_1; - buf[0x15] = dpi_1; - buf[0x16] = dpi_2; - buf[0x17] = dpi_2; - buf[0x18] = dpi_3; - buf[0x19] = dpi_3; + buf[0x14] = (dpi_1 & 0xFF); + buf[0x15] = dpi_1 >> 8; + buf[0x16] = (dpi_2 & 0xFF); + buf[0x17] = dpi_2 >> 8; + buf[0x18] = (dpi_3 & 0xFF); + buf[0x19] = dpi_3 >> 8; buf[0x1A] = 0x80; buf[0x1C] = 0x40; @@ -239,7 +239,7 @@ void HyperXPulsefireSurgeController::SendData buf[0x4E] = 0x01; buf[0x50] = 0x01; - buf[0x51] = effect; + buf[0x51] = mode; buf[0x52] = 0x03; buf[0x53] = 0x03; buf[0x54] = 0x03; diff --git a/Controllers/HyperXMouseController/HyperXPulsefireSurgeController.h b/Controllers/HyperXMouseController/HyperXPulsefireSurgeController.h index 9035da2e2..250540e54 100644 --- a/Controllers/HyperXMouseController/HyperXPulsefireSurgeController.h +++ b/Controllers/HyperXMouseController/HyperXPulsefireSurgeController.h @@ -14,6 +14,15 @@ #pragma once +enum +{ + HYPERX_PULSEFIRE_SURGE_MODE_SOLID = 0x00, /* Solid color mode */ + HYPERX_PULSEFIRE_SURGE_MODE_CYCLE = 0x01, /* Spectrum cycle mode */ + HYPERX_PULSEFIRE_SURGE_MODE_BREATHING = 0x02, /* Breathing mode */ + HYPERX_PULSEFIRE_SURGE_MODE_WAVE = 0x03, /* Wave mode */ + HYPERX_PULSEFIRE_SURGE_MODE_TRIGGER = 0x04, /* Trigger mode */ +}; + class HyperXPulsefireSurgeController { public: @@ -22,7 +31,8 @@ public: void SendData ( - RGBColor* color_data + unsigned char mode, + RGBColor* color_data ); private: diff --git a/RGBController/RGBController_HyperXPulsefireSurge.cpp b/RGBController/RGBController_HyperXPulsefireSurge.cpp index 4e509947e..8075c0fca 100644 --- a/RGBController/RGBController_HyperXPulsefireSurge.cpp +++ b/RGBController/RGBController_HyperXPulsefireSurge.cpp @@ -19,11 +19,32 @@ RGBController_HyperXPulsefireSurge::RGBController_HyperXPulsefireSurge(HyperXPul mode Direct; Direct.name = "Direct"; - Direct.value = 0; + Direct.value = HYPERX_PULSEFIRE_SURGE_MODE_SOLID; Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR; Direct.color_mode = MODE_COLORS_PER_LED; modes.push_back(Direct); + mode Cycle; + Cycle.name = "Cycle"; + Cycle.value = HYPERX_PULSEFIRE_SURGE_MODE_CYCLE; + Cycle.flags = 0; + Cycle.color_mode = MODE_COLORS_NONE; + modes.push_back(Cycle); + + mode Breathing; + Breathing.name = "Breathing"; + Breathing.value = HYPERX_PULSEFIRE_SURGE_MODE_BREATHING; + Breathing.flags = 0; + Breathing.color_mode = MODE_COLORS_NONE; + modes.push_back(Breathing); + + mode Wave; + Wave.name = "Wave"; + Wave.value = HYPERX_PULSEFIRE_SURGE_MODE_WAVE; + Wave.flags = 0; + Wave.color_mode = MODE_COLORS_NONE; + modes.push_back(Wave); + SetupZones(); }; @@ -74,7 +95,7 @@ void RGBController_HyperXPulsefireSurge::ResizeZone(int /*zone*/, int /*new_size void RGBController_HyperXPulsefireSurge::DeviceUpdateLEDs() { - hyperx->SendData(&colors[0]); + hyperx->SendData(active_mode, &colors[0]); } void RGBController_HyperXPulsefireSurge::UpdateZoneLEDs(int /*zone*/) @@ -94,7 +115,7 @@ void RGBController_HyperXPulsefireSurge::SetCustomMode() void RGBController_HyperXPulsefireSurge::DeviceUpdateMode() { - + DeviceUpdateLEDs(); } void RGBController_HyperXPulsefireSurge::KeepaliveThread()