Start Serial Port at correct
| 363 | |
| 364 | // Start Serial Port at correct |
| 365 | void debugStartSerial() |
| 366 | { |
| 367 | if(debugSerialBaud < 0) { |
| 368 | LOG_WARNING(TAG_DEBG, F(D_SERVICE_DISABLED " (%u Bps)"), debugSerialBaud); |
| 369 | // return; |
| 370 | } |
| 371 | |
| 372 | uint32_t baudrate = debugSerialBaud; |
| 373 | if(baudrate < 9600) baudrate = SERIAL_SPEED; |
| 374 | |
| 375 | #if defined(STM32F4xx) || defined(STM32F7xx) |
| 376 | #ifndef STM32_SERIAL1 // Define what Serial port to use for log output |
| 377 | Serial.setRx(PA3); // User Serial2 |
| 378 | Serial.setTx(PA2); |
| 379 | #endif |
| 380 | #endif |
| 381 | |
| 382 | Serial.begin(baudrate); /* prepare for possible serial debug */ |
| 383 | delay(10); |
| 384 | Log.registerOutput(0, &Serial, HASP_LOG_LEVEL, true); // LOG_LEVEL_VERBOSE |
| 385 | |
| 386 | Serial.println(); |
| 387 | debugPrintHaspHeader(&Serial); |
| 388 | Serial.flush(); |
| 389 | |
| 390 | LOG_INFO(TAG_DEBG, F(D_SERVICE_STARTED " @ %u bps"), debugSerialBaud); |
| 391 | LOG_INFO(TAG_DEBG, F(D_INFO_ENVIRONMENT ": " PIOENV)); |
| 392 | } |
| 393 | |
| 394 | // Do NOT call Log function before debugSetup is called |
| 395 | void debugSetup(JsonObject settings) |
no test coverage detected