From d4cf965df993073bafd8a2106099c834e4a3b778 Mon Sep 17 00:00:00 2001 From: Thompson Lee Date: Sun, 29 Apr 2018 18:18:16 -0400 Subject: [PATCH] Updated all hidKeys...() function to store u64 instead of u32. (#28) Also fixed some whitespace in usbds example --- account/source/main.c | 2 +- app_controldata/source/main.c | 2 +- audio/echo/source/main.c | 2 +- audio/playtone/source/main.c | 2 +- fs/romfs/source/main.c | 2 +- fs/save/source/main.c | 2 +- fs/sdmc/source/main.c | 2 +- graphics/printing/hello-world/source/main.c | 2 +- graphics/printing/vt52-demo/source/main.c | 2 +- graphics/simplegfx/source/main.c | 2 +- hid/irsensor/source/main.c | 2 +- hid/read-controls/source/main.c | 6 +++--- hid/touch-screen/source/main.c | 2 +- hid/vibration/source/main.c | 6 +++--- settings/get_system_language/source/main.c | 2 +- templates/application/source/main.c | 2 +- time/source/main.c | 2 +- usb/usbds/source/main.c | 6 ++++-- 18 files changed, 25 insertions(+), 23 deletions(-) diff --git a/account/source/main.c b/account/source/main.c index 41a58df..a7440a4 100644 --- a/account/source/main.c +++ b/account/source/main.c @@ -78,7 +78,7 @@ int main(int argc, char **argv) hidScanInput(); //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) - u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); if (kDown & KEY_PLUS) break; // break in order to return to hbmenu diff --git a/app_controldata/source/main.c b/app_controldata/source/main.c index 296c689..7d4f793 100644 --- a/app_controldata/source/main.c +++ b/app_controldata/source/main.c @@ -74,7 +74,7 @@ int main(int argc, char **argv) hidScanInput(); //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) - u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); if (kDown & KEY_PLUS) break; // break in order to return to hbmenu diff --git a/audio/echo/source/main.c b/audio/echo/source/main.c index 229d91f..e34f92c 100644 --- a/audio/echo/source/main.c +++ b/audio/echo/source/main.c @@ -114,7 +114,7 @@ int main(int argc, char **argv) hidScanInput(); //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) - u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); if (kDown & KEY_PLUS) break; // break in order to return to hbmenu diff --git a/audio/playtone/source/main.c b/audio/playtone/source/main.c index 445b250..f021fb2 100644 --- a/audio/playtone/source/main.c +++ b/audio/playtone/source/main.c @@ -88,7 +88,7 @@ int main(int argc, char **argv) hidScanInput(); //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) - u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); if (kDown & KEY_PLUS) break; // break in order to return to hbmenu diff --git a/fs/romfs/source/main.c b/fs/romfs/source/main.c index a18ab11..e5fec43 100644 --- a/fs/romfs/source/main.c +++ b/fs/romfs/source/main.c @@ -51,7 +51,7 @@ int main(int argc, char **argv) hidScanInput(); //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) - u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); if (kDown & KEY_PLUS) break; // break in order to return to hbmenu diff --git a/fs/save/source/main.c b/fs/save/source/main.c index 467302d..783895a 100644 --- a/fs/save/source/main.c +++ b/fs/save/source/main.c @@ -131,7 +131,7 @@ int main(int argc, char **argv) hidScanInput(); //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) - u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); if (kDown & KEY_PLUS) break; // break in order to return to hbmenu diff --git a/fs/sdmc/source/main.c b/fs/sdmc/source/main.c index bea5a91..746cfe8 100644 --- a/fs/sdmc/source/main.c +++ b/fs/sdmc/source/main.c @@ -38,7 +38,7 @@ int main(int argc, char **argv) hidScanInput(); //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) - u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); if (kDown & KEY_PLUS) break; // break in order to return to hbmenu diff --git a/graphics/printing/hello-world/source/main.c b/graphics/printing/hello-world/source/main.c index 798ffdc..7a18626 100644 --- a/graphics/printing/hello-world/source/main.c +++ b/graphics/printing/hello-world/source/main.c @@ -21,7 +21,7 @@ int main(int argc, char **argv) hidScanInput(); //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) - u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); if (kDown & KEY_PLUS) break; // break in order to return to hbmenu diff --git a/graphics/printing/vt52-demo/source/main.c b/graphics/printing/vt52-demo/source/main.c index 39852e6..850c468 100644 --- a/graphics/printing/vt52-demo/source/main.c +++ b/graphics/printing/vt52-demo/source/main.c @@ -69,7 +69,7 @@ int main(int argc, char **argv) // Your code goes here //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) - u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); if (kDown & KEY_PLUS) break; // break in order to return to hbmenu diff --git a/graphics/simplegfx/source/main.c b/graphics/simplegfx/source/main.c index a4dd81e..de86653 100644 --- a/graphics/simplegfx/source/main.c +++ b/graphics/simplegfx/source/main.c @@ -30,7 +30,7 @@ int main(int argc, char **argv) hidScanInput(); //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) - u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); if (kDown & KEY_PLUS) break; // break in order to return to hbmenu diff --git a/hid/irsensor/source/main.c b/hid/irsensor/source/main.c index 79e2a2d..b280f36 100644 --- a/hid/irsensor/source/main.c +++ b/hid/irsensor/source/main.c @@ -77,7 +77,7 @@ int main(int argc, char **argv) hidScanInput(); //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) - u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); if (kDown & KEY_PLUS) break; // break in order to return to hbmenu diff --git a/hid/read-controls/source/main.c b/hid/read-controls/source/main.c index bb452d7..b4cca71 100644 --- a/hid/read-controls/source/main.c +++ b/hid/read-controls/source/main.c @@ -35,11 +35,11 @@ int main(int argc, char **argv) hidScanInput(); //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) - u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); //hidKeysHeld returns information about which buttons have are held down in this frame - u32 kHeld = hidKeysHeld(CONTROLLER_P1_AUTO); + u64 kHeld = hidKeysHeld(CONTROLLER_P1_AUTO); //hidKeysUp returns information about which buttons have been just released - u32 kUp = hidKeysUp(CONTROLLER_P1_AUTO); + u64 kUp = hidKeysUp(CONTROLLER_P1_AUTO); if (kDown & KEY_PLUS) break; // break in order to return to hbmenu diff --git a/hid/touch-screen/source/main.c b/hid/touch-screen/source/main.c index 4169278..0d17ddd 100644 --- a/hid/touch-screen/source/main.c +++ b/hid/touch-screen/source/main.c @@ -22,7 +22,7 @@ int main(int argc, char **argv) hidScanInput(); //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) - u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); if (kDown & KEY_PLUS) break; // break in order to return to hbmenu diff --git a/hid/vibration/source/main.c b/hid/vibration/source/main.c index 8dab6a7..7639785 100644 --- a/hid/vibration/source/main.c +++ b/hid/vibration/source/main.c @@ -50,9 +50,9 @@ int main(int argc, char **argv) hidScanInput(); //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) - u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); - u32 kHeld = hidKeysHeld(CONTROLLER_P1_AUTO); - u32 kUp = hidKeysUp(CONTROLLER_P1_AUTO); + u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + u64 kHeld = hidKeysHeld(CONTROLLER_P1_AUTO); + u64 kUp = hidKeysUp(CONTROLLER_P1_AUTO); if (kDown & KEY_PLUS) break; // break in order to return to hbmenu diff --git a/settings/get_system_language/source/main.c b/settings/get_system_language/source/main.c index 443a358..f77c711 100644 --- a/settings/get_system_language/source/main.c +++ b/settings/get_system_language/source/main.c @@ -54,7 +54,7 @@ int main(int argc, char **argv) // Your code goes here //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) - u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); if (kDown & KEY_PLUS) break; // break in order to return to hbmenu diff --git a/templates/application/source/main.c b/templates/application/source/main.c index f879ab9..ff97b62 100644 --- a/templates/application/source/main.c +++ b/templates/application/source/main.c @@ -19,7 +19,7 @@ int main(int argc, char **argv) // Your code goes here //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) - u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); if (kDown & KEY_PLUS) break; // break in order to return to hbmenu diff --git a/time/source/main.c b/time/source/main.c index dfe0e85..713b97d 100644 --- a/time/source/main.c +++ b/time/source/main.c @@ -22,7 +22,7 @@ int main(int argc, char **argv) hidScanInput(); //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) - u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); if (kDown & KEY_PLUS) break; // break in order to return to hbmenu diff --git a/usb/usbds/source/main.c b/usb/usbds/source/main.c index e6a4480..02dfa26 100644 --- a/usb/usbds/source/main.c +++ b/usb/usbds/source/main.c @@ -101,7 +101,8 @@ Result usbds_test(u8 *tmpbuf) //Start a device->host transfer. ret = usbDsEndpoint_PostBufferAsync(endpoint_in, tmpbuf, 0x2+1, NULL); - if(R_FAILED(ret))return ret; + if(R_FAILED(ret)) + return ret; //Wait for the transfer to finish. svcWaitSynchronization(&tmpindex, &endpoint_in->CompletionEvent, 1, U64_MAX); @@ -136,7 +137,8 @@ int main(int argc, char **argv) usbDsExit(); } - if(R_FAILED(ret))fatalSimple(ret); + if(R_FAILED(ret)) + fatalSimple(ret); svcSleepThread(5000000000);//Delay 5s