mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-05 10:52:15 +02:00
hid: move official/libnx controller converters to hid.h
This commit is contained in:
parent
fea5cf13b0
commit
bfa678be8a
@ -600,6 +600,18 @@ typedef struct HidVibrationValue
|
||||
float freq_high; ///< High Band frequency in Hz.
|
||||
} HidVibrationValue;
|
||||
|
||||
static inline u32 _hidControllerIDToOfficial(HidControllerID id) {
|
||||
if (id < CONTROLLER_HANDHELD) return id;
|
||||
if (id == CONTROLLER_HANDHELD) return 0x20;
|
||||
return 0x10;//For CONTROLLER_UNKNOWN and invalid values return this.
|
||||
}
|
||||
|
||||
static inline HidControllerID _hidOfficialToControllerID(u64 id) {
|
||||
if (id < 8) return id;
|
||||
if (id == 0x20) return CONTROLLER_HANDHELD;
|
||||
return CONTROLLER_UNKNOWN;
|
||||
}
|
||||
|
||||
Result hidInitialize(void);
|
||||
void hidExit(void);
|
||||
void hidReset(void);
|
||||
|
@ -154,12 +154,6 @@ void hidReset(void)
|
||||
rwlockWriteUnlock(&g_hidLock);
|
||||
}
|
||||
|
||||
static u32 _hidControllerIDToOfficial(HidControllerID id) {
|
||||
if (id < CONTROLLER_HANDHELD) return id;
|
||||
if (id == CONTROLLER_HANDHELD) return 0x20;
|
||||
return 0x10;//For CONTROLLER_UNKNOWN and invalid values return this.
|
||||
}
|
||||
|
||||
Service* hidGetSessionService(void) {
|
||||
return &g_hidSrv;
|
||||
}
|
||||
|
@ -106,18 +106,6 @@ static Result _nfpuCreateInterface(void) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
static u32 _hidControllerIDToOfficial(HidControllerID id) {
|
||||
if (id < CONTROLLER_HANDHELD) return id;
|
||||
if (id == CONTROLLER_HANDHELD) return 0x20;
|
||||
return 0x10;
|
||||
}
|
||||
|
||||
static HidControllerID _hidOfficialToControllerID(u64 id) {
|
||||
if (id < 8) return id;
|
||||
if (id == 0x20) return CONTROLLER_HANDHELD;
|
||||
return CONTROLLER_UNKNOWN;
|
||||
}
|
||||
|
||||
static Result _nfpuInterfaceCmdNoInOut(u64 cmd_id) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
Loading…
Reference in New Issue
Block a user