| 73 | } |
| 74 | |
| 75 | void HardwareSerial::systemDebugOutput(bool enabled) |
| 76 | { |
| 77 | if(!uart) { |
| 78 | return; |
| 79 | } |
| 80 | |
| 81 | if(enabled) { |
| 82 | if(smg_uart_tx_enabled(uart)) { |
| 83 | smg_uart_set_debug(uartNr); |
| 84 | m_setPuts(std::bind(&smg_uart_write, uart, _1, _2)); |
| 85 | } else { |
| 86 | smg_uart_set_debug(UART_NO); |
| 87 | } |
| 88 | } else if(smg_uart_get_debug() == uartNr) { |
| 89 | // Disable system debug messages on this interface |
| 90 | smg_uart_set_debug(UART_NO); |
| 91 | // and don't print debugf() data at all |
| 92 | m_setPuts(nullptr); |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | void HardwareSerial::invokeCallbacks() |
| 97 | { |