1
0
mirror of https://github.com/raphnet/gc_n64_usb-v3 synced 2024-11-15 21:55:06 -05:00

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

This commit is contained in:
Raphael Assenat 2016-10-23 16:15:01 -04:00
parent bb9e6dce17
commit d7bdf59860

30
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);