For T4.x to allow MTP USB type device to generate events to send to the host, the Endpoint configuration need to change to say that we are transmitting on interrupt, not receiving. Plus I updated the end point event size to 32 as some events might be > 16. 16 is only large enought so send one parameter. I noticed Kindle Fire has it set to something like 28... I have done similar changes for T3.x but have not tested it yet.teensy4-core
#define MTP_RX_ENDPOINT 3 | #define MTP_RX_ENDPOINT 3 | ||||
#define MTP_RX_SIZE 64 | #define MTP_RX_SIZE 64 | ||||
#define MTP_EVENT_ENDPOINT 4 | #define MTP_EVENT_ENDPOINT 4 | ||||
#define MTP_EVENT_SIZE 16 | |||||
#define MTP_EVENT_SIZE 32 | |||||
#define MTP_EVENT_INTERVAL 10 | #define MTP_EVENT_INTERVAL 10 | ||||
#define SEREMU_INTERFACE 1 // Serial emulation | #define SEREMU_INTERFACE 1 // Serial emulation | ||||
#define SEREMU_TX_ENDPOINT 1 | #define SEREMU_TX_ENDPOINT 1 | ||||
#define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY | #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY | ||||
#define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY | #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY | ||||
#define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE | #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE | ||||
// TODO: Should ENDPOINT4_CONFIG be ENDPOINT_TRANSMIT_ONLY ??? | |||||
#define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ONLY | |||||
#define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY | |||||
#elif defined(USB_AUDIO) | #elif defined(USB_AUDIO) | ||||
#define VENDOR_ID 0x16C0 | #define VENDOR_ID 0x16C0 |
#define MTP_RX_SIZE_12 64 | #define MTP_RX_SIZE_12 64 | ||||
#define MTP_RX_SIZE_480 512 | #define MTP_RX_SIZE_480 512 | ||||
#define MTP_EVENT_ENDPOINT 4 | #define MTP_EVENT_ENDPOINT 4 | ||||
#define MTP_EVENT_SIZE 16 | |||||
#define MTP_EVENT_SIZE 32 | |||||
#define MTP_EVENT_INTERVAL_12 10 // 10 = 10 ms | #define MTP_EVENT_INTERVAL_12 10 // 10 = 10 ms | ||||
#define MTP_EVENT_INTERVAL_480 7 // 7 = 8 ms | #define MTP_EVENT_INTERVAL_480 7 // 7 = 8 ms | ||||
#define SEREMU_INTERFACE 1 // Serial emulation | #define SEREMU_INTERFACE 1 // Serial emulation | ||||
#define SEREMU_RX_INTERVAL 2 | #define SEREMU_RX_INTERVAL 2 | ||||
#define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_INTERRUPT + ENDPOINT_TRANSMIT_INTERRUPT | #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_INTERRUPT + ENDPOINT_TRANSMIT_INTERRUPT | ||||
#define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_BULK + ENDPOINT_TRANSMIT_BULK | #define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_BULK + ENDPOINT_TRANSMIT_BULK | ||||
// TODO: Should ENDPOINT4_CONFIG be ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_INTERRUPT ??? | |||||
#define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_INTERRUPT + ENDPOINT_TRANSMIT_UNUSED | |||||
#define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_INTERRUPT | |||||
#elif defined(USB_AUDIO) | #elif defined(USB_AUDIO) | ||||
#define VENDOR_ID 0x16C0 | #define VENDOR_ID 0x16C0 |