static void read_joysticks (void) { unsigned int i = joystickCount; while (i > 0) read_joy (--i); }
int main( void ) { usbInit(); sei(); init_joy(); for ( ;; ) { usbPoll(); // Don't bother reading joy if previous changes haven't gone out yet. // Forces delay after changes which serves to debounce controller as well. if ( usbInterruptIsReady() ) { read_joy(); // Don't send update unless joystick changed if ( memcmp( report_out, report, sizeof report ) ) { memcpy( report_out, report, sizeof report ); usbSetInterrupt( report_out, sizeof report_out ); toggle_led(); } } } return 0; }
static void read_joystick (void) { if (get_joystick_num ()) { int32_t i = 0; SDL_JoystickUpdate (); for ( ; i < get_joystick_num (); i++) read_joy (i); } }
static void read_joystick (void) { if (get_joystick_num ()) { unsigned int i; SDL_JoystickUpdate (); for (i = 0; i < get_joystick_num (); i++) read_joy (i); } }
static void read_joysticks (void) { int i; for (i = 0; i < get_joystick_num(); i++) read_joy (i); }
static void read_joysticks (void) { read_joy (0); read_joy (1); }