OVMS3-idf/components/wear_levelling/test_wl_host/esp_error_check_stub.cpp
Roland Dobai 07acbb5664 ESP_ERROR_CHECK converts error code to text
If CONFIG_ESP_ERR_TO_NAME_LOOKUP is enabled, ESP_ERROR_CHECK
prints error message in addition to the error code.
2018-05-31 12:53:37 +02:00

15 lines
528 B
C++

#include "catch.hpp"
#include "esp_err.h"
#include "sdkconfig.h"
void _esp_error_check_failed(esp_err_t rc, const char *file, int line, const char *function, const char *expression)
{
printf("ESP_ERROR_CHECK failed: esp_err_t 0x%x", rc);
#ifdef CONFIG_ESP_ERR_TO_NAME_LOOKUP
printf(" (%s)", esp_err_to_name(rc));
#endif //CONFIG_ESP_ERR_TO_NAME_LOOKUP
printf(" at %p\n", __builtin_return_address(0));
printf("file: \"%s\" line %d\nfunc: %s\nexpression: %s\n", file, line, function, expression);
abort();
}