sysclk: add charge current override

This commit is contained in:
souldbminersmwc
2025-12-19 19:30:52 -05:00
parent d0b7a0ccf1
commit c6ac1d60bf
5 changed files with 284 additions and 1 deletions

View File

@@ -33,6 +33,8 @@
#include "errors.h"
#include "ipc_service.h"
#include "kip.h"
#include "i2c_reg.h"
#define HOSPPC_HAS_BOOST (hosversionAtLeast(7,0,0))
ClockManager *ClockManager::instance = NULL;
@@ -254,6 +256,10 @@ void ClockManager::Tick()
Result rc = apmExtGetCurrentPerformanceConfiguration(&mode);
ASSERT_RESULT_OK(rc, "apmExtGetCurrentPerformanceConfiguration");
if(this->config->GetConfigValue(HorizonOCConfigValue_BatteryChargeCurrent)) {
I2c_Bq24193_SetFastChargeCurrentLimit(this->config->GetConfigValue(HorizonOCConfigValue_BatteryChargeCurrent));
}
if(this->config->GetConfigValue(HocClkConfigValue_HandheldTDP) && opMode == AppletOperationMode_Handheld) {
if(Board::GetConsoleType() == HorizonOCConsoleType_Lite) {
if(Board::GetPowerMw(SysClkPowerSensor_Now) < -(int)this->config->GetConfigValue(HocClkConfigValue_LiteTDPLimit)) {