esp_console.h init and deinit issue

Kalveo
Posts: 3
Joined: Mon Jun 26, 2017 2:27 pm

esp_console.h init and deinit issue

Postby Kalveo » Sun Mar 10, 2019 12:37 pm

In a project I'm working on I am using

Code: Select all

esp_err_t esp_console_init(const esp_console_config_t* config)
and

Code: Select all

esp_err_t esp_console_deinit()
In the scenario when I'm using them in the order init -> deinit -> init I get the error ESP_ERR_INVALID_STATE. Debugging shows that this is because s_tmp_line_buf is not NULL in

Code: Select all

if (s_tmp_line_buf) {
        return ESP_ERR_INVALID_STATE;
    }
despite being freed in the deinit function. Is this intended behavior or is this a bug?

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: esp_console.h init and deinit issue

Postby ESP_igrr » Sun Mar 10, 2019 4:48 pm

Looks like a bug, esp_console_deinit should set s_tmp_line_buf to NULL after freeing.

Who is online

Users browsing this forum: VinayDand and 463 guests