since 'Serial' is faked as USB Serial, only usb_serial.h is needed here
to "trick" dependent libraries. including the other usb headers there
just adds bloat to an already overbloated header (ala typical
Arduino-style includes)
ver 5.7+ of the CMSIS library (arm_math / DSP) defines these exact same
symbols as "intrinsics" (the ASM is the same), and since CMSIS headers
and imxrt.h are included at some points (e.g. Audio library code) this
needs to be resolved
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.
There are times when I wish to debug the cores files, that I wish I could do debug output to USB. Note: can do with cpp files by doing Serial.printf or the like, but more of a pain with .c files.
The printf stuff put into cores has been very useful for debuging esperailly earlier on. I understand some of the time it is needed to debug usb stuff or early on stuff so TX pin of Serial4 makes sense.
But for other debugging sessions, wish you had option to go output to the logical Serial object.
So I added a new commented out define in the printf.h file that syas
#define PRINT_DEBUG_USING_USB
That is uncommented, the debug function putchar_debug is defined to either use usb_serial_putchar if we are using normal USB Serial or use usb_seremu_putchar if using Serial emulation.
So far my main testing has been with seremu..
Not sure if this is something you are interested in. but just in case.
Did this Pull Request
If called second time - fix the counts to reflect just the size of the new buffer plus the static buffer.
Also as a precaution, resets the TX or RX head tail pointers back to 0 to make sure it is not indexing into memory that may not exist.