Add support for a triple serial port configuration (USB_TRIPLE_SERIAL),
providing a composite USB device, comprised of three serial ports.
The third serial port is called usb_serial3 (C) or SerialB (C++).
Note that no dummy C++ class is created if USB_DISABLED is defined,
unlike for the first port.
This increases binary size by ca. 0.5 KiB (despite needing 720 more
bytes for USB buffers, as gcc-5.4.1 no longer decides to unroll a loop
over all endpoints in usb_isr()).
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Add support for a dual serial port configuration (USB_DUAL_SERIAL),
providing a composite USB device, comprised of two serial ports.
The second serial port is called usb_serial2 (C) or SerialA (C++).
Note that no dummy C++ class is created if USB_DISABLED is defined,
unlike for the first port.
This increases binary size by ca. 1.2 KiB (720 bytes for USB buffers).
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
When including "core_pins.h":
teensy3/usb_dev.c: In function '_reboot_Teensyduino_':
teensy3/usb_dev.c:899:1: warning: 'noreturn' function does return
Fix this by adding a call to __builtin_unreachable().
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
When processing CDC_SET_CONTROL_LINE_STATE and CDC_SET_LINE_CODING
requests, wIndex is ignored. Hence if the CDC Status Interface is
enabled, these requests are always processed, even when not destined for
the actual serial status interface.
Fix this by adding a check to ensure that wIndex matches the CDC status
interface.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Sometimes the PC or Mac drivers are not actually ready to begin receiving data immediately after they cause DTR or RTS to assert. This delay allows the PC to become ready before we tell sketches the Serial device is true (ready).
This patch simply checks if NUM_ENDPOINTS is defined, and will bypass the
built-in USB descriptor, device and memory code, and allows a custom setting.
This bug does not affect the IDE unless someone adds the custom option to
the boards.txt file, and provides replacement code in a library or sketch.
It can also be used to turn off USB by providing no replacements, while
allowing speeds >= 20MHz.