use Serial.print for important info like wifi stuff

.. and for other important info.
Will be muted automatically in case that serial is in used for other purposes.
This commit is contained in:
Frank
2022-12-04 17:52:10 +01:00
parent 1a9a1cbbbe
commit 676cc26171
10 changed files with 93 additions and 41 deletions

View File

@@ -67,6 +67,18 @@ void sendBytes(){
}
}
bool canUseSerial(void) { // WLEDMM returns true if Serial can be used for debug output (i.e. not configured for other purpose)
if (pinManager.isPinAllocated(hardwareTX) && (pinManager.getPinOwner(hardwareTX) != PinOwner::DebugOut))
return false; // TX allocated to LEDs or other functions
if ((realtimeMode == REALTIME_MODE_GENERIC) || (realtimeMode == REALTIME_MODE_ADALIGHT) || (realtimeMode == REALTIME_MODE_TPM2NET))
return false; // Serial in use for adaLight or other serial communication
//if ((improvActive == 1) || (improvActive == 2)) return false; // don't interfere when IMPROV communication is ongoing
if (improvActive > 0) return false; // don't interfere when IMPROV communication is ongoing
if (continuousSendLED == true) return false; // Continuous Serial Streaming
return true;
} // WLEDMM end
void handleSerial()
{
if (pinManager.isPinAllocated(hardwareRX)) return;