Release version 0.1.6. Fixed F71882 temperature reading. Added error handling for ATI GPUs (ADL). Fixed sensor events.
This commit is contained in:
+1
-1
@@ -110,7 +110,7 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
||||
public const int ADL_MAX_DISPLAYS = 40;
|
||||
public const int ADL_MAX_DEVICENAME = 32;
|
||||
public const int ADL_OK = 0;
|
||||
public const int ADL_FAIL = -1;
|
||||
public const int ADL_ERR = -1;
|
||||
public const int ADL_DRIVER_OK = 0;
|
||||
public const int ADL_MAX_GLSYNC_PORTS = 8;
|
||||
public const int ADL_MAX_GLSYNC_PORT_LEDS = 8;
|
||||
|
||||
+49
-14
@@ -54,6 +54,8 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
||||
private Sensor memoryClock;
|
||||
private Sensor coreVoltage;
|
||||
|
||||
private List<ISensor> active = new List<ISensor>();
|
||||
|
||||
public ATIGPU(string name, int adapterIndex, int busNumber,
|
||||
int deviceNumber)
|
||||
{
|
||||
@@ -92,10 +94,7 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
||||
}
|
||||
|
||||
public ISensor[] Sensors {
|
||||
get {
|
||||
return new ISensor[] { coreVoltage, coreClock, memoryClock, temperature,
|
||||
fan };
|
||||
}
|
||||
get { return active.ToArray(); }
|
||||
}
|
||||
|
||||
public string GetReport() {
|
||||
@@ -104,24 +103,60 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
||||
|
||||
public void Update() {
|
||||
ADLTemperature adlt = new ADLTemperature();
|
||||
ADL.ADL_Overdrive5_Temperature_Get(adapterIndex, 0, ref adlt);
|
||||
temperature.Value = 0.001f * adlt.Temperature;
|
||||
if (ADL.ADL_Overdrive5_Temperature_Get(adapterIndex, 0, ref adlt)
|
||||
== ADL.ADL_OK)
|
||||
{
|
||||
temperature.Value = 0.001f * adlt.Temperature;
|
||||
ActivateSensor(temperature);
|
||||
} else {
|
||||
DeactivateSensor(temperature);
|
||||
}
|
||||
|
||||
ADLFanSpeedValue adlf = new ADLFanSpeedValue();
|
||||
adlf.SpeedType = ADL.ADL_DL_FANCTRL_SPEED_TYPE_RPM;
|
||||
ADL.ADL_Overdrive5_FanSpeed_Get(adapterIndex, 0, ref adlf);
|
||||
fan.Value = adlf.FanSpeed;
|
||||
if (ADL.ADL_Overdrive5_FanSpeed_Get(adapterIndex, 0, ref adlf)
|
||||
== ADL.ADL_OK)
|
||||
{
|
||||
fan.Value = adlf.FanSpeed;
|
||||
ActivateSensor(fan);
|
||||
} else {
|
||||
DeactivateSensor(fan);
|
||||
}
|
||||
|
||||
ADLPMActivity adlp = new ADLPMActivity();
|
||||
ADL.ADL_Overdrive5_CurrentActivity_Get(adapterIndex, ref adlp);
|
||||
coreClock.Value = 0.01f * adlp.EngineClock;
|
||||
memoryClock.Value = 0.01f * adlp.MemoryClock;
|
||||
coreVoltage.Value = 0.001f * adlp.Vddc;
|
||||
if (ADL.ADL_Overdrive5_CurrentActivity_Get(adapterIndex, ref adlp)
|
||||
== ADL.ADL_OK)
|
||||
{
|
||||
coreClock.Value = 0.01f * adlp.EngineClock;
|
||||
memoryClock.Value = 0.01f * adlp.MemoryClock;
|
||||
coreVoltage.Value = 0.001f * adlp.Vddc;
|
||||
ActivateSensor(coreClock);
|
||||
ActivateSensor(memoryClock);
|
||||
ActivateSensor(coreVoltage);
|
||||
} else {
|
||||
DeactivateSensor(coreClock);
|
||||
DeactivateSensor(memoryClock);
|
||||
DeactivateSensor(coreVoltage);
|
||||
}
|
||||
}
|
||||
|
||||
private void ActivateSensor(Sensor sensor) {
|
||||
if (!active.Contains(sensor)) {
|
||||
active.Add(sensor);
|
||||
if (SensorAdded != null)
|
||||
SensorAdded(sensor);
|
||||
}
|
||||
}
|
||||
|
||||
private void DeactivateSensor(Sensor sensor) {
|
||||
if (active.Contains(sensor)) {
|
||||
active.Remove(sensor);
|
||||
if (SensorRemoved != null)
|
||||
SensorRemoved(sensor);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma warning disable 67
|
||||
public event SensorEventHandler SensorAdded;
|
||||
public event SensorEventHandler SensorRemoved;
|
||||
#pragma warning restore 67
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,9 +146,10 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
}
|
||||
|
||||
foreach (Sensor sensor in temperatures) {
|
||||
int value = ReadByte((byte)(TEMPERATURE_BASE_REG + 2 * sensor.Index));
|
||||
sbyte value = (sbyte)ReadByte((byte)(
|
||||
TEMPERATURE_BASE_REG + 2 * sensor.Index));
|
||||
sensor.Value = value;
|
||||
if (value < 254)
|
||||
if (value < sbyte.MaxValue && value > 0)
|
||||
ActivateSensor(sensor);
|
||||
else
|
||||
DeactivateSensor(sensor);
|
||||
@@ -170,14 +171,16 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
private void ActivateSensor(Sensor sensor) {
|
||||
if (!active.Contains(sensor)) {
|
||||
active.Add(sensor);
|
||||
SensorAdded(sensor);
|
||||
if (SensorAdded != null)
|
||||
SensorAdded(sensor);
|
||||
}
|
||||
}
|
||||
|
||||
private void DeactivateSensor(Sensor sensor) {
|
||||
if (active.Contains(sensor)) {
|
||||
active.Remove(sensor);
|
||||
SensorRemoved(sensor);
|
||||
if (SensorRemoved != null)
|
||||
SensorRemoved(sensor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -205,14 +205,16 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
private void ActivateSensor(Sensor sensor) {
|
||||
if (!active.Contains(sensor)) {
|
||||
active.Add(sensor);
|
||||
SensorAdded(sensor);
|
||||
if (SensorAdded != null)
|
||||
SensorAdded(sensor);
|
||||
}
|
||||
}
|
||||
|
||||
private void DeactivateSensor(Sensor sensor) {
|
||||
if (active.Contains(sensor)) {
|
||||
active.Remove(sensor);
|
||||
SensorRemoved(sensor);
|
||||
if (SensorRemoved != null)
|
||||
SensorRemoved(sensor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -239,14 +239,16 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
private void ActivateSensor(Sensor sensor) {
|
||||
if (!active.Contains(sensor)) {
|
||||
active.Add(sensor);
|
||||
SensorAdded(sensor);
|
||||
if (SensorAdded != null)
|
||||
SensorAdded(sensor);
|
||||
}
|
||||
}
|
||||
|
||||
private void DeactivateSensor(Sensor sensor) {
|
||||
if (active.Contains(sensor)) {
|
||||
active.Remove(sensor);
|
||||
SensorRemoved(sensor);
|
||||
if (SensorRemoved != null)
|
||||
SensorRemoved(sensor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,8 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
|
||||
deactivating.Remove(sensor);
|
||||
if (!active.Contains(sensor)) {
|
||||
active.Add(sensor);
|
||||
SensorAdded(sensor);
|
||||
if (SensorAdded != null)
|
||||
SensorAdded(sensor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +90,8 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
|
||||
if (deactivating.Contains(sensor)) {
|
||||
active.Remove(sensor);
|
||||
deactivating.Remove(sensor);
|
||||
SensorRemoved(sensor);
|
||||
if (SensorRemoved != null)
|
||||
SensorRemoved(sensor);
|
||||
} else if (active.Contains(sensor)) {
|
||||
deactivating.Add(sensor);
|
||||
}
|
||||
|
||||
@@ -69,5 +69,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.1.5.0")]
|
||||
[assembly: AssemblyFileVersion("0.1.5.0")]
|
||||
[assembly: AssemblyVersion("0.1.6.0")]
|
||||
[assembly: AssemblyFileVersion("0.1.6.0")]
|
||||
|
||||
Reference in New Issue
Block a user