Skip to content

Commit

Permalink
hidsys: use hosversionBetween
Browse files Browse the repository at this point in the history
  • Loading branch information
SciresM authored and fincs committed May 30, 2024
1 parent 510d85b commit bb65fec
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions nx/source/services/hidsys.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,14 +497,14 @@ Result hidsysLegacyIsButtonConfigSupported(HidsysUniquePadId unique_pad_id, bool
}

Result hidsysIsButtonConfigSupported(BtdrvAddress addr, bool *out) {
if (hosversionBefore(11,0,0) || hosversionAtLeast(18,0,0))
if (!hosversionBetween(11,18))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);

return _hidsysCmdInAddrOutBool(addr, out, 1200);
}

Result hidsysIsButtonConfigEmbeddedSupported(bool *out) {
if (hosversionBefore(11,0,0) || hosversionAtLeast(18,0,0))
if (!hosversionBetween(11,18))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);

return _hidsysCmdNoInOutBool(out, 1201);
Expand All @@ -518,14 +518,14 @@ Result hidsysLegacyDeleteButtonConfig(HidsysUniquePadId unique_pad_id) {
}

Result hidsysDeleteButtonConfig(BtdrvAddress addr) {
if (hosversionBefore(11,0,0) || hosversionAtLeast(18,0,0))
if (!hosversionBetween(11,18))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);

return _hidsysCmdInAddrNoOut(addr, 1202);
}

Result hidsysDeleteButtonConfigEmbedded(void) {
if (hosversionBefore(11,0,0) || hosversionAtLeast(18,0,0))
if (!hosversionBetween(11,18))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);

return _hidsysCmdNoIO(1203);
Expand All @@ -539,14 +539,14 @@ Result hidsysLegacySetButtonConfigEnabled(HidsysUniquePadId unique_pad_id, bool
}

Result hidsysSetButtonConfigEnabled(BtdrvAddress addr, bool flag) {
if (hosversionBefore(11,0,0) || hosversionAtLeast(18,0,0))
if (!hosversionBetween(11,18))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);

return _hidsysCmdInAddrInBoolNoOut(addr, flag, 1204);
}

Result hidsysSetButtonConfigEmbeddedEnabled(bool flag) {
if (hosversionBefore(11,0,0) || hosversionAtLeast(18,0,0))
if (!hosversionBetween(11,18))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);

return _hidsysCmdInBoolNoOut(flag, 1205);
Expand All @@ -560,14 +560,14 @@ Result hidsysLegacyIsButtonConfigEnabled(HidsysUniquePadId unique_pad_id, bool *
}

Result hidsysIsButtonConfigEnabled(BtdrvAddress addr, bool *out) {
if (hosversionBefore(11,0,0) || hosversionAtLeast(18,0,0))
if (!hosversionBetween(11,18))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);

return _hidsysCmdInAddrInBoolNoOut(addr, out, 1206);
}

Result hidsysIsButtonConfigEmbeddedEnabled(bool *out) {
if (hosversionBefore(11,0,0) || hosversionAtLeast(18,0,0))
if (!hosversionBetween(11,18))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);

return _hidsysCmdNoInOutBool(out, 1207);
Expand All @@ -581,7 +581,7 @@ Result hidsysLegacySetButtonConfigEmbedded(HidsysUniquePadId unique_pad_id, cons
}

Result hidsysSetButtonConfigEmbedded(const HidsysButtonConfigEmbedded *config) {
if (hosversionBefore(11,0,0) || hosversionAtLeast(18,0,0))
if (!hosversionBetween(11,18))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);

return serviceDispatch(&g_hidsysSrv, 1208,
Expand All @@ -598,7 +598,7 @@ Result hidsysLegacySetButtonConfigFull(HidsysUniquePadId unique_pad_id, const Hi
}

Result hidsysSetButtonConfigFull(BtdrvAddress addr, const HidsysButtonConfigFull *config) {
if (hosversionBefore(11,0,0) || hosversionAtLeast(18,0,0))
if (!hosversionBetween(11,18))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);

return _hidsysCmdInAddrInBufFixedNoOut(addr, config, sizeof(*config), 1209);
Expand All @@ -612,7 +612,7 @@ Result hidsysLegacySetButtonConfigLeft(HidsysUniquePadId unique_pad_id, const Hi
}

Result hidsysSetButtonConfigLeft(BtdrvAddress addr, const HidsysButtonConfigLeft *config) {
if (hosversionBefore(11,0,0) || hosversionAtLeast(18,0,0))
if (!hosversionBetween(11,18))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);

return _hidsysCmdInAddrInBufFixedNoOut(addr, config, sizeof(*config), 12010);
Expand All @@ -626,7 +626,7 @@ Result hidsysLegacySetButtonConfigRight(HidsysUniquePadId unique_pad_id, const H
}

Result hidsysSetButtonConfigRight(BtdrvAddress addr, const HidsysButtonConfigRight *config) {
if (hosversionBefore(11,0,0) || hosversionAtLeast(18,0,0))
if (!hosversionBetween(11,18))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);

return _hidsysCmdInAddrInBufFixedNoOut(addr, config, sizeof(*config), 1211);
Expand All @@ -640,7 +640,7 @@ Result hidsysLegacyGetButtonConfigEmbedded(HidsysUniquePadId unique_pad_id, Hids
}

Result hidsysGetButtonConfigEmbedded(HidsysButtonConfigEmbedded *config) {
if (hosversionBefore(11,0,0) || hosversionAtLeast(18,0,0))
if (!hosversionBetween(11,18))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);

return serviceDispatch(&g_hidsysSrv, 1212,
Expand All @@ -657,7 +657,7 @@ Result hidsysLegacyGetButtonConfigFull(HidsysUniquePadId unique_pad_id, HidsysBu
}

Result hidsysGetButtonConfigFull(BtdrvAddress addr, HidsysButtonConfigFull *config) {
if (hosversionBefore(11,0,0) || hosversionAtLeast(18,0,0))
if (!hosversionBetween(11,18))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);

return _hidsysCmdInAddrOutBufFixedNoOut(addr, config, sizeof(*config), 1213);
Expand All @@ -671,7 +671,7 @@ Result hidsysLegacyGetButtonConfigLeft(HidsysUniquePadId unique_pad_id, HidsysBu
}

Result hidsysGetButtonConfigLeft(BtdrvAddress addr, HidsysButtonConfigLeft *config) {
if (hosversionBefore(11,0,0) || hosversionAtLeast(18,0,0))
if (!hosversionBetween(11,18))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);

return _hidsysCmdInAddrOutBufFixedNoOut(addr, config, sizeof(*config), 1214);
Expand All @@ -685,7 +685,7 @@ Result hidsysLegacyGetButtonConfigRight(HidsysUniquePadId unique_pad_id, HidsysB
}

Result hidsysGetButtonConfigRight(BtdrvAddress addr, HidsysButtonConfigRight *config) {
if (hosversionBefore(11,0,0) || hosversionAtLeast(18,0,0))
if (!hosversionBetween(11,18))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);

return _hidsysCmdInAddrOutBufFixedNoOut(addr, config, sizeof(*config), 1215);
Expand Down

0 comments on commit bb65fec

Please sign in to comment.