Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b52412e

Browse filesBrowse files
committed
Fixed Serial_::begin(..) definition to match arduino::HardwareSerial
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.
1 parent 5ae2f68 commit b52412e
Copy full SHA for b52412e

File tree

2 files changed

+4
-4
lines changed
Filter options

2 files changed

+4
-4
lines changed

‎cores/arduino/USB/CDC.cpp

Copy file name to clipboardExpand all lines: cores/arduino/USB/CDC.cpp
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,12 @@ void Serial_::enableInterrupt() {
196196
usbd.epBank0EnableTransferComplete(CDC_ENDPOINT_OUT);
197197
}
198198

199-
void Serial_::begin(uint32_t /* baud_count */)
199+
void Serial_::begin(unsigned long /* baudrate */)
200200
{
201201
// uart config is ignored in USB-CDC
202202
}
203203

204-
void Serial_::begin(uint32_t /* baud_count */, uint16_t /* config */)
204+
void Serial_::begin(unsigned long /* baudrate */, uint16_t /* config */)
205205
{
206206
// uart config is ignored in USB-CDC
207207
}

‎cores/arduino/USB/USBAPI.h

Copy file name to clipboardExpand all lines: cores/arduino/USB/USBAPI.h
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ class Serial_ : public arduino::HardwareSerial, arduino::PluggableUSBModule
101101
{
102102
public:
103103
Serial_(USBDeviceClass &_usb);
104-
void begin(uint32_t baud_count);
105-
void begin(unsigned long, uint16_t);
104+
void begin(unsigned long baudrate);
105+
void begin(unsigned long baudrate, uint16_t config);
106106
void end(void);
107107

108108
virtual int available(void);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.