Skip to content

Commit

Permalink
Make SerialCDC inherit from HardwareSerial
Browse files Browse the repository at this point in the history
As suggested by @thiagoralves
  • Loading branch information
facchinm committed Dec 3, 2021
1 parent 104f07f commit 7e2d627
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cores/arduino/USB/CDC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ void Serial_::begin(uint32_t /* baud_count */)
// uart config is ignored in USB-CDC
}

void Serial_::begin(uint32_t /* baud_count */, uint8_t /* config */)
void Serial_::begin(uint32_t /* baud_count */, uint16_t /* config */)
{
// uart config is ignored in USB-CDC
}
Expand Down
5 changes: 3 additions & 2 deletions cores/arduino/USB/USBAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "Arduino.h"
#include "api/Stream.h"
#include "api/RingBuffer.h"
#include "api/HardwareSerial.h"
#include "api/USBAPI.h"
#include "CDC.h"

Expand Down Expand Up @@ -96,12 +97,12 @@ extern USBDeviceClass USBDevice;
//================================================================================
// Serial over CDC (Serial1 is the physical port)

class Serial_ : public arduino::Stream, public arduino::PluggableUSBModule
class Serial_ : public arduino::HardwareSerial, arduino::PluggableUSBModule
{
public:
Serial_(USBDeviceClass &_usb);
void begin(uint32_t baud_count);
void begin(unsigned long, uint8_t);
void begin(unsigned long, uint16_t);
void end(void);

virtual int available(void);
Expand Down

0 comments on commit 7e2d627

Please sign in to comment.