mirror of
https://github.com/switchbrew/switch-examples.git
synced 2025-06-20 21:12:38 +02:00
Updated all hidKeys...() function to store u64 instead of u32. (#28)
Also fixed some whitespace in usbds example
This commit is contained in:
parent
57dfdb9ff2
commit
d4cf965df9
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user