Exemple #1
0
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);
}
Exemple #2
0
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);
        }
    }
}
Exemple #3
0
void HardwareSerial::end()
{
    if(uart_get_debug() == _uart_nr) {
        uart_set_debug(UART_NO);
    }

    uart_uninit(_uart);
    _uart = NULL;
}
Exemple #4
0
irom void __serial_end(uart_t *uxt)
{
    if(uart_get_debug() == _uart_nr) {
        uart_set_debug(UART_NO);
    }

    uart_uninit(uxt);
    uxt = NULL;
}
Exemple #5
0
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;
}
Exemple #6
0
void ICACHE_FLASH_ATTR user_init(void)
{
    config_init();
    dce = dce_init(256);
    uart0 = uart0_init(config->baud_rate, &rx_dce_cb);
    dce_register_ip_commands(dce);
    dce_register_wifi_commands(dce);
    dce_register_interface_commands(dce, uart0);
    dce_register_info_commands(dce);
    uart_set_debug(0);
    system_os_task( command_task,
                    COMMAND_TASK_PRIORITY,
                    command_queue,
                    COMMAND_QUEUE_SIZE);
}