From fad7396c8f0e62d32e2fcbc22961809e49a18cc9 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Sun, 19 Nov 2023 23:20:24 +0100 Subject: [PATCH] Cleanup --- app/USB/Aura.cs | 55 +++++-------------------------------------------- 1 file changed, 5 insertions(+), 50 deletions(-) diff --git a/app/USB/Aura.cs b/app/USB/Aura.cs index ed44023e0..b9ce109ef 100644 --- a/app/USB/Aura.cs +++ b/app/USB/Aura.cs @@ -396,13 +396,13 @@ public static void ApplyPower() static byte[] packetZone = new byte[] { /*00 ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 */ - 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, + 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, /*10 F10 F11 F12 DEL ` 1 2 3 4 5 */ 2, 3, 3, 3, 0, 0, 0, 0, 1 , 1, /*20 6 7 8 9 0 - = BSP BSP BSP */ - 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, + 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, /*30 PLY TAB Q W E R T Y U I */ 3, 0, 0, 0, 1, 1, 1, 1, 2, 2, @@ -428,7 +428,7 @@ public static void ApplyPower() }; - public static void SetLedsDirect(Color[] color, bool init = false) + public static void ApplyDirect(Color[] color, bool init = false) { const byte keySet = 167; const byte ledCount = 178; @@ -488,50 +488,6 @@ public static void SetLedsDirect(Color[] color, bool init = false) AsusHid.WriteAura(buffer); } - public static void ApplyColorStrix(Color[] color, bool init = false) - { - byte[] msg = new byte[0x40]; - - byte start = 9; - byte maxLeds = 0x93; - - msg[0] = AsusHid.AURA_ID; - msg[1] = 0xbc; - msg[2] = 0; - msg[3] = 1; - msg[4] = 1; - msg[5] = 1; - msg[6] = 0; - msg[7] = 0x10; - - for (byte i = 0; i < AURA_ZONES; i++) - { - msg[start + i * 3] = color[i].R; // R - msg[start + 1 + i * 3] = color[i].G; // G - msg[start + 2 + i * 3] = color[i].B; // B - } - - if (init) - { - Init(); - AsusHid.WriteAura(new byte[] { AsusHid.AURA_ID, 0xbc }); - } - - for (byte b = 0; b < maxLeds; b += 0x10) - { - msg[6] = b; - AsusHid.WriteAura(msg); - } - - msg[6] = maxLeds; - AsusHid.WriteAura(msg); - - msg[4] = 4; - msg[5] = 0; - msg[6] = 0; - msg[7] = 0; - AsusHid.WriteAura(msg); - } public static void ApplyColor(Color color, bool init = false) { @@ -544,8 +500,7 @@ public static void ApplyColor(Color color, bool init = false) if (isStrix && !isOldHeatmap) { - SetLedsDirect(Enumerable.Repeat(color, AURA_ZONES).ToArray(), init); - //ApplyColorStrix(Enumerable.Repeat(color, AURA_ZONES).ToArray(), init); + ApplyDirect(Enumerable.Repeat(color, AURA_ZONES).ToArray(), init); return; } @@ -685,7 +640,7 @@ public static void ApplyAmbient(bool init = false) if (is_fresh) { - if (isStrix) SetLedsDirect(AmbientData.result, init); + if (isStrix) ApplyDirect(AmbientData.result, init); else ApplyColor(AmbientData.result[0], init); }