Rewrite: full load
This commit is contained in:
@@ -112,7 +112,7 @@ namespace board {
|
||||
ASSERT_RESULT_OK(rc, "pmdmntInitialize");
|
||||
|
||||
StartGpuLoad(nvCheck, fd);
|
||||
// threadCreate(&cpuCore3Thread, CheckCore, &idletick3, NULL, 0x1000, 0x10, 3);
|
||||
/* TODO: Add back fan. */
|
||||
// threadCreate(&miscThread, miscThreadFunc, NULL, NULL, 0x1000, 0x10, 3);
|
||||
|
||||
// threadStart(&miscThread);
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
*/
|
||||
|
||||
#include <switch.h>
|
||||
#include <sysclk.h>
|
||||
#include <nxExt.h>
|
||||
#include <algorithm>
|
||||
#include <math.h>
|
||||
#include <numeric>
|
||||
@@ -63,14 +65,6 @@ namespace board {
|
||||
} while(true);
|
||||
}
|
||||
|
||||
void StartGpuLoad(Result nvCheck, u32 fd) {
|
||||
;
|
||||
}
|
||||
|
||||
u32 GetGpuLoad() {
|
||||
return gpuLoad;
|
||||
}
|
||||
|
||||
void CheckCore(void *idletickPtr) {
|
||||
u64* idletick = static_cast<u64 *>(idletickPtr);
|
||||
while(true) {
|
||||
@@ -105,6 +99,27 @@ namespace board {
|
||||
return std::round(std::max({cpuUsage0, cpuUsage1, cpuUsage2}));
|
||||
}
|
||||
|
||||
u32 GetPartLoad(SysClkPartLoad loadSource) {
|
||||
switch(loadSource) {
|
||||
case SysClkPartLoad_EMC:
|
||||
return t210EmcLoadAll();
|
||||
case SysClkPartLoad_EMCCpu:
|
||||
return t210EmcLoadCpu();
|
||||
case HocClkPartLoad_GPU:
|
||||
return gpuLoad;
|
||||
case HocClkPartLoad_CPUMax:
|
||||
return GetMaxCpuLoad();
|
||||
case HocClkPartLoad_BAT:
|
||||
BatteryChargeInfo info;
|
||||
batteryInfoGetChargeInfo(&info);
|
||||
return info.RawBatteryCharge;
|
||||
default:
|
||||
ASSERT_ENUM_VALID(SysClkPartLoad, loadSource);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ExitLoad() {
|
||||
threadClose(&gpuThread);
|
||||
threadClose(&cpuCore0Thread);
|
||||
|
||||
@@ -31,7 +31,6 @@ namespace board {
|
||||
|
||||
void StartLoad(Result nvCheck, u32 fd);
|
||||
void ExitLoad();
|
||||
u32 GetGpuLoad();
|
||||
u32 GetMaxCpuLoad();
|
||||
u32 GetPartLoad();
|
||||
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ namespace board {
|
||||
RgltrSession session;
|
||||
Result rc = 0;
|
||||
u32 out = 0;
|
||||
BatteryChargeInfo info;
|
||||
|
||||
switch (voltage) {
|
||||
case HocClkVoltage_SOC:
|
||||
|
||||
Reference in New Issue
Block a user