diff --git a/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_max17050_driver.cpp b/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_max17050_driver.cpp index 66448f14d..0c5c8c7f1 100644 --- a/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_max17050_driver.cpp +++ b/libraries/libstratosphere/source/powctl/impl/board/nintendo/nx/powctl_max17050_driver.cpp @@ -564,12 +564,10 @@ namespace ams::powctl::impl::board::nintendo::nx { } Result Max17050Driver::SetFullChargeThreshold(double percentage) { - #if defined(ATMOSPHERE_ARCH_ARM64) - const u16 val = vcvtd_n_s64_f64(percentage, BITSIZEOF(u8)); - #else - #error "Unknown architecture for floating point -> fixed point" - #endif + /* Convert percentage from double to signed fixed-point with 8 fractional bits. */ + const u16 val = static_cast(static_cast(percentage * (1 << 8))); + /* Set the threshold. */ return WriteRegister(m_i2c_session, max17050::FullSocThr, val); }