Setting Standard mode prior to going Ultimate

This commit is contained in:
Serge
2023-07-31 00:08:45 +02:00
parent 3ff0335985
commit 85cd10132e
2 changed files with 31 additions and 11 deletions

View File

@@ -465,7 +465,7 @@ namespace GHelper
if (auraDevice is null || !auraDevice.IsConnected) GetAuraDevice();
if (auraDevice is null || !auraDevice.IsConnected) return;
byte[] msg = new byte[40];
byte[] msg = new byte[0x40];
int start = 9;
msg[0] = AURA_HID_ID;
@@ -474,7 +474,14 @@ namespace GHelper
msg[3] = 1;
msg[4] = 4;
for (int i = 0; i < 10; i++)
for (int i = 0; i < 5; i++)
{
msg[start + i * 3] = color.R; // R
msg[start + 1 + i * 3] = color.G; // G
msg[start + 2 + i * 3] = color.B; // B
}
for (int i = 5; i < 12; i++)
{
msg[start + i * 3] = color.R; // R
msg[start + 1 + i * 3] = color.G; // G
@@ -484,13 +491,16 @@ namespace GHelper
//Logger.WriteLine(BitConverter.ToString(msg));
if (init)
{
auraDevice.WriteFeatureData(AuraMessage(0,Color.Red,color,0));
auraDevice.WriteFeatureData(MESSAGE_APPLY);
auraDevice.WriteFeatureData(MESSAGE_SET);
auraDevice.Write(new byte[] { AURA_HID_ID, 0xbc });
auraDevice.Write(new byte[] { AURA_HID_ID, 0xbc, 1, 1, 4 });
auraDevice.WriteFeatureData(LED_INIT2);
auraDevice.WriteFeatureData(new byte[] { AURA_HID_ID, 0x05, 0x20, 0x31, 0x00, 0x1A});
//auraDevice.WriteFeatureData(AuraMessage(0,Color.Red,color,0));
//auraDevice.WriteFeatureData(MESSAGE_APPLY);
//auraDevice.WriteFeatureData(MESSAGE_SET);
auraDevice.WriteFeatureData(new byte[] { AURA_HID_ID, 0xbc, 1, 0, 0, 0 });
auraDevice.WriteFeatureData(new byte[] { AURA_HID_ID, 0xbc, 1, 1, 4, 0 });
}
auraDevice.Write(msg);
auraDevice.WriteFeatureData(msg);
}

View File

@@ -49,11 +49,16 @@ namespace GHelper.Gpu
}
public void SetGPUMode(int GPUMode)
bool NoAutoUltimate()
{
return AppConfig.ContainsModel("G614") || AppConfig.ContainsModel("M16");
}
public void SetGPUMode(int GPUMode, int auto = 0)
{
int CurrentGPU = AppConfig.Get("gpu_mode");
AppConfig.Set("gpu_auto", 0);
AppConfig.Set("gpu_auto", auto);
if (CurrentGPU == GPUMode)
{
@@ -79,6 +84,11 @@ namespace GHelper.Gpu
DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertUltimateOn, Properties.Strings.AlertUltimateTitle, MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
{
if (NoAutoUltimate())
{
Program.acpi.SetGPUEco(0);
Thread.Sleep(100);
}
Program.acpi.DeviceSet(AsusACPI.GPUMux, 0, "GPUMux");
restart = true;
changed = true;
@@ -188,7 +198,7 @@ namespace GHelper.Gpu
if (mux == 0)
{
if (optimized) SetGPUMode(AsusACPI.GPUModeStandard);
if (optimized) SetGPUMode(AsusACPI.GPUModeStandard, 1);
return false;
}
else