Skip to content

Commit

Permalink
Fixed Serial_::begin(..) definition to match arduino::HardwareSerial
Browse files Browse the repository at this point in the history
This is usually not a problem becuase we use the arm-none-eabi-gcc compiler
thas has type `uint32_t` aliased to `unsigned long`. Anyway this is not
mandatory in general, and the compiler may choose to alias `uint32_t` with
`unsigned int` as it happens with llvm/clang.

Since we use clangd as language server on the Arduino IDE 2.0 the
Serial_ object and all the derived instances (Serial, SerialUSB, ...) are
not available in code-completion suggestions.
  • Loading branch information
cmaglie committed Jun 8, 2022
1 parent 5ae2f68 commit b52412e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cores/arduino/USB/CDC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ void Serial_::enableInterrupt() {
usbd.epBank0EnableTransferComplete(CDC_ENDPOINT_OUT);
}

void Serial_::begin(uint32_t /* baud_count */)
void Serial_::begin(unsigned long /* baudrate */)
{
// uart config is ignored in USB-CDC
}

void Serial_::begin(uint32_t /* baud_count */, uint16_t /* config */)
void Serial_::begin(unsigned long /* baudrate */, uint16_t /* config */)
{
// uart config is ignored in USB-CDC
}
Expand Down
4 changes: 2 additions & 2 deletions cores/arduino/USB/USBAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ class Serial_ : public arduino::HardwareSerial, arduino::PluggableUSBModule
{
public:
Serial_(USBDeviceClass &_usb);
void begin(uint32_t baud_count);
void begin(unsigned long, uint16_t);
void begin(unsigned long baudrate);
void begin(unsigned long baudrate, uint16_t config);
void end(void);

virtual int available(void);
Expand Down

0 comments on commit b52412e

Please sign in to comment.