void HardwareSerial::end() { if(uart_get_debug() == _uart_nr) { uart_set_debug(UART_NO); } uart_uninit(_uart); _uart = NULL; }
irom void __serial_end(uart_t *uxt) { if(uart_get_debug() == _uart_nr) { uart_set_debug(UART_NO); } uart_uninit(uxt); uxt = NULL; }
irom uart_t * __serial_begin(int uart_nr, unsigned long baud) { _uart_nr = uart_nr; if(uart_get_debug() == _uart_nr) { uart_set_debug(UART_NO); } uart_t *_uart = __uart_init(_uart_nr, baud, SERIAL_8N1, SERIAL_FULL, 1); _peek_char = -1; return _uart; }
dce_result_t SECTION_ATTR dce_handle_GMEM(dce_t* dce, void* group_ctx, int kind, size_t argc, arg_t* argv) { char line[12]; int length = sprintf(line, "%d", system_get_free_heap_size()); dce_emit_information_response(dce, line, length); int debug_enabled = uart_get_debug(); uart_set_debug(1); system_print_meminfo(); uart_set_debug(debug_enabled); dce_emit_basic_result_code(dce, DCE_RC_OK); }
void HardwareSerial::setDebugOutput(bool en) { if(!_uart) { return; } if(en) { if(uart_tx_enabled(_uart)) { uart_set_debug(_uart_nr); } else { uart_set_debug(UART_NO); } } else { // disable debug for this interface if(uart_get_debug() == _uart_nr) { uart_set_debug(UART_NO); } } }