Compare commits

..

7 Commits

Author SHA1 Message Date
Serge
f94d76aab9 Version bump 2023-12-22 21:51:57 +01:00
Serge
57b896d05a Aura GPU mode simplification 2023-12-22 21:41:53 +01:00
Serge
27b78ba1cf Aura tweaks 2023-12-22 20:53:51 +01:00
Serge
eea453b3c4 Airplane mode hotkey https://github.com/seerge/g-helper/issues/1765 2023-12-21 13:20:26 +01:00
Serge
e5dd7f54af Aura tweaks 2023-12-20 12:00:03 +01:00
Serge
149ed7f81b Aura improvements 2023-12-20 11:48:10 +01:00
Serge
88d4e5d3a8 Aura fixes 2023-12-20 01:48:55 +01:00
4 changed files with 40 additions and 31 deletions

View File

@@ -37,6 +37,7 @@ public class AsusACPI
public const uint UniversalControl = 0x00100021;
public const int Airplane = 0x88;
public const int KB_Light_Up = 0xc4;
public const int KB_Light_Down = 0xc5;
public const int Brightness_Down = 0x10;

View File

@@ -15,7 +15,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyVersion>0.140</AssemblyVersion>
<AssemblyVersion>0.141</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -584,6 +584,9 @@ namespace GHelper.Input
case 55: // Arconym
KeyProcess("m6");
return;
case 136: // FN + F12
Program.acpi.DeviceSet(AsusACPI.UniversalControl, AsusACPI.Airplane, "Airplane");
return;
case 181: // FN + Numpad Enter
KeyProcess("fne");
return;

View File

@@ -248,15 +248,12 @@ namespace GHelper.USB
public static void Init()
{
Task.Run(async () =>
{
AsusHid.Write(new List<byte[]> {
new byte[] { AsusHid.AURA_ID, 0xb9 },
Encoding.ASCII.GetBytes("]ASUS Tech.Inc."),
new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x1a },
//Encoding.ASCII.GetBytes("^ASUS Tech.Inc."),
//new byte[] { 0x5e, 0x05, 0x20, 0x31, 0, 0x1a }
});
AsusHid.Write(new List<byte[]> {
new byte[] { AsusHid.AURA_ID, 0xb9 },
Encoding.ASCII.GetBytes("]ASUS Tech.Inc."),
new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x1a },
//Encoding.ASCII.GetBytes("^ASUS Tech.Inc."),
//new byte[] { 0x5e, 0x05, 0x20, 0x31, 0, 0x1a }
});
}
@@ -523,7 +520,7 @@ namespace GHelper.USB
}
public static void ApplyColor(Color color, bool init = false)
public static void ApplyDirect(Color color, bool init = false)
{
if (isACPI)
@@ -538,22 +535,23 @@ namespace GHelper.USB
return;
}
else
if (init)
{
if (init) AsusHid.WriteAura(new byte[] { AsusHid.AURA_ID, 0xbc });
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);
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;
AsusHid.WriteAura(buffer);
}
public static void ApplyAura()
@@ -566,6 +564,8 @@ namespace GHelper.USB
timer.Enabled = false;
Logger.WriteLine($"AuraMode: {Mode}");
if (Mode == AuraMode.HEATMAP)
{
CustomRGB.ApplyHeatmap(true);
@@ -578,7 +578,7 @@ namespace GHelper.USB
{
CustomRGB.ApplyAmbient(true);
timer.Enabled = true;
timer.Interval = 100;
timer.Interval = 120;
return;
}
@@ -605,18 +605,23 @@ namespace GHelper.USB
{
if ((AuraMode)AppConfig.Get("aura_mode") != AuraMode.GPUMODE) return;
Color color;
switch (GPUModeControl.gpuMode)
{
case AsusACPI.GPUModeUltimate:
ApplyColor(Color.Red, true);
color = Color.Red;
break;
case AsusACPI.GPUModeEco:
ApplyColor(Color.Green, true);
color = Color.Green;
break;
default:
ApplyColor(Color.Yellow, true);
color = Color.Yellow;
break;
}
AsusHid.Write(new List<byte[]> { AuraMessage(AuraMode.AuraStatic, color, color, 0xeb, isSingleColor), MESSAGE_APPLY, MESSAGE_SET });
}
public static void ApplyHeatmap(bool init = false)
@@ -632,7 +637,7 @@ namespace GHelper.USB
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);
}
@@ -673,7 +678,7 @@ namespace GHelper.USB
screen_low.Dispose();
screeb_pxl.Dispose();
bool is_fresh = false;
bool is_fresh = init;
for (int i = 0; i < zones; i++)
{
@@ -684,7 +689,7 @@ namespace GHelper.USB
if (is_fresh)
{
if (isStrix) ApplyDirect(AmbientData.result, init);
else ApplyColor(AmbientData.result[0], init);
else ApplyDirect(AmbientData.result[0], init);
}
}