More logs

This commit is contained in:
Serge
2023-07-03 21:11:03 +02:00
parent 1e26696eb6
commit 2c317d9a18
2 changed files with 35 additions and 16 deletions

View File

@@ -252,10 +252,18 @@ namespace GHelper.Mode
if (ProcessHelper.IsUserAdministrator()) if (ProcessHelper.IsUserAdministrator())
{ {
SendCommand.set_stapm_limit((uint)limit_total * 1000); var stapmResult = SendCommand.set_stapm_limit((uint)limit_total * 1000);
SendCommand.set_stapm2_limit((uint)limit_total * 1000); Logger.WriteLine($"STAPM: {limit_total} {stapmResult}");
SendCommand.set_slow_limit((uint)limit_total * 1000);
SendCommand.set_fast_limit((uint)limit_total * 1000); var stapmResult2 = SendCommand.set_stapm2_limit((uint)limit_total * 1000);
Logger.WriteLine($"STAPM2: {limit_total} {stapmResult2}");
var slowResult = SendCommand.set_slow_limit((uint)limit_total * 1000);
Logger.WriteLine($"SLOW: {limit_total} {slowResult}");
var fastResult = SendCommand.set_fast_limit((uint)limit_total * 1000);
Logger.WriteLine($"FAST: {limit_total} {fastResult}");
customPower = limit_total; customPower = limit_total;
} }
else if (launchAsAdmin) else if (launchAsAdmin)

View File

@@ -26,18 +26,19 @@ namespace Ryzen
//STAMP Limit //STAMP Limit
public static void set_stapm_limit(uint value) public static Smu.Status? set_stapm_limit(uint value)
{ {
RyzenAccess.Initialize(); RyzenAccess.Initialize();
uint[] Args = new uint[6]; uint[] Args = new uint[6];
Args[0] = value; Args[0] = value;
Smu.Status? result = null;
switch (FAMID) switch (FAMID)
{ {
case 0: case 0:
case 1: case 1:
case 2: case 2:
RyzenAccess.SendMp1(0x1a, ref Args); result = RyzenAccess.SendMp1(0x1a, ref Args);
break; break;
case 3: case 3:
case 5: case 5:
@@ -46,20 +47,24 @@ namespace Ryzen
case 9: case 9:
case 11: case 11:
RyzenAccess.SendMp1(0x14, ref Args); RyzenAccess.SendMp1(0x14, ref Args);
RyzenAccess.SendPsmu(0x31, ref Args); result = RyzenAccess.SendPsmu(0x31, ref Args);
break; break;
default: default:
break; break;
} }
RyzenAccess.Deinitialize(); RyzenAccess.Deinitialize();
return result;
} }
//STAMP2 Limit //STAMP2 Limit
public static void set_stapm2_limit(uint value) public static Smu.Status? set_stapm2_limit(uint value)
{ {
RyzenAccess.Initialize(); RyzenAccess.Initialize();
uint[] Args = new uint[6]; uint[] Args = new uint[6];
Args[0] = value; Args[0] = value;
Smu.Status? result = null;
switch (FAMID) switch (FAMID)
{ {
@@ -69,26 +74,29 @@ namespace Ryzen
case 8: case 8:
case 9: case 9:
case 11: case 11:
RyzenAccess.SendPsmu(0x31, ref Args); result = RyzenAccess.SendPsmu(0x31, ref Args);
break; break;
default: default:
break; break;
} }
RyzenAccess.Deinitialize(); RyzenAccess.Deinitialize();
return result;
} }
//Fast Limit //Fast Limit
public static void set_fast_limit(uint value) public static Smu.Status? set_fast_limit(uint value)
{ {
RyzenAccess.Initialize(); RyzenAccess.Initialize();
uint[] Args = new uint[6]; uint[] Args = new uint[6];
Args[0] = value; Args[0] = value;
Smu.Status? result = null;
switch (FAMID) switch (FAMID)
{ {
case 0: case 0:
case 1: case 1:
case 2: case 2:
RyzenAccess.SendMp1(0x1b, ref Args); result = RyzenAccess.SendMp1(0x1b, ref Args);
break; break;
case 3: case 3:
case 5: case 5:
@@ -96,27 +104,29 @@ namespace Ryzen
case 8: case 8:
case 9: case 9:
case 11: case 11:
RyzenAccess.SendMp1(0x15, ref Args); result = RyzenAccess.SendMp1(0x15, ref Args);
break; break;
default: default:
break; break;
} }
RyzenAccess.Deinitialize(); RyzenAccess.Deinitialize();
return result;
} }
//Slow Limit //Slow Limit
public static void set_slow_limit(uint value) public static Smu.Status? set_slow_limit(uint value)
{ {
RyzenAccess.Initialize(); RyzenAccess.Initialize();
uint[] Args = new uint[6]; uint[] Args = new uint[6];
Args[0] = value; Args[0] = value;
Smu.Status? result = null;
switch (FAMID) switch (FAMID)
{ {
case 0: case 0:
case 1: case 1:
case 2: case 2:
RyzenAccess.SendMp1(0x1c, ref Args); result = RyzenAccess.SendMp1(0x1c, ref Args);
break; break;
case 3: case 3:
case 5: case 5:
@@ -124,12 +134,13 @@ namespace Ryzen
case 8: case 8:
case 9: case 9:
case 11: case 11:
RyzenAccess.SendMp1(0x16, ref Args); result = RyzenAccess.SendMp1(0x16, ref Args);
break; break;
default: default:
break; break;
} }
RyzenAccess.Deinitialize(); RyzenAccess.Deinitialize();
return result;
} }
//Slow time //Slow time