Skip to content

Commit

Permalink
Add SMU version
Browse files Browse the repository at this point in the history
  • Loading branch information
irusanov committed Sep 1, 2019
1 parent b1d2dd3 commit c6a9b5d
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions AsusZsSrv/AsusZsSrv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ private void Init()
di.MemWrite(DataInterface.REG_NOTIFY_STATUS, 0x00);
di.MemWrite(DataInterface.REG_SERVER_VERSION, DataInterface.ServiceVersion);
di.MemWrite(DataInterface.REG_PING_PONG, 0x01);
di.MemWrite(DataInterface.REG_SMU_VERSION, cpuh.getSmuVersion());

for (int i = 0; i < CPUHandler.NumPstates; i++) di.MemWrite(DataInterface.REG_P0 + i, cpuh.Pstate[i]);

Expand Down
8 changes: 8 additions & 0 deletions AsusZsSrv/CPUHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,14 @@ public bool GetTemp(ref double Temp)
return res;
}

public UInt32 getSmuVersion()
{
UInt32 version = 0;

SmuRead(SMC_MSG_GetSmuVersion, ref version);
return version;
}

public bool WritePort80Temp(double temp)
{
if (temp > 99) temp = 99;
Expand Down
1 change: 1 addition & 0 deletions DataInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class DataInterface
public const int REG_PING_PONG = 0x0A;
public const int REG_NOTIFY_STATUS = 0x0B;
public const int REG_SERVER_VERSION = 0x0C;
public const int REG_SMU_VERSION = 0x0E;

public const int REG_SCALAR = 0x0D;

Expand Down
15 changes: 15 additions & 0 deletions NotificationIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public enum PerfEnh { None = 0, Default, Level1, Level2, Level3_OC };
public static string mbName;
public static string mbVendor;
public static string cpuName;
public static string smuVersionLabel;

public static DataInterface di;

Expand Down Expand Up @@ -318,6 +319,8 @@ private void IconDoubleClick(object sender, EventArgs e)
}

sf.Show();
sf.BringToFront();
sf.WindowState = FormWindowState.Normal;
}

private static UInt64 waitCmd;
Expand All @@ -330,6 +333,16 @@ public static void Execute(UInt64 cmd, bool updateGui)
waitCmdUpdateGui = updateGui;
}

private static string getVersionString(UInt64 version)
{
string[] versionString = new string[3];
versionString[0] = ((version & 0x00FF0000) >> 16).ToString("D2");
versionString[1] = ((version & 0x0000FF00) >> 8).ToString("D2");
versionString[2] = (0x002e18001 & 0x000000FF).ToString("D2");

return String.Join(".", versionString);
}

void tempTimerHandler(object sender, ElapsedEventArgs e)
{
try
Expand Down Expand Up @@ -379,6 +392,8 @@ void tempTimerHandler(object sender, ElapsedEventArgs e)

ServiceVersion = di.MemRead(DataInterface.REG_SERVER_VERSION);

NotificationIcon.smuVersionLabel = getVersionString(di.MemRead(DataInterface.REG_SMU_VERSION));

if ((di.MemRead(DataInterface.REG_SERVER_FLAGS) & DataInterface.FLAG_IS_AVAILABLE) == 0) isAvailable = false;
else isAvailable = true;

Expand Down
25 changes: 25 additions & 0 deletions SettingsForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions SettingsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public SettingsForm()
// MB/CPU description
labelMB.Text = NotificationIcon.mbName;
labelCPU.Text = NotificationIcon.cpuName;
smuVersionLabel.Text = NotificationIcon.smuVersionLabel;
label1.Text = "version " + Application.ProductVersion.Substring(0, Application.ProductVersion.LastIndexOf("."));

// Pstate controls
Expand Down

0 comments on commit c6a9b5d

Please sign in to comment.