uLaunch/Common/Source/os/os_Misc.cpp
2019-10-24 19:24:00 +02:00

25 lines
No EOL
507 B
C++

#include <os/os_Misc.hpp>
namespace os
{
u32 GetBatteryLevel()
{
u32 lvl = 0;
psmGetBatteryChargePercentage(&lvl);
return lvl;
}
bool IsConsoleCharging()
{
ChargerType cht = ChargerType_None;
psmGetChargerType(&cht);
return (cht > ChargerType_None);
}
std::string GetFirmwareVersion()
{
SetSysFirmwareVersion fwver;
setsysGetFirmwareVersion(&fwver);
return std::string(fwver.display_version);
}
}