Skip to content

Commit 00f50b3

Browse files
committed
Set a baud rate limit for cdc-acm internally
-set a baud rate limit for cdc-acm due to the limitation of Inter Processor Mailbox
1 parent 2227ce1 commit 00f50b3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

cores/arduino/CDCSerialClass.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,13 @@ void CDCSerialClass::begin(const uint32_t dwBaudRate, const uint8_t config)
8686
}
8787

8888

89-
void CDCSerialClass::init(const uint32_t dwBaudRate, const uint8_t modeReg)
89+
void CDCSerialClass::init(uint32_t dwBaudRate, const uint8_t modeReg)
9090
{
91+
/* Set a max internal baud rate due to the limitation of the
92+
* Inter Processor Mailbox */
93+
if(dwBaudRate > 115200)
94+
dwBaudRate = 115200;
95+
9196
/* Set a per-byte write delay approximately equal to the time it would
9297
* take to clock out a byte on a standard UART at this baud rate */
9398
_writeDelayUsec = 8000000 / dwBaudRate;

cores/arduino/CDCSerialClass.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class CDCSerialClass : public HardwareSerial
6363
};
6464

6565
protected:
66-
void init(const uint32_t dwBaudRate, const uint8_t config);
66+
void init(uint32_t dwBaudRate, const uint8_t config);
6767

6868
uart_init_info *info;
6969
uint32_t _writeDelayUsec;

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