Updated hid/notification-led for latest libnx.

This commit is contained in:
yellows8 2019-10-11 15:37:32 -04:00
parent 707d65171e
commit da994a8a69
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43

View File

@ -20,8 +20,8 @@ int main(int argc, char* argv[])
Result rc=0; Result rc=0;
bool initflag=0; bool initflag=0;
size_t i; s32 i;
size_t total_entries; s32 total_entries;
u64 UniquePadIds[2]; u64 UniquePadIds[2];
HidsysNotificationLedPattern pattern; HidsysNotificationLedPattern pattern;
@ -110,12 +110,12 @@ int main(int argc, char* argv[])
// If you want to get the UniquePadIds for all controllers, you can use hidsysGetUniquePadIds instead. // If you want to get the UniquePadIds for all controllers, you can use hidsysGetUniquePadIds instead.
rc = hidsysGetUniquePadsFromNpad(hidGetHandheldMode() ? CONTROLLER_HANDHELD : CONTROLLER_PLAYER_1, UniquePadIds, 2, &total_entries); rc = hidsysGetUniquePadsFromNpad(hidGetHandheldMode() ? CONTROLLER_HANDHELD : CONTROLLER_PLAYER_1, UniquePadIds, 2, &total_entries);
printf("hidsysGetUniquePadsFromNpad(): 0x%x", rc); printf("hidsysGetUniquePadsFromNpad(): 0x%x", rc);
if (R_SUCCEEDED(rc)) printf(", %ld", total_entries); if (R_SUCCEEDED(rc)) printf(", %d", total_entries);
printf("\n"); printf("\n");
if (R_SUCCEEDED(rc)) { if (R_SUCCEEDED(rc)) {
for(i=0; i<total_entries; i++) { // System will skip sending the subcommand to controllers where this isn't available. for(i=0; i<total_entries; i++) { // System will skip sending the subcommand to controllers where this isn't available.
printf("[%ld] = 0x%lx ", i, UniquePadIds[i]); printf("[%d] = 0x%lx ", i, UniquePadIds[i]);
rc = hidsysSetNotificationLedPattern(&pattern, UniquePadIds[i]); rc = hidsysSetNotificationLedPattern(&pattern, UniquePadIds[i]);
printf("hidsysSetNotificationLedPattern(): 0x%x\n", rc); printf("hidsysSetNotificationLedPattern(): 0x%x\n", rc);
} }