Bläddra i källkod

esp_common: move esp_err

Renz Bagaporo 5 år sedan
förälder
incheckning
c16ceafa5c

+ 2 - 4
components/esp_common/CMakeLists.txt

@@ -9,15 +9,13 @@ if(BOOTLOADER_BUILD)
     set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-Wl,--gc-sections")
 else()
     # Regular app build
-    list(APPEND srcs "src/esp_err.c"
-             "src/esp_err_to_name.c")
+    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.
     idf_component_register(SRCS "${srcs}"
                            INCLUDE_DIRS include
                            REQUIRES ${target} espcoredump esp_timer esp_ipc esp_pm esp_hw_support
-                           PRIV_REQUIRES soc
-                           LDFRAGMENTS "linker.lf")
+                           PRIV_REQUIRES soc)
 
     set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY LINK_LIBRARIES "-Wl,--gc-sections")
     set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-Wl,--gc-sections")

+ 0 - 4
components/esp_common/linker.lf

@@ -1,4 +0,0 @@
-[mapping:esp_common]
-archive: libesp_common.a
-entries:
-    esp_err (noflash)

+ 2 - 1
components/esp_system/CMakeLists.txt

@@ -16,7 +16,8 @@ set(srcs  "intr_alloc.c"
           "task_wdt.c"
           "int_wdt.c"
           "stack_check.c"
-          "freertos_hooks.c")
+          "freertos_hooks.c"
+          "esp_err.c")
 
 if(NOT (${target} STREQUAL "esp32c3") )
     list(APPEND srcs  "dbg_stubs.c")

+ 1 - 0
components/esp_common/src/esp_err.c → components/esp_system/esp_err.c

@@ -12,6 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 #include <stdbool.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "esp_err.h"

+ 1 - 0
components/esp_system/linker.lf

@@ -5,6 +5,7 @@ entries:
     panic_handler (noflash)
     panic_arch (noflash)
     reset_reason (noflash)
+    esp_err (noflash)
     system_api:esp_system_abort (noflash)
 
     if ESP_CONSOLE_USB_CDC_SUPPORT_ETS_PRINTF: