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