Skip to content

Commit dba42b9

Browse files
authored
fix: support ESP32 core 3.3.11 mempool symbols
1 parent 633fb9a commit dba42b9

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ jobs:
185185
- "examples/NimBLE_Server"
186186
variant:
187187
- esp32
188+
- esp32c5
188189
- esp32c3
189190
- esp32s3
190191
- esp32c6

src/nimble/porting/nimble/include/os/os_mempool.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@
3232
#include "nimble/porting/nimble/include/os/os.h"
3333
#include "nimble/porting/nimble/include/os/queue.h"
3434

35+
#if defined(ARDUINO_ARCH_ESP32) && __has_include("esp_arduino_version.h")
36+
#include "esp_arduino_version.h"
37+
#endif
38+
39+
#if defined(ESP_ARDUINO_VERSION)
40+
#define NIMBLE_OS_MEMPOOL_USE_ROM_R_PREFIX (ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(3, 3, 11))
41+
#else
42+
#define NIMBLE_OS_MEMPOOL_USE_ROM_R_PREFIX (1)
43+
#endif
44+
3545
#ifdef __cplusplus
3646
extern "C" {
3747
#endif
@@ -170,7 +180,7 @@ typedef __uint128_t os_membuf_t;
170180
#define OS_MEMPOOL_BYTES(n,blksize) \
171181
(sizeof (os_membuf_t) * OS_MEMPOOL_SIZE((n), (blksize)))
172182

173-
#if SOC_ESP_NIMBLE_CONTROLLER && CONFIG_BT_CONTROLLER_ENABLED
183+
#if SOC_ESP_NIMBLE_CONTROLLER && CONFIG_BT_CONTROLLER_ENABLED && NIMBLE_OS_MEMPOOL_USE_ROM_R_PREFIX
174184
/**
175185
* Initialize a memory pool.
176186
*
@@ -405,6 +415,8 @@ os_error_t os_memblock_put(struct os_mempool *mp, void *block_addr);
405415
}
406416
#endif
407417

418+
#undef NIMBLE_OS_MEMPOOL_USE_ROM_R_PREFIX
419+
408420
#endif /* _OS_MEMPOOL_H_ */
409421

410422

0 commit comments

Comments
 (0)