Skip to content

Commit a1c9dfe

Browse files
authored
Add TinyUSB usage note. (#168)
1 parent 8016a93 commit a1c9dfe

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

docs/usb.rst

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,23 @@ Adafruit TinyUSB Arduino Support
2525
Examples are provided in the Adafruit_TinyUSB_Arduino for the more
2626
advanced USB stack.
2727

28-
Please note that this stack requires sketches to manually call
28+
To use Serial with TinyUSB, you must include the TinyUSB header in your
29+
sketch to avoid a compile error.
30+
31+
.. code:: cpp
32+
33+
#include <Adafruit_TinyUSB.h>
34+
35+
If you need to be compatible with the
36+
other USB stack, you can use an ifdef:
37+
38+
.. code:: cpp
39+
40+
#ifdef USE_TINYUSB
41+
#include <Adafruit_TinyUSB.h>
42+
#endif
43+
44+
Also, this stack requires sketches to manually call
2945
``Serial.begin(115200)`` to enable the USB serial port and automatic
3046
sketch upload from the IDE. If a sketch is run without this command
3147
in ``setup()``, the user will need to use the standard "hold BOOTSEL

0 commit comments

Comments
 (0)