Read PTO (PLL test output) regs; Prevent CPU clock from being stuck at boost freq when "Auto CPU Boost" is toggled off

This commit is contained in:
KazushiM
2022-02-12 19:56:24 +08:00
parent 4ff20f15f1
commit eaed085697
3 changed files with 151 additions and 27 deletions

View File

@@ -200,7 +200,7 @@ void ClockManager::WaitForNextTick()
uint64_t tickWaitTimeMs = this->GetConfig()->GetConfigValue(SysClkConfigValue_PollingIntervalMs);
uint64_t tickWaitTimeNs = tickWaitTimeMs * 1000000ULL;
uint64_t isAutoBoostEnabled = this->GetConfig()->GetConfigValue(SysClkConfigValue_AutoCPUBoost);
bool isAutoBoostEnabled = this->GetConfig()->GetConfigValue(SysClkConfigValue_AutoCPUBoost);
if ( isAutoBoostEnabled
&& this->context->realProfile != SysClkProfile_Handheld
&& this->context->enabled
@@ -242,6 +242,10 @@ void ClockManager::WaitForNextTick()
}
else
{
if (this->oc->systemCoreBoostCPU) {
this->oc->systemCoreBoostCPU = false;
Clocks::SetHz(SysClkModule_CPU, GetHz(SysClkModule_CPU));
}
svcSleepThread(tickWaitTimeNs);
}
}
@@ -341,7 +345,7 @@ bool ClockManager::RefreshContext()
{
bool hasChanged = false;
bool enabled = this->GetConfig()->Enabled();
uint64_t isReverseNXSyncEnabled = this->GetConfig()->GetConfigValue(SysClkConfigValue_SyncReverseNXMode);
bool isReverseNXSyncEnabled = this->GetConfig()->GetConfigValue(SysClkConfigValue_SyncReverseNXMode);
if(enabled != this->context->enabled)
{
this->context->enabled = enabled;

View File

@@ -23,7 +23,6 @@
#define FILE_LOG_FLAG_PATH FILE_CONFIG_DIR "/log.flag"
#define FILE_LOG_FILE_PATH FILE_CONFIG_DIR "/log.txt"
#define FILE_SALTYNX_PATH "/atmosphere/contents/0000000000534C56/flags/boot2.flag" // Just check for SaltyNX boot flag
#define FILE_REVERSENX_RT_CONF_PATH FILE_CONFIG_DIR "/ReverseNX-RT.conf"
class FileUtils
{