more c++ification

This commit is contained in:
souldbminersmwc committed 2026-10-05 19:28:12 -04:00
1 parent 018325747d
commit 062b52c607
17 files changed
+74 -51

No files matched your search

+5 -3
View File
@@ -17,6 +17,8 @@
#include "i2cDrv.h"
#include <switch.hpp>
using namespace nx;
Result I2cSet_U8(I2cDevice dev, u8 reg, u8 val) {
// ams::fatal::srv::StopSoundTask::StopSound()
// I2C Bus Communication Reference: https://www.ti.com/lit/an/slva704/slva704.pdf
@@ -134,7 +136,7 @@ u32 I2c_BuckConverter_GetMvOut(const I2c_BuckConverter_Domain *domain) {
return 0u;
// Wait 1us
nx::svc::SleepThread(1E3);
svc::SleepThread(1E3);
if (!domain->por_val || val != domain->por_val)
break;
@@ -150,7 +152,7 @@ u32 I2c_BuckConverter_GetUvOut(const I2c_BuckConverter_Domain *domain) {
return 0u;
// Wait 1us
nx::svc::SleepThread(1E3);
svc::SleepThread(1E3);
if (!domain->por_val || val != domain->por_val)
break;
@@ -173,7 +175,7 @@ Result I2c_BuckConverter_SetMvOut(const I2c_BuckConverter_Domain *domain, u32 mv
return res;
// 5ms Ramp delay
nx::svc::SleepThread(5E6);
svc::SleepThread(5E6);
u8 new_val;
res = I2cRead_OutU8(domain->device, domain->reg, &new_val);
if (R_FAILED(res))
@@ -47,7 +47,7 @@
/* Is this a watchdog or a watchcat, that is the question */
namespace i2c::wdt {
namespace HocI2c::wdt {
static bool isWdtEnabled = false;
@@ -128,7 +128,7 @@ namespace i2c::wdt {
const bool watchdogEnabled = file::config::GetConfigValue(HocClkConfigValue_Watchdog);
if (watchdogEnabled) {
Arm(i2c::wdt::MAX77620_WDT_2S);
Arm(HocI2c::wdt::MAX77620_WDT_2S);
Result rc = update_bits(MAX77620_REG_CNFGGLBL3, MAX77620_WDTC_MASK, MAX77620_WDTC_KICK);
ASSERT_RESULT_OK(rc, "update_bits");
} else {
@@ -136,4 +136,4 @@ namespace i2c::wdt {
}
}
} // namespace i2c::wdt
} // namespace HocI2c::wdt
@@ -22,7 +22,7 @@
#include "i2cDrv.h"
#include "../file/errors.hpp"
namespace i2c::wdt {
namespace HocI2c::wdt {
typedef enum {
MAX77620_WDT_2S = 0, /* ~2 seconds */
@@ -38,4 +38,4 @@ namespace i2c::wdt {
void ResetWdtEnableState();
bool IsWdtEnabled();
} // namespace i2c::wdt
} // namespace HocI2c::wdt