Skip to content

Commit c5eea89

Browse files
Add new config option for new MSI laptops with absolute down threshold storage
Some new MSI laptops released starting circa 2025 appear to be storing absolute temperature down thresholds (instead of offsets from the up thresholds), resulting in odd down threshold display in YAMDCC configs and editor.
1 parent 0ab8a37 commit c5eea89

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

YAMDCC.Common/Configs/YAMDCC_Config.cs

+12
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,18 @@ public sealed class YAMDCC_Config
8888
[XmlElement]
8989
public DateTime? FirmDate { get; set; }
9090

91+
/// <summary>
92+
/// Set to <see langword="true"/> if the temperature down thresholds are
93+
/// stored in the EC as an offset from the corresponding up threshold,
94+
/// otherwise <see langword="false"/>.
95+
/// </summary>
96+
/// <remarks>
97+
/// Only known to be needed for one MSI laptop so far
98+
/// (Vector 16 HX AI A2XWIG), and possibly more released in 2025 or later.
99+
/// </remarks>
100+
[XmlElement]
101+
public bool OffsetDT { get; set; } = true;
102+
91103
/// <summary>
92104
/// The list of <see cref="FanConf"/>s associated with the laptop.
93105
/// </summary>

YAMDCC.Service/FanControlService.cs

+8-2
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,11 @@ private bool ApplyConf()
577577
{
578578
success = false;
579579
}
580-
if (!LogECWriteByte(cfg.DownThresholdRegs[j - 1], (byte)(t.UpThreshold - t.DownThreshold)))
580+
byte downT = Config.OffsetDT
581+
? (byte)(t.UpThreshold - t.DownThreshold)
582+
: t.DownThreshold;
583+
584+
if (!LogECWriteByte(cfg.DownThresholdRegs[j - 1], downT))
581585
{
582586
success = false;
583587
}
@@ -924,7 +928,9 @@ private bool ECtoConf()
924928
}
925929
if (LogECReadByte(cfg.DownThresholdRegs[j - 1], out value))
926930
{
927-
t.DownThreshold = (byte)(t.UpThreshold - value);
931+
t.DownThreshold = Config.OffsetDT
932+
? (byte)(t.UpThreshold - value)
933+
: value;
928934
}
929935
}
930936
}

0 commit comments

Comments
 (0)