Examples: Demonstrate the usage of esp_err_to_name

This commit is contained in:
Roland Dobai
2018-02-22 14:48:53 +01:00
parent f891eac827
commit 27a63c492f
31 changed files with 156 additions and 145 deletions

View File

@@ -49,11 +49,14 @@ void app_main(void)
if ( r == ESP_OK ) {
printf("%d: %d\n", output_data, read_raw );
} else if ( r == ESP_ERR_INVALID_STATE ) {
printf("ADC2 not initialized yet.\n");
printf("%s: ADC2 not initialized yet.\n", esp_err_to_name(r));
} else if ( r == ESP_ERR_TIMEOUT ) {
//This can not happen in this example. But if WiFi is in use, such error code could be returned.
printf("ADC2 is in use by Wi-Fi.\n");
printf("%s: ADC2 is in use by Wi-Fi.\n", esp_err_to_name(r));
} else {
printf("%s\n", esp_err_to_name(r));
}
vTaskDelay( 2 * portTICK_PERIOD_MS );
}
}