Hi,
Not sure if this belongs here on in the general suggestions/bugs section (I am running Teensyduino 1.42b6 on a Win10 64bit).
I am using a custom USB device type as per the definition below (Serial + Midi + Keyboard + Mouse). When I increase the MIDI_NUM_CABLES to any value above 1, the Teensy device shows up on my PC only after about 9 seconds once the Teensy has been reflashed / rebooted. When I have MIDI_NUM_CABLES = 1 it shows up immediately after reflash / reboot.
Code:
#elif defined(USB_SERIAL_KEYBOARD_MOUSE_MIDI)
#define VENDOR_ID 0x16C0
#define PRODUCT_ID 0x0481
#define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
#define MANUFACTURER_NAME_LEN 11
#define PRODUCT_NAME {'S','e','r','i','a','l','/','K','e','y','b','o','a','r','d','/','M','o','u','s','e','/','M','I','D','I'}
#define PRODUCT_NAME_LEN 26
#define EP0_SIZE 64
#define NUM_ENDPOINTS 6
#define NUM_USB_BUFFERS 31
#define NUM_INTERFACE 6
#define CDC_IAD_DESCRIPTOR 1
#define CDC_STATUS_INTERFACE 0
#define CDC_DATA_INTERFACE 1 // Serial
#define CDC_ACM_ENDPOINT 1
#define CDC_RX_ENDPOINT 2
#define CDC_TX_ENDPOINT 2
#define CDC_ACM_SIZE 16
#define CDC_RX_SIZE 64
#define CDC_TX_SIZE 64
#define MIDI_INTERFACE 2 // MIDI
#define MIDI_NUM_CABLES 4
#define MIDI_TX_ENDPOINT 3
#define MIDI_TX_SIZE 64
#define MIDI_RX_ENDPOINT 3
#define MIDI_RX_SIZE 64
#define KEYBOARD_INTERFACE 3 // Keyboard
#define KEYBOARD_ENDPOINT 4
#define KEYBOARD_SIZE 8
#define KEYBOARD_INTERVAL 1
#define MOUSE_INTERFACE 4 // Mouse
#define MOUSE_ENDPOINT 5
#define MOUSE_SIZE 8
#define MOUSE_INTERVAL 2
#define KEYMEDIA_INTERFACE 5 // Keyboard Media Keys
#define KEYMEDIA_ENDPOINT 6
#define KEYMEDIA_SIZE 8
#define KEYMEDIA_INTERVAL 4
//Serial
#define ENDPOINT1_CONFIG ENDPOINT_TRANSIMIT_ONLY
#define ENDPOINT2_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
// MIDI
#define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
//Keyboard
#define ENDPOINT4_CONFIG ENDPOINT_TRANSIMIT_ONLY
//Mouse
#define ENDPOINT5_CONFIG ENDPOINT_TRANSIMIT_ONLY
// Media keys
#define ENDPOINT6_CONFIG ENDPOINT_TRANSIMIT_ONLY
I replicate this behavior with running the standard Teensy/USB_MIDI/InputRead example code.
Using any of the pre-made USB types that come with Teenyduino such as USB type "All of the above" does not have this delay issue.