Release: 1.4.1
This commit is contained in:
@@ -372,10 +372,6 @@ Result MemFreqMax(u32* ptr) {
|
||||
}
|
||||
|
||||
Result MemVoltHandler(u32* ptr) {
|
||||
u32 emc_uv = C.marikoEmcVolt;
|
||||
if (!emc_uv)
|
||||
R_SKIP();
|
||||
|
||||
regulator* entry = reinterpret_cast<regulator *>(reinterpret_cast<u8 *>(ptr) - offsetof(regulator, type_2_3.default_uv));
|
||||
|
||||
constexpr u32 uv_step = 5'000;
|
||||
@@ -386,6 +382,10 @@ Result MemVoltHandler(u32* ptr) {
|
||||
entry->type_2_3.min_uv != uv_min)
|
||||
R_THROW(ldr::ResultInvalidRegulatorEntry());
|
||||
|
||||
u32 emc_uv = C.marikoEmcVolt;
|
||||
if (!emc_uv)
|
||||
R_SKIP();
|
||||
|
||||
if (emc_uv % uv_step)
|
||||
emc_uv = emc_uv / uv_step * uv_step; // rounding
|
||||
|
||||
|
||||
@@ -100,16 +100,18 @@ u8 I2c_BuckConverter_MvOutToMultiplier(const I2c_BuckConverter_Domain* domain, u
|
||||
u32 I2c_BuckConverter_GetMvOut(const I2c_BuckConverter_Domain* domain) {
|
||||
u8 val;
|
||||
Result res;
|
||||
// Retry 3 times if failed or received POR value
|
||||
// Retry 3 times if received POR value
|
||||
for (int i = 0; i < 3; i++) {
|
||||
res = I2cRead_OutU8(domain->device, domain->reg, &val);
|
||||
if (R_FAILED(res) || (domain->por_val && val == domain->por_val)) {
|
||||
svcSleepThread(1000);
|
||||
continue;
|
||||
}
|
||||
return I2c_BuckConverter_MultiplierToMvOut(domain, val & domain->volt_mask);
|
||||
if (R_FAILED(res))
|
||||
return 0u;
|
||||
|
||||
if (!domain->por_val || val != domain->por_val)
|
||||
break;
|
||||
|
||||
svcSleepThread(1000);
|
||||
}
|
||||
return 0u;
|
||||
return I2c_BuckConverter_MultiplierToMvOut(domain, val & domain->volt_mask);
|
||||
}
|
||||
|
||||
Result I2c_BuckConverter_SetMvOut(const I2c_BuckConverter_Domain* domain, u32 mvolt) {
|
||||
|
||||
Reference in New Issue
Block a user