Skip to content

Commit 4f968c3

Browse files
committed
Merge branch 'contrib/github_pr_15401' into 'master'
Fix idf_as_lib example (GitHub PR) Closes IDFGH-14655 See merge request espressif/esp-idf!37127
2 parents ce3d603 + 54cb663 commit 4f968c3

File tree

10 files changed

+51
-58
lines changed

10 files changed

+51
-58
lines changed

examples/build_system/cmake/idf_as_lib/build-esp32p4.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build.sh

examples/build_system/cmake/idf_as_lib/run-esp32p4.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
run-esp32.sh
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
add_library(stub_esp32 STATIC system_api.c flash_ops.c cpu_start.c)
1+
add_library(stub_esp32 STATIC system_api.c cpu_start.c)
22
target_include_directories(stub_esp32 PUBLIC .)
33
add_library(stub::esp32 ALIAS stub_esp32)
4-
5-
target_link_libraries(stub_esp32 stub::spi_flash)

examples/build_system/cmake/idf_as_lib/stubs/esp32/esp_system.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
extern "C" {
1010
#endif
1111

12+
#define ESP_OK 0 /*!< esp_err_t value indicating success (no error) */
13+
14+
typedef int esp_err_t;
15+
1216
void esp_restart(void);
1317

1418
#ifdef __cplusplus

examples/build_system/cmake/idf_as_lib/stubs/esp32/flash_ops.c

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
add_library(stub_spi_flash INTERFACE)
2-
target_include_directories(stub_spi_flash INTERFACE .)
1+
add_library(stub_spi_flash STATIC flash_ops.c)
2+
target_include_directories(stub_spi_flash PUBLIC .)
33
add_library(stub::spi_flash ALIAS stub_spi_flash)
4+
target_link_libraries(stub_spi_flash PUBLIC stub_esp32)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Unlicense OR CC0-1.0
5+
*/
6+
7+
#pragma once
8+
9+
#include <stdint.h>
10+
#include "esp_system.h"
11+
12+
#ifdef __cplusplus
13+
extern "C" {
14+
#endif
15+
16+
typedef void * esp_flash_t;
17+
18+
esp_err_t esp_flash_get_size(esp_flash_t *chip, uint32_t *out_size);
19+
20+
#ifdef __cplusplus
21+
}
22+
#endif

examples/build_system/cmake/idf_as_lib/stubs/spi_flash/esp_spi_flash.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)