diff options
Diffstat (limited to 'cores/arduino')
-rw-r--r-- | cores/arduino/CDC.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cores/arduino/CDC.cpp b/cores/arduino/CDC.cpp index 7168408..f19b44c 100644 --- a/cores/arduino/CDC.cpp +++ b/cores/arduino/CDC.cpp @@ -236,9 +236,11 @@ Serial_::operator bool() { unsigned long Serial_::baud() { // Disable interrupts while reading a multi-byte value + uint32_t baudrate; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { - return _usbLineInfo.dwDTERate; + baudrate = _usbLineInfo.dwDTERate; } + return baudrate; } uint8_t Serial_::stopbits() { |