diff --git a/nx/include/switch/services/hid.h b/nx/include/switch/services/hid.h index d2bd8e84..5985a033 100644 --- a/nx/include/switch/services/hid.h +++ b/nx/include/switch/services/hid.h @@ -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); diff --git a/nx/source/services/hid.c b/nx/source/services/hid.c index 5d29c925..9606f12d 100644 --- a/nx/source/services/hid.c +++ b/nx/source/services/hid.c @@ -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; } diff --git a/nx/source/services/nfpu.c b/nx/source/services/nfpu.c index 4f97cd23..7b9a37a3 100644 --- a/nx/source/services/nfpu.c +++ b/nx/source/services/nfpu.c @@ -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);