console: handle empty input to esp_console_run correctly

Fixes https://github.com/espressif/esp-idf/issues/1067

Ref. TW15752
This commit is contained in:
Ivan Grokhotkov
2017-10-13 07:12:08 +08:00
parent 8e47c355fa
commit 4d42b5ea24
3 changed files with 7 additions and 1 deletions

View File

@@ -153,6 +153,8 @@ void app_main()
esp_err_t err = esp_console_run(line, &ret);
if (err == ESP_ERR_NOT_FOUND) {
printf("Unrecognized command\n");
} else if (err == ESP_ERR_INVALID_ARG) {
// command was empty
} else if (err == ESP_OK && ret != ESP_OK) {
printf("Command returned non-zero error code: 0x%x\n", ret);
} else if (err != ESP_OK) {