georgerosar
Active member
Why don't these modifications allow the USBSerial1 to work, it shows up but USBSerial1.begin() doesn't allow transfer of information.
I haven't worked on this too hard, but I'm curious what else I have to change, or if something is wrong
The idea is to use -DUSB_MIDI_AUDIO_SERIAL
and have an other serial port for debugging in gdb through target remote serial
If I change this in usb_desc.h
(unindented are modifications)
and this in yield.cpp
and also in yield.cpp
I haven't worked on this too hard, but I'm curious what else I have to change, or if something is wrong
The idea is to use -DUSB_MIDI_AUDIO_SERIAL
and have an other serial port for debugging in gdb through target remote serial
If I change this in usb_desc.h
(unindented are modifications)
Code:
#elif defined(USB_MIDI_AUDIO_SERIAL)
#define VENDOR_ID 0x16C0
#define PRODUCT_ID 0x048A
#define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
#define MANUFACTURER_NAME_LEN 11
#define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','I','D','I','/','A','u','d','i','o'}
#define PRODUCT_NAME_LEN 17
#define EP0_SIZE 64
#define NUM_ENDPOINTS 8
#define NUM_INTERFACE 8
#define CDC_IAD_DESCRIPTOR 1
#define CDC_STATUS_INTERFACE 0
#define CDC_DATA_INTERFACE 1 // Serial
#define CDC_ACM_ENDPOINT 2
#define CDC_RX_ENDPOINT 3
#define CDC_TX_ENDPOINT 3
#define CDC_ACM_SIZE 16
#define CDC_RX_SIZE_480 512
#define CDC_TX_SIZE_480 512
#define CDC_RX_SIZE_12 64
#define CDC_TX_SIZE_12 64
#define MIDI_INTERFACE 2 // MIDI
#define MIDI_NUM_CABLES 1
#define MIDI_TX_ENDPOINT 4
#define MIDI_TX_SIZE_12 64
#define MIDI_TX_SIZE_480 512
#define MIDI_RX_ENDPOINT 4
#define MIDI_RX_SIZE_12 64
#define MIDI_RX_SIZE_480 512
#define AUDIO_INTERFACE 3 // Audio (uses 3 consecutive interfaces)
#define AUDIO_TX_ENDPOINT 5
#define AUDIO_TX_SIZE 180
#define AUDIO_RX_ENDPOINT 5
#define AUDIO_RX_SIZE 180
#define AUDIO_SYNC_ENDPOINT 6
#define CDC2_STATUS_INTERFACE 6 // SerialUSB1
#define CDC2_DATA_INTERFACE 7
#define CDC2_ACM_ENDPOINT 7
#define CDC2_RX_ENDPOINT 8
#define CDC2_TX_ENDPOINT 8
#define CDC2_ACM_SIZE 16
#define CDC2_RX_SIZE_480 512
#define CDC2_TX_SIZE_480 512
#define CDC2_RX_SIZE_12 64
#define CDC2_TX_SIZE_12 64
#define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_INTERRUPT
#define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_BULK + ENDPOINT_TRANSMIT_BULK
#define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_BULK + ENDPOINT_TRANSMIT_BULK
#define ENDPOINT5_CONFIG ENDPOINT_RECEIVE_ISOCHRONOUS + ENDPOINT_TRANSMIT_ISOCHRONOUS
#define ENDPOINT6_CONFIG ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_ISOCHRONOUS
#define ENDPOINT7_CONFIG ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_INTERRUPT
#define ENDPOINT8_CONFIG ENDPOINT_RECEIVE_BULK + ENDPOINT_TRANSMIT_BULK
and this in yield.cpp
Code:
#elif defined(USB_DUAL_SERIAL) || defined(USB_MIDI_AUDIO_SERIAL)
uint8_t yield_active_check_flags = YIELD_CHECK_USB_SERIAL | YIELD_CHECK_USB_SERIALUSB1; // default to check USB.
extern const uint8_t _serialEventUSB1_default;
and also in yield.cpp
Code:
#if defined(USB_DUAL_SERIAL) || defined(USB_TRIPLE_SERIAL) || defined(USB_MIDI_AUDIO_SERIAL)
if (yield_active_check_flags & YIELD_CHECK_USB_SERIALUSB1) {
if (SerialUSB1.available()) serialEventUSB1();
if (_serialEventUSB1_default) yield_active_check_flags &= ~YIELD_CHECK_USB_SERIALUSB1;
}
#endif