Skip to content

update to latest #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
0196dca
Add support for Gigabyte B550 Aorus Pro sensors (#1036)
javs Apr 3, 2023
32bcd93
support asus rog strix z390-i gaming embedded controller (#1046)
lavellse Apr 11, 2023
eff6628
Create virtual sensor for maximum CPU load across all cores. (#1047)
MattLichter Apr 11, 2023
a56e99d
Bump System.Management from 7.0.0 to 7.0.1 in /LibreHardwareMonitor (…
dependabot[bot] Apr 18, 2023
81afa07
Added fan control support for the EVGA X58 3X SLI motherboard (#1044)
AllyMcSqueal Apr 18, 2023
0d796c6
Misc for #1054 (#1055)
PhyxionNL Apr 28, 2023
ac4db9d
Adding checks around the value cache in the IPMI update (#1054) (#1061)
doolbneerg Apr 30, 2023
3404b78
Add support for ASUS ROG Z390-E Gaming Motherboard (#1069)
May 2, 2023
d759d52
Add basic Asus Rog Crosshair X670E Extreme Support for Embedded contr…
PanicPaintbrush May 3, 2023
0a65107
Add Names for Gigabyte B660M_DS3H_AX_DDR4 (#1076)
priyanshuagrawal May 19, 2023
6066b1a
Hotfix: Correct incorrect code on hash 0a65107 (#1079)
ImLp May 20, 2023
132d83e
Improve support for NZXT Kraken V3 devices and merge KrakenX and Krak…
brokenmass May 25, 2023
715a96f
fix issue preventing control of fans on kraken 2023 (#1085)
brokenmass May 29, 2023
613697a
Add support for Gigabyte B75M-D3H (#1087)
xCuri0 Jun 2, 2023
34cb32c
Update app.manifest
PhyxionNL Jun 2, 2023
f1a7bb7
Fixes https://github.com/Rem0o/FanControl.Releases/issues/1811
PhyxionNL Jun 5, 2023
9930c5f
Add support for ASUS ROG CROSSHAIR X670E GENE (#1092)
Crosenhain Jun 13, 2023
e9d091c
Add partially support for MS-7751 boards (F71889AD) (#1082)
wlkmanist Jun 13, 2023
701e8ad
Add support for IT87952E EC on Gigabyte boards (#1091)
mrehkopf Jun 13, 2023
248304a
Rename LPcPort.cs to LpcPort.cs
PhyxionNL Jun 13, 2023
c0f2740
Move mutexes out of Ring0
PhyxionNL Jun 14, 2023
f6b23ae
Bump System.Management from 7.0.1 to 7.0.2 in /LibreHardwareMonitor
dependabot[bot] Jun 14, 2023
aaee9b3
Merge pull request #1098 from LibreHardwareMonitor/dependabot/nuget/L…
dependabot[bot] Jun 15, 2023
fe36178
Add support for Razer PWM PC Fan Controller (#1090)
wlkmanist Jun 15, 2023
e6b8c42
Add table size for version 0x540104 (#1099)
namazso Jun 16, 2023
7e841d7
Update EmbeddedController.cs
PhyxionNL Jun 16, 2023
d3925f6
Move IT8665E Sensor to GetIteConfigurationsB (#1104)
tekert Jun 26, 2023
05b1d10
Revert "Move IT8665E Sensor to GetIteConfigurationsB (#1104)" (#1108)
PhyxionNL Jun 29, 2023
bf278be
Wrap stream.getfeature in try/catch (#1113)
Rem0o Jul 7, 2023
3af1e52
readme added Admistrator rights description (#1114)
earl-designs Jul 8, 2023
d0cf48c
Add board support for ASUS Z790-I GAMING WIFI with EC (#1124)
DrLippe Jul 27, 2023
833d82c
Added Gigabyte Z690 Aorus Ultra sensor names (#1127)
Armin2208 Jul 29, 2023
6d1a419
fix: Battery info Capabilities is a bit flag field (#1133)
inckie Aug 5, 2023
ddfdee7
Add basic Asus ROG Crosshair X670E Hero support (#1137)
facboy Aug 10, 2023
f0309b6
Add MS-7672 and MS-7757 boards (#1111)
wlkmanist Aug 20, 2023
c51381b
Fix it8665e control fans (#1109)
tekert Aug 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions LibreHardwareMonitor/LibreHardwareMonitor.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net472</TargetFramework>
Expand All @@ -25,7 +25,7 @@
<PackageReference Include="TaskScheduler" Version="2.10.1" />
<PackageReference Include="OxyPlot.Core" Version="2.1.2" />
<PackageReference Include="OxyPlot.WindowsForms" Version="2.1.2" />
<PackageReference Include="System.Management" Version="7.0.0" />
<PackageReference Include="System.Management" Version="7.0.2" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Web" />
Expand Down
2 changes: 1 addition & 1 deletion LibreHardwareMonitor/Resources/app.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
Expand Down
4 changes: 2 additions & 2 deletions LibreHardwareMonitorLib/Hardware/Battery/BatteryGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public unsafe BatteryGroup(ISettings settings)
IntPtr.Zero))
{
// Only batteries count.
if (bi.Capabilities == Kernel32.BatteryCapabilities.BATTERY_SYSTEM_BATTERY)
if (bi.Capabilities.HasFlag(Kernel32.BatteryCapabilities.BATTERY_SYSTEM_BATTERY))
{
const int maxLoadString = 100;

Expand Down Expand Up @@ -215,4 +215,4 @@ public string GetReport()

return reportBuilder.ToString();
}
}
}
6 changes: 6 additions & 0 deletions LibreHardwareMonitorLib/Hardware/Computer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using LibreHardwareMonitor.Hardware.Controller.AquaComputer;
using LibreHardwareMonitor.Hardware.Controller.Heatmaster;
using LibreHardwareMonitor.Hardware.Controller.Nzxt;
using LibreHardwareMonitor.Hardware.Controller.Razer;
using LibreHardwareMonitor.Hardware.Controller.TBalancer;
using LibreHardwareMonitor.Hardware.Cpu;
using LibreHardwareMonitor.Hardware.Gpu;
Expand Down Expand Up @@ -123,6 +124,7 @@ public bool IsControllerEnabled
Add(new AquaComputerGroup(_settings));
Add(new AeroCoolGroup(_settings));
Add(new NzxtGroup(_settings));
Add(new RazerGroup(_settings));
}
else
{
Expand All @@ -131,6 +133,7 @@ public bool IsControllerEnabled
RemoveType<AquaComputerGroup>();
RemoveType<AeroCoolGroup>();
RemoveType<NzxtGroup>();
RemoveType<RazerGroup>();
}
}

Expand Down Expand Up @@ -487,6 +490,7 @@ public void Open()
_smbios = new SMBios();

Ring0.Open();
Mutexes.Open();
OpCode.Open();

AddGroups();
Expand Down Expand Up @@ -519,6 +523,7 @@ private void AddGroups()
Add(new AquaComputerGroup(_settings));
Add(new AeroCoolGroup(_settings));
Add(new NzxtGroup(_settings));
Add(new RazerGroup(_settings));
}

if (_storageEnabled)
Expand Down Expand Up @@ -628,6 +633,7 @@ public void Close()
OpCode.Close();
InpOut.Close();
Ring0.Close();
Mutexes.Close();

_smbios = null;
_open = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using HidSharp;

namespace LibreHardwareMonitor.Hardware.Controller.AquaComputer;
Expand Down Expand Up @@ -119,8 +120,16 @@ public override void Close()
//TODO: Check tested and fix unknown variables
public override void Update()
{
_rawData[0] = 0x4;
_stream.GetFeature(_rawData);
try
{
_rawData[0] = 0x4;
_stream.GetFeature(_rawData);
}
catch (IOException)
{
return;
}


if (_rawData[0] != 0x4)
return;
Expand Down Expand Up @@ -156,4 +165,4 @@ private enum MODE : byte
MODE_FAN_AMP = 2,
MODE_FAN_CONTROLLER = 4
}
}
}
13 changes: 11 additions & 2 deletions LibreHardwareMonitorLib/Hardware/Controller/AquaComputer/MPS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// All Rights Reserved.

using System;
using System.IO;
using HidSharp;

namespace LibreHardwareMonitor.Hardware.Controller.AquaComputer;
Expand Down Expand Up @@ -76,8 +77,15 @@ public override void Close()

public override void Update()
{
_rawData[0] = MPS_REPORT_ID;
_stream.GetFeature(_rawData);
try
{
_rawData[0] = MPS_REPORT_ID;
_stream.GetFeature(_rawData);
}
catch (IOException)
{
return;
}

if (_rawData[0] != MPS_REPORT_ID)
return;
Expand All @@ -96,6 +104,7 @@ public override void Update()
}

_temperatures[1].Value = BitConverter.ToUInt16(_rawData, InternalWaterTemperature) / 100f;

}

private ushort ExtractFirmwareVersion()
Expand Down
77 changes: 40 additions & 37 deletions LibreHardwareMonitorLib/Hardware/Controller/Nzxt/GridV3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,30 @@ namespace LibreHardwareMonitor.Hardware.Controller.Nzxt;
/// </summary>
internal sealed class GridV3 : Hardware
{
private const int FANS_COUNT = 6;

// Some initialization messages to send to the controller. No visible effects but NZXT CAM send them.
private static readonly byte[] _initialize1 = { 0x01, 0x5c };
private static readonly byte[] _initialize2 = { 0x01, 0x5d };
private static readonly byte[] _initialize3 = { 0x01, 0x59 };

private const int FANS_COUNT = 6;

private readonly byte[] _setFanSpeedMsg;
private readonly HidStream _stream;
private readonly Dictionary<int, byte[]> _rawData = new();

private readonly Sensor _noise;
private readonly Sensor[] _currents = new Sensor[FANS_COUNT];
private readonly Control[] _fanControls = new Control[FANS_COUNT];
private readonly Sensor _noise;
private readonly Sensor[] _powers = new Sensor[FANS_COUNT];
private readonly Sensor[] _pwmControls = new Sensor[FANS_COUNT];
private readonly Dictionary<int, byte[]> _rawData = new();
private readonly Sensor[] _rpmSensors = new Sensor[FANS_COUNT];
private readonly byte[] _setFanSpeedMsg;
private readonly HidStream _stream;
private readonly Sensor[] _voltages = new Sensor[FANS_COUNT];

private readonly Control[] _fanControls = new Control[FANS_COUNT];

public GridV3(HidDevice dev, ISettings settings) : base("NZXT GRID+ V3", new Identifier("nzxt", "gridv3", dev.GetSerialNumber().TrimStart('0')), settings)
{
if (dev.TryOpen(out _stream))
{
for (int fanID = 0; fanID < FANS_COUNT; fanID++)
{
_rawData[fanID] = new byte[21];
}
for (int fanId = 0; fanId < FANS_COUNT; fanId++)
_rawData[fanId] = new byte[21];

_setFanSpeedMsg = new byte[65];
_setFanSpeedMsg[0] = 0x02;
Expand Down Expand Up @@ -90,42 +86,48 @@ internal sealed class GridV3 : Hardware
// NZXT GRID does not report current PWM value. So we need to initialize it with some value to keep GUI and device values in sync.
_fanControls[i].SetDefault();
}

_noise = new Sensor("GRID Noise", 0, SensorType.Noise, this, Array.Empty<ParameterDescription>(), settings);
ActivateSensor(_noise);

Thread readGridReports = new(ContinuousRead) { IsBackground = true };
readGridReports.Start(_rawData);

IsValid = true;
}
}

public string FirmwareVersion { get; }

public override HardwareType HardwareType => HardwareType.Cooler;

public bool IsValid { get; }

private void SoftwareControlValueChanged(Control control)
{
if (control.ControlMode == ControlMode.Software)
switch (control.ControlMode)
{
float value = control.SoftwareValue;
byte fanSpeed = (byte)(value > 100 ? 100 : value < 0 ? 0 : value); // Clamp the value, anything out of range will fail
case ControlMode.Software:
float value = control.SoftwareValue;
byte fanSpeed = (byte)(value > 100 ? 100 : value < 0 ? 0 : value); // Clamp the value, anything out of range will fail

//_controlling = true;
_setFanSpeedMsg[2] = (byte)control.Sensor.Index;
_setFanSpeedMsg[4] = fanSpeed;
//_controlling = true;
_setFanSpeedMsg[2] = (byte)control.Sensor.Index;
_setFanSpeedMsg[4] = fanSpeed;

_stream.Write(_setFanSpeedMsg);
_stream.Write(_setFanSpeedMsg);

_pwmControls[control.Sensor.Index].Value = value;
}
else if (control.ControlMode == ControlMode.Default)
{
// There isn't a "default" mode, but let's say a safe setting is 40%
_setFanSpeedMsg[2] = (byte)control.Sensor.Index;
_setFanSpeedMsg[4] = 40;
_pwmControls[control.Sensor.Index].Value = value;
break;
case ControlMode.Default:
// There isn't a "default" mode, but let's say a safe setting is 40%
_setFanSpeedMsg[2] = (byte)control.Sensor.Index;
_setFanSpeedMsg[4] = 40;

_stream.Write(_setFanSpeedMsg);
_stream.Write(_setFanSpeedMsg);

_pwmControls[control.Sensor.Index].Value = 40;
_pwmControls[control.Sensor.Index].Value = 40;
break;
}
}

Expand All @@ -147,8 +149,8 @@ private void ContinuousRead(object state)
{
lock (_rawData)
{
int fanID = (buffer[15] >> 4) & 0x0f;
Array.Copy(buffer, _rawData[fanID], buffer.Length);
int fanId = (buffer[15] >> 4) & 0x0f;
Array.Copy(buffer, _rawData[fanId], buffer.Length);
}
}
}
Expand All @@ -167,16 +169,17 @@ private void ContinuousRead(object state)

public override void Update()
{
// The NZXT GRID+ V3 series sends updates periodically. We have to read it in a seperate thread, this call just reads that data.
// The NZXT GRID+ V3 series sends updates periodically. We have to read it in a separate thread, this call just reads that data.
lock (_rawData)
{
for (int fanID = 0; fanID < FANS_COUNT; fanID++)
for (int fanId = 0; fanId < FANS_COUNT; fanId++)
{
_rpmSensors[fanID].Value = (_rawData[fanID][3] << 8) | _rawData[fanID][4];
_voltages[fanID].Value = _rawData[fanID][7] + _rawData[fanID][8] / 100.0f;
_currents[fanID].Value = _rawData[fanID][9] + _rawData[fanID][10] / 100.0f;
_powers[fanID].Value = _currents[fanID].Value * _voltages[fanID].Value;
_rpmSensors[fanId].Value = (_rawData[fanId][3] << 8) | _rawData[fanId][4];
_voltages[fanId].Value = _rawData[fanId][7] + _rawData[fanId][8] / 100.0f;
_currents[fanId].Value = _rawData[fanId][9] + _rawData[fanId][10] / 100.0f;
_powers[fanId].Value = _currents[fanId].Value * _voltages[fanId].Value;
}

_noise.Value = _rawData[2][1];
}
}
Expand Down
Loading