psm: Fix charger definitions

This commit is contained in:
Vicki Pfau 2021-03-17 21:03:07 -07:00 committed by fincs
parent f365c9b2b5
commit 7e29719263
2 changed files with 7 additions and 6 deletions

View File

@ -10,10 +10,11 @@
#include "../kernel/event.h" #include "../kernel/event.h"
typedef enum { typedef enum {
ChargerType_None = 0, ///< No charger PsmChargerType_Unconnected = 0, ///< No charger
ChargerType_Charger = 1, ///< Official charger or dock PsmChargerType_EnoughPower = 1, ///< Full supported power
ChargerType_Usb = 2 ///< Other USB-C chargers PsmChargerType_LowPower = 2, ///< Lower power supported USB-PD mode
} ChargerType; PsmChargerType_NotSupported = 3, ///< No common supported USB-PD modes
} PsmChargerType;
typedef enum { typedef enum {
PsmBatteryVoltageState_NeedsShutdown = 0, ///< Power state should transition to shutdown PsmBatteryVoltageState_NeedsShutdown = 0, ///< Power state should transition to shutdown
@ -38,7 +39,7 @@ void psmExit(void);
Service* psmGetServiceSession(void); Service* psmGetServiceSession(void);
Result psmGetBatteryChargePercentage(u32 *out); Result psmGetBatteryChargePercentage(u32 *out);
Result psmGetChargerType(ChargerType *out); Result psmGetChargerType(PsmChargerType *out);
Result psmGetBatteryVoltageState(PsmBatteryVoltageState *out); Result psmGetBatteryVoltageState(PsmBatteryVoltageState *out);
Result psmGetRawBatteryChargePercentage(double *out); Result psmGetRawBatteryChargePercentage(double *out);
Result psmIsEnoughPowerSupplied(bool *out); Result psmIsEnoughPowerSupplied(bool *out);

View File

@ -71,7 +71,7 @@ Result psmGetBatteryChargePercentage(u32 *out) {
return _psmCmdNoInOutU32(&g_psmSrv, out, 0); return _psmCmdNoInOutU32(&g_psmSrv, out, 0);
} }
Result psmGetChargerType(ChargerType *out) { Result psmGetChargerType(PsmChargerType *out) {
return _psmCmdNoInOutU32(&g_psmSrv, out, 1); return _psmCmdNoInOutU32(&g_psmSrv, out, 1);
} }