Skip to content

Commit 84c5c4a

Browse files
committed
Redirect Serial to SerialTinyUSB
Edit to 'tusb_config_stm32.h' that saves user's from having to define Serial as SerialTinyUSB in every sketch. Updated README to remove unnecessary instructions.
1 parent 64e5825 commit 84c5c4a

2 files changed

Lines changed: 3 additions & 20 deletions

File tree

README.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -140,27 +140,7 @@ void loop() {
140140
}
141141
}
142142
```
143-
## Using Serial Monitor with TinyUSB
144143
145-
TinyUSB creates a USB CDC serial port called `SerialTinyUSB`. To use the Arduino Serial Monitor:
146-
147-
**Option 1: Use SerialTinyUSB directly**
148-
```cpp
149-
SerialTinyUSB.begin(115200);
150-
SerialTinyUSB.println("Hello!");
151-
```
152-
153-
**Option 2: Alias Serial (recommended for code portability)**
154-
```cpp
155-
#define Serial SerialTinyUSB
156-
157-
void setup() {
158-
Serial.begin(115200);
159-
Serial.println("Hello!");
160-
}
161-
```
162-
163-
Add the `#define` at the top of your sketch before any other includes.
164144
## Technical Details
165145
166146
### Key Implementation Notes

stm32/tusb_config_stm32.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,7 @@
6262
#define CFG_TUD_VENDOR_RX_BUFSIZE 64
6363
#define CFG_TUD_VENDOR_TX_BUFSIZE 64
6464

65+
//Serial Redirect
66+
#define Serial SerialTinyUSB
67+
6568
#endif

0 commit comments

Comments
 (0)