handling of Serial on CDC USB board
... like the typical -C3 * Replaced a few direct Serial.printf with macros * Always check if Serial is connected before printing (CDC sometimes hangs when trying to send/receive without connection)
This commit is contained in:
@@ -32,10 +32,10 @@ void updateBaudRate(uint32_t rate){
|
||||
currentBaud = rate100;
|
||||
|
||||
if (!pinManager.isPinAllocated(hardwareTX) || pinManager.getPinOwner(hardwareTX) == PinOwner::DebugOut){
|
||||
Serial.print(F("Baud is now ")); Serial.println(rate);
|
||||
if (Serial) { Serial.print(F("Baud is now ")); Serial.println(rate); }
|
||||
}
|
||||
|
||||
Serial.flush();
|
||||
if (Serial) Serial.flush();
|
||||
Serial.begin(rate);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user