Skip to content

Commit 1be98bd

Browse files
NicoHoodcmaglie
authored andcommitted
Fix compiler warning in CDC.cpp
1 parent 948c73c commit 1be98bd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cores/arduino/CDC.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,11 @@ Serial_::operator bool() {
236236

237237
unsigned long Serial_::baud() {
238238
// Disable interrupts while reading a multi-byte value
239+
uint32_t baudrate;
239240
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
240-
return _usbLineInfo.dwDTERate;
241+
baudrate = _usbLineInfo.dwDTERate;
241242
}
243+
return baudrate;
242244
}
243245

244246
uint8_t Serial_::stopbits() {

0 commit comments

Comments
 (0)