Skip to content

Commit

Permalink
Aura tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
seerge committed Dec 22, 2023
1 parent eea453b commit 27b78ba
Showing 1 changed file with 21 additions and 25 deletions.
46 changes: 21 additions & 25 deletions app/USB/Aura.cs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ public static void ApplyDirect(Color[] color, bool init = false)
{
Init();
AsusHid.WriteAura(new byte[] { AsusHid.AURA_ID, 0xbc });
AsusHid.WriteAura(MESSAGE_APPLY);
}

Array.Clear(keyBuf, 0, keyBuf.Length);
Expand Down Expand Up @@ -521,7 +520,7 @@ public static void ApplyDirect(Color[] color, bool init = false)
}


public static void ApplyColor(Color color, bool init = false)
public static void ApplyDirect(Color color, bool init = false)
{

if (isACPI)
Expand All @@ -535,26 +534,23 @@ public static void ApplyColor(Color color, bool init = false)
ApplyDirect(Enumerable.Repeat(color, AURA_ZONES).ToArray(), init);
return;
}
else

if (init)
{
if (init)
{
Init();
AsusHid.WriteAura(new byte[] { AsusHid.AURA_ID, 0xbc });
AsusHid.WriteAura(MESSAGE_APPLY);
}
Init();
AsusHid.WriteAura(new byte[] { AsusHid.AURA_ID, 0xbc, 1 });
}

byte[] buffer = new byte[64];
buffer[0] = AsusHid.AURA_ID;
buffer[1] = 0xbc;
buffer[2] = 1;
buffer[3] = 1;
buffer[9] = color.R;
buffer[10] = color.G;
buffer[11] = color.B;
byte[] buffer = new byte[64];
buffer[0] = AsusHid.AURA_ID;
buffer[1] = 0xbc;
buffer[2] = 1;
buffer[3] = 1;
buffer[9] = color.R;
buffer[10] = color.G;
buffer[11] = color.B;

AsusHid.WriteAura(buffer);
}
AsusHid.WriteAura(buffer);

}

Expand Down Expand Up @@ -582,7 +578,7 @@ public static void ApplyAura()
{
CustomRGB.ApplyAmbient(true);
timer.Enabled = true;
timer.Interval = 100;
timer.Interval = 120;
return;
}

Expand Down Expand Up @@ -612,13 +608,13 @@ public static void ApplyGPUColor()
switch (GPUModeControl.gpuMode)
{
case AsusACPI.GPUModeUltimate:
ApplyColor(Color.Red, true);
ApplyDirect(Color.Red, true);
break;
case AsusACPI.GPUModeEco:
ApplyColor(Color.Green, true);
ApplyDirect(Color.Green, true);
break;
default:
ApplyColor(Color.Yellow, true);
ApplyDirect(Color.Yellow, true);
break;
}
}
Expand All @@ -636,7 +632,7 @@ public static void ApplyHeatmap(bool init = false)
else if (cpuTemp < hot) color = ColorUtils.GetWeightedAverage(Color.Yellow, Color.Red, ((float)cpuTemp - warm) / (hot - warm));
else color = Color.Red;

ApplyColor(color, init);
ApplyDirect(color, init);
}


Expand Down Expand Up @@ -688,7 +684,7 @@ public static void ApplyAmbient(bool init = false)
if (is_fresh)
{
if (isStrix) ApplyDirect(AmbientData.result, init);
else ApplyColor(AmbientData.result[0], init);
else ApplyDirect(AmbientData.result[0], init);
}

}
Expand Down

0 comments on commit 27b78ba

Please sign in to comment.