Skip to content

Commit

Permalink
Improved 3rd (mid) fan detection #2067
Browse files Browse the repository at this point in the history
  • Loading branch information
seerge committed Feb 16, 2024
1 parent 42a598f commit 03bff51
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions app/AsusACPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -514,16 +514,25 @@ public byte[] GetFanCurve(AsusFan device, int mode = 0)
default: fan_mode = 0; break;
}

byte[] result;

switch (device)
{
case AsusFan.GPU:
return DeviceGetBuffer(DevsGPUFanCurve, fan_mode);
result = DeviceGetBuffer(DevsGPUFanCurve, fan_mode);
break;
case AsusFan.Mid:
return DeviceGetBuffer(DevsMidFanCurve, fan_mode);
result = DeviceGetBuffer(DevsMidFanCurve, fan_mode);
break;
default:
return DeviceGetBuffer(DevsCPUFanCurve, fan_mode);
result = DeviceGetBuffer(DevsCPUFanCurve, fan_mode);
break;
}

Logger.WriteLine($"GetFan {device} :" + BitConverter.ToString(result));

return result;

}

public static bool IsInvalidCurve(byte[] curve)
Expand Down
2 changes: 1 addition & 1 deletion app/Fans.cs
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ public void InitFans()
int chartCount = 2;

// Middle / system fan check
if (!AsusACPI.IsEmptyCurve(Program.acpi.GetFanCurve(AsusFan.Mid)))
if (!AsusACPI.IsEmptyCurve(Program.acpi.GetFanCurve(AsusFan.Mid)) || Program.acpi.GetFan(AsusFan.Mid) >= 0)
{
AppConfig.Set("mid_fan", 1);
chartCount++;
Expand Down

0 comments on commit 03bff51

Please sign in to comment.