2022-08-15 23:24:21 +02:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* This file provides a simple version of _esp_error_check_failed which is used on Linux target.
|
|
|
|
* For chip targets, esp_system component provides an implementation which uses esp_rom_printf and
|
|
|
|
* takes the possibility of the cache being disabled into account.
|
|
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2017-03-02 17:22:22 +11:00
|
|
|
#include "esp_err.h"
|
2018-05-31 12:47:06 +02:00
|
|
|
#include "sdkconfig.h"
|
2017-03-02 17:22:22 +11:00
|
|
|
|
|
|
|
void _esp_error_check_failed(esp_err_t rc, const char *file, int line, const char *function, const char *expression)
|
|
|
|
{
|
2018-05-31 12:47:06 +02:00
|
|
|
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));
|
2017-03-02 17:22:22 +11:00
|
|
|
printf("file: \"%s\" line %d\nfunc: %s\nexpression: %s\n", file, line, function, expression);
|
|
|
|
abort();
|
|
|
|
}
|