Skip to content

Commit

Permalink
Improve HID routines
Browse files Browse the repository at this point in the history
  • Loading branch information
d0k3 committed Jun 6, 2016
1 parent 199bf48 commit 3ef196f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion source/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ u32 InputWait() {
u32 pad_state_old = HID_STATE;
while (true) {
u32 pad_state = HID_STATE;
if (pad_state ^ pad_state_old)
if (pad_state == pad_state_old)
continue;
// make sure the key is pressed
u32 t_pressed = 0;
for(; (t_pressed < 0x13000) && (pad_state == HID_STATE); t_pressed++);
if (t_pressed >= 0x13000)
return ~pad_state;
}
}

0 comments on commit 3ef196f

Please sign in to comment.