forked from espressif/esp-idf
Merge branch 'bugfix/esp_err_linux_target' into 'master'
esp_common: make esp_err_to_name and ESP_ERROR_CHECK usable on Linux target Closes IDF-2693 See merge request espressif/esp-idf!19569
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
idf_build_get_property(target IDF_TARGET)
|
idf_build_get_property(target IDF_TARGET)
|
||||||
|
|
||||||
if(${target} STREQUAL "linux")
|
if(${target} STREQUAL "linux")
|
||||||
# Header only library for linux
|
set(ldfragments)
|
||||||
idf_component_register(INCLUDE_DIRS include)
|
set(srcs "src/esp_err_check_linux.c")
|
||||||
return()
|
else()
|
||||||
|
set(ldfragments common.lf soc.lf)
|
||||||
|
set(srcs)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND srcs "src/esp_err_to_name.c")
|
list(APPEND srcs "src/esp_err_to_name.c")
|
||||||
@@ -11,7 +13,7 @@ list(APPEND srcs "src/esp_err_to_name.c")
|
|||||||
# Note: esp_ipc, esp_pm added as a public requirement to keep compatibility as to be located here.
|
# Note: esp_ipc, esp_pm added as a public requirement to keep compatibility as to be located here.
|
||||||
idf_component_register(SRCS "${srcs}"
|
idf_component_register(SRCS "${srcs}"
|
||||||
INCLUDE_DIRS include
|
INCLUDE_DIRS include
|
||||||
LDFRAGMENTS "common.lf" "soc.lf")
|
LDFRAGMENTS ${ldfragments})
|
||||||
|
|
||||||
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY LINK_INTERFACE_MULTIPLICITY 4)
|
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY LINK_INTERFACE_MULTIPLICITY 4)
|
||||||
|
|
||||||
|
@@ -1,4 +1,14 @@
|
|||||||
#include "catch.hpp"
|
/*
|
||||||
|
* 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>
|
||||||
#include "esp_err.h"
|
#include "esp_err.h"
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
|
|
@@ -7,6 +7,10 @@
|
|||||||
//Do not edit this file because it is autogenerated by gen_esp_err_to_name.py
|
//Do not edit this file because it is autogenerated by gen_esp_err_to_name.py
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#if __has_include(<bsd/string.h>)
|
||||||
|
// for strlcpy
|
||||||
|
#include <bsd/string.h>
|
||||||
|
#endif
|
||||||
#include "esp_err.h"
|
#include "esp_err.h"
|
||||||
#if __has_include("soc/soc.h")
|
#if __has_include("soc/soc.h")
|
||||||
#include "soc/soc.h"
|
#include "soc/soc.h"
|
||||||
|
@@ -7,6 +7,10 @@
|
|||||||
@COMMENT@
|
@COMMENT@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#if __has_include(<bsd/string.h>)
|
||||||
|
// for strlcpy
|
||||||
|
#include <bsd/string.h>
|
||||||
|
#endif
|
||||||
#include "esp_err.h"
|
#include "esp_err.h"
|
||||||
#if __has_include("soc/soc.h")
|
#if __has_include("soc/soc.h")
|
||||||
#include "soc/soc.h"
|
#include "soc/soc.h"
|
||||||
|
@@ -2,7 +2,6 @@ TEST_PROGRAM=test_nvs
|
|||||||
all: $(TEST_PROGRAM)
|
all: $(TEST_PROGRAM)
|
||||||
|
|
||||||
SOURCE_FILES = \
|
SOURCE_FILES = \
|
||||||
esp_error_check_stub.cpp \
|
|
||||||
$(addprefix ../src/, \
|
$(addprefix ../src/, \
|
||||||
nvs_types.cpp \
|
nvs_types.cpp \
|
||||||
nvs_api.cpp \
|
nvs_api.cpp \
|
||||||
@@ -30,7 +29,7 @@ SOURCE_FILES = \
|
|||||||
test_nvs_initialization.cpp \
|
test_nvs_initialization.cpp \
|
||||||
main.cpp
|
main.cpp
|
||||||
|
|
||||||
SOURCE_FILES_C = ../../esp_rom/linux/esp_rom_crc.c
|
SOURCE_FILES_C = ../../esp_rom/linux/esp_rom_crc.c ../../esp_common/src/esp_err_check_linux.c
|
||||||
|
|
||||||
ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
|
ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
|
||||||
COMPILER := clang
|
COMPILER := clang
|
||||||
|
@@ -9,14 +9,6 @@
|
|||||||
|
|
||||||
extern void app_main(void);
|
extern void app_main(void);
|
||||||
|
|
||||||
void _esp_error_check_failed(esp_err_t rc, const char *file, int line, const char *function, const char *expression)
|
|
||||||
{
|
|
||||||
ESP_LOGE("ESP_ERROR_CHECK", "Failed with esp_err_t: 0x%x", rc);
|
|
||||||
ESP_LOGE("ESP_ERROR_CHECK", "Expression: %s", expression);
|
|
||||||
ESP_LOGE("ESP_ERROR_CHECK", "Functions: %s %s(%d)", function, file, line);
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
|
|
||||||
esp_err_t esp_event_loop_create_default(void)
|
esp_err_t esp_event_loop_create_default(void)
|
||||||
{
|
{
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
|
Reference in New Issue
Block a user