Add check for ADL (fan) Sensor support (#467)

* Add check for ADL (fan) Sensor support

* Use the right property.
This commit is contained in:
kolos
2021-06-10 17:14:43 +02:00
committed by GitHub
parent a8dc0a03ad
commit ad1b8a8687
@@ -295,7 +295,7 @@ namespace LibreHardwareMonitor.Hardware.Gpu
const int fanRpmIndex = (int)AtiAdlxx.ADLSensorType.PMLOG_FAN_RPM;
const int fanPercentageIndex = (int)AtiAdlxx.ADLSensorType.PMLOG_FAN_PERCENTAGE;
if (logDataOutput.sensors.Length is > fanRpmIndex and > fanPercentageIndex && logDataOutput.sensors[fanRpmIndex].value != ushort.MaxValue)
if (logDataOutput.sensors.Length is > fanRpmIndex and > fanPercentageIndex && logDataOutput.sensors[fanRpmIndex].value != ushort.MaxValue && logDataOutput.sensors[fanRpmIndex].supported != 0)
{
_fan.Value = logDataOutput.sensors[fanRpmIndex].value;
_controlSensor.Value = logDataOutput.sensors[fanPercentageIndex].value;