Skip to content

Commit 9defb31

Browse 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 9defb31

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cores/arduino/USB/CDC.cpp

Lines 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

Lines 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy