Browse Source

Need to initialize stuff *after* knowing the number of players.

pull/5/head
Raphael Assenat 5 years ago
parent
commit
d7bdf59860
1 changed files with 15 additions and 15 deletions
  1. +15
    -15
      main.c

+ 15
- 15
main.c View File

@ -454,21 +454,6 @@ int main(void)
eeprom_init();
intervaltimer_init();
for (i=0; i<num_players; i++) {
int hid_iface_id;
usbpad_init(&usbpads[i]);
// Skip interface 1 (always used for the dataReport)
if (i>0) {
hid_iface_id = i + 1;
} else {
hid_iface_id = i;
}
usb_params.hid_params[hid_iface_id].ctx = &usbpads[i];
}
switch (g_eeprom_data.cfg.mode)
{
default:
@ -513,6 +498,21 @@ int main(void)
break;
}
for (i=0; i<num_players; i++) {
int hid_iface_id;
usbpad_init(&usbpads[i]);
// Skip interface 1 (always used for the dataReport)
if (i>0) {
hid_iface_id = i + 1;
} else {
hid_iface_id = i;
}
usb_params.hid_params[hid_iface_id].ctx = &usbpads[i];
}
sei();
usb_init(&usb_params);


Loading…
Cancel
Save