Skip to content

Commit 5c7319f

Browse files
committed
make it so native USB is Serial
1 parent bf20844 commit 5c7319f

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

cores/arduino/USB/CDC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,6 @@ Serial_::operator bool()
289289
return result;
290290
}
291291

292-
Serial_ SerialUSB(USBDevice);
292+
Serial_ Serial(USBDevice);
293293

294294
#endif

cores/arduino/USB/USBAPI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class Serial_ : public Stream
130130
USBDeviceClass &usb;
131131
RingBuffer *_cdc_rx_buffer;
132132
};
133-
extern Serial_ SerialUSB;
133+
extern Serial_ Serial;
134134

135135
//================================================================================
136136
//================================================================================

cores/arduino/USB/USBCore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ void USBDeviceClass::handleEndpoint(uint8_t ep)
250250

251251
// Handle received bytes
252252
if (available(CDC_ENDPOINT_OUT))
253-
SerialUSB.accept();
253+
Serial.accept();
254254
}
255255
if (ep == CDC_ENDPOINT_IN)
256256
{

variants/arduino_zero/variant.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,14 @@ SERCOM sercom4( SERCOM4 ) ;
208208
SERCOM sercom5( SERCOM5 ) ;
209209

210210
Uart Serial1( &sercom0, PIN_SERIAL1_RX, PIN_SERIAL1_TX, PAD_SERIAL1_RX, PAD_SERIAL1_TX ) ;
211-
Uart Serial( &sercom5, PIN_SERIAL_RX, PIN_SERIAL_TX, PAD_SERIAL_RX, PAD_SERIAL_TX ) ;
211+
Uart Serial5( &sercom5, PIN_SERIAL_RX, PIN_SERIAL_TX, PAD_SERIAL_RX, PAD_SERIAL_TX ) ;
212212
void SERCOM0_Handler()
213213
{
214214
Serial1.IrqHandler();
215215
}
216216

217217
void SERCOM5_Handler()
218218
{
219-
Serial.IrqHandler();
219+
Serial5.IrqHandler();
220220
}
221221

variants/arduino_zero/variant.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ extern SERCOM sercom3;
183183
extern SERCOM sercom4;
184184
extern SERCOM sercom5;
185185

186-
extern Uart Serial;
186+
extern Uart Serial5;
187187
extern Uart Serial1;
188188

189189
#endif
@@ -203,7 +203,7 @@ extern Uart Serial1;
203203
//
204204
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
205205
// pins are NOT connected to anything by default.
206-
#define SERIAL_PORT_USBVIRTUAL SerialUSB
206+
#define SERIAL_PORT_USBVIRTUAL Serial
207207
#define SERIAL_PORT_MONITOR Serial
208208
// Serial has no physical pins broken out, so it's not listed as HARDWARE port
209209
#define SERIAL_PORT_HARDWARE Serial1

0 commit comments

Comments
 (0)