Skip to content

Commit 900ae49

Browse files
NicoHoodcmaglie
authored andcommitted
Fix compiler warning in CDC.cpp
1 parent 228fa37 commit 900ae49

File tree

1 file changed

+3
-1
lines changed
  • hardware/arduino/avr/cores/arduino

1 file changed

+3
-1
lines changed

hardware/arduino/avr/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)