- sys-clk-OC: Charging current limit
This commit is contained in:
@@ -105,14 +105,19 @@ ReverseNXMode ReverseNXSync::RecheckToolMode() {
|
||||
}
|
||||
|
||||
|
||||
void PsmExt::ChargingHandler(bool fastChargingEnabled, uint32_t chargingLimit) {
|
||||
void PsmExt::ChargingHandler(uint32_t chargingCurrent, uint32_t chargingLimit) {
|
||||
u32 current;
|
||||
Result res = I2c_Bq24193_GetFastChargeCurrentLimit(¤t);
|
||||
if (R_SUCCEEDED(res)) {
|
||||
current -= current % 100;
|
||||
if (current != chargingCurrent)
|
||||
I2c_Bq24193_SetFastChargeCurrentLimit(chargingCurrent);
|
||||
}
|
||||
|
||||
PsmChargeInfo* info = new PsmChargeInfo;
|
||||
Service* session = psmGetServiceSession();
|
||||
serviceDispatchOut(session, Psm_GetBatteryChargeInfoFields, *info);
|
||||
|
||||
if (PsmIsFastChargingEnabled(info) != fastChargingEnabled)
|
||||
serviceDispatch(session, fastChargingEnabled ? Psm_EnableFastBatteryCharging : Psm_DisableFastBatteryCharging);
|
||||
|
||||
if (PsmIsChargerConnected(info)) {
|
||||
u32 chargeNow = 0;
|
||||
if (R_SUCCEEDED(psmGetBatteryChargePercentage(&chargeNow))) {
|
||||
|
||||
Reference in New Issue
Block a user