mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
psm: Fix charger definitions
This commit is contained in:
parent
f365c9b2b5
commit
7e29719263
@ -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);
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user