Skip to content

Commit 32beb39

Browse files
authored
Merge pull request #16 from esp-arduino-libs/feat/add_plugin
Feat/add plugin
2 parents 00c7e62 + 4f2da1d commit 32beb39

21 files changed

+1076
-59
lines changed

.github/workflows/build_test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ jobs:
99
build:
1010
strategy:
1111
matrix:
12-
idf_ver: ["release-v5.1", "release-v5.2", "release-v5.3"]
13-
idf_target: ["esp32", "esp32s3"]
14-
runs-on: ubuntu-22.04
12+
idf_ver: ["release-v5.4", "release-v5.5"]
13+
idf_target: ["esp32", "esp32c3", "esp32s3", "esp32p4"]
14+
runs-on: ubuntu-latest
1515
container: espressif/idf:${{ matrix.idf_ver }}
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
- name: Build Test Application
1919
env:
2020
IDF_TARGET: ${{ matrix.idf_target }}

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# ChangeLog
22

3+
## v0.3.0 - 2025-07-24
4+
5+
### Breaking Changes:
6+
7+
* break(repo): update esp-idf version to >= 5.4
8+
* break(repo): update arduino-esp32 version to >= v3.2.0
9+
* break(repo): enable plugin registry (with `COMPILER_CXX_RTTI`) by default
10+
11+
### Enhancements:
12+
13+
* feat(more): add plugin registry
14+
15+
### Bugfixes:
16+
17+
* fix(check): rename 'err' to avoid name conflicts
18+
319
## v0.2.3 - 2025-07-03
420

521
### Enhancements:

Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,5 +226,13 @@ menu "ESP Library Utils Configurations"
226226
default ""
227227
endif # ESP_UTILS_CONF_MEM_ENABLE_CXX_GLOB_ALLOC
228228
endmenu
229+
230+
config ESP_UTILS_CONF_PLUGIN_SUPPORT
231+
bool "Plugin support"
232+
default y
233+
select COMPILER_CXX_RTTI
234+
help
235+
If enabled, the driver will enable `COMPILER_CXX_RTTI` to support plugin mechanism.
236+
229237
endif # ESP_UTILS_CONF_FILE_SKIP
230238
endmenu

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
| **Dependency** | **Version** |
4747
| ----------------------------------------------- | ----------- |
48-
| [esp-idf](https://github.com/espressif/esp-idf) | >= 5.1 |
48+
| [esp-idf](https://github.com/espressif/esp-idf) | >= 5.4 |
4949

5050
#### Adding to Project
5151

@@ -73,7 +73,7 @@ When developing with esp-idf, users can configure `esp-lib-utils` through the me
7373

7474
| **Dependency** | **Version** |
7575
| ----------------------------------------------------------- | ----------- |
76-
| [arduino-esp32](https://github.com/espressif/arduino-esp32) | >= v3.0.0 |
76+
| [arduino-esp32](https://github.com/espressif/arduino-esp32) | >= v3.2.0 |
7777

7878
#### Installing the Library
7979

esp_utils_conf.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,16 @@
131131

132132
#endif // ESP_UTILS_CONF_MEM_ENABLE_CXX_GLOB_ALLOC
133133

134+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
135+
////////////////////////////////////////////////// Plugin Configurations /////////////////////////////////////////////////
136+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
137+
/**
138+
* @brief If enabled, the driver will support plugin mechanism
139+
*
140+
* @note This configuration requires C++ RTTI support
141+
*/
142+
#define ESP_UTILS_CONF_PLUGIN_SUPPORT (0)
143+
134144
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
135145
/////////////////////////////////////////////// File Version ///////////////////////////////////////////////////////////
136146
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -142,7 +152,7 @@
142152
* 3. Patch version mismatch: No impact on functionality
143153
*/
144154
#define ESP_UTILS_CONF_FILE_VERSION_MAJOR 1
145-
#define ESP_UTILS_CONF_FILE_VERSION_MINOR 4
155+
#define ESP_UTILS_CONF_FILE_VERSION_MINOR 5
146156
#define ESP_UTILS_CONF_FILE_VERSION_PATCH 0
147157

148158
// *INDENT-ON*

idf_component.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
version: "0.2.3"
1+
version: "0.3.0"
22
description: esp-lib-utils is a library designed for ESP SoCs to provide utility functions, including logging, checking, and memory.
33
url: https://github.com/esp-arduino-libs/esp-lib-utils
44
repository: https://github.com/esp-arduino-libs/esp-lib-utils.git
55
issues: https://github.com/esp-arduino-libs/esp-lib-utils/issues
66
dependencies:
7-
idf: ">=5.1"
7+
idf: ">=5.4"

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=esp-lib-utils
2-
version=0.2.3
2+
version=0.3.0
33
author=espressif
44
maintainer=espressif
55
sentence=esp-lib-utils is a library designed for ESP SoCs to provide utility functions, including logging, checking, and memory.

src/check/esp_utils_check.h

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@
103103
* @param ... Additional arguments for the format string
104104
*/
105105
#define ESP_UTILS_CHECK_ERROR_RETURN(x, ret, fmt, ...) do { \
106-
esp_err_t err = (x); \
107-
if (unlikely(err != ESP_OK)) { \
106+
if (unlikely((x) != ESP_OK)) { \
108107
return ret; \
109108
} \
110109
} while(0)
@@ -310,9 +309,9 @@
310309
* @param ... Additional arguments for the format string
311310
*/
312311
#define ESP_UTILS_CHECK_ERROR_RETURN(x, ret, fmt, ...) do { \
313-
esp_err_t err = (x); \
314-
if (unlikely(err != ESP_OK)) { \
315-
ESP_UTILS_LOGE(fmt " [%s]", ##__VA_ARGS__, esp_err_to_name(err)); \
312+
esp_err_t _err_ = (x); \
313+
if (unlikely(_err_ != ESP_OK)) { \
314+
ESP_UTILS_LOGE(fmt " [%s]", ##__VA_ARGS__, esp_err_to_name(_err_)); \
316315
return ret; \
317316
} \
318317
} while(0)
@@ -326,9 +325,9 @@
326325
* @param ... Additional arguments for the format string
327326
*/
328327
#define ESP_UTILS_CHECK_ERROR_GOTO(x, goto_tag, fmt, ...) do { \
329-
esp_err_t err = (x); \
330-
if (unlikely((err) != ESP_OK)) { \
331-
ESP_UTILS_LOGE(fmt " [%s]", ##__VA_ARGS__, esp_err_to_name(err)); \
328+
esp_err_t _err_ = (x); \
329+
if (unlikely(_err_ != ESP_OK)) { \
330+
ESP_UTILS_LOGE(fmt " [%s]", ##__VA_ARGS__, esp_err_to_name(_err_)); \
332331
goto goto_tag; \
333332
} \
334333
} while(0)
@@ -341,9 +340,9 @@
341340
* @param ... Additional arguments for the format string
342341
*/
343342
#define ESP_UTILS_CHECK_ERROR_EXIT(x, fmt, ...) do { \
344-
esp_err_t err = (x); \
345-
if (unlikely((err) != ESP_OK)) { \
346-
ESP_UTILS_LOGE(fmt " [%s]", ##__VA_ARGS__, esp_err_to_name(err)); \
343+
esp_err_t _err_ = (x); \
344+
if (unlikely(_err_ != ESP_OK)) { \
345+
ESP_UTILS_LOGE(fmt " [%s]", ##__VA_ARGS__, esp_err_to_name(_err_)); \
347346
return; \
348347
} \
349348
} while(0)

src/esp_lib_utils.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,18 @@
2020
#include "memory/esp_utils_mem.h"
2121

2222
#if defined(__cplusplus)
23-
/* Thread */
24-
#include "thread/esp_utils_thread.hpp"
23+
2524
/* Log */
2625
#include "log/esp_utils_log.hpp"
26+
27+
/* Thread */
28+
#include "thread/esp_utils_thread.hpp"
29+
2730
/* More */
28-
#include "more/esp_utils_more.hpp"
31+
#include "more/esp_utils_value_guard.hpp"
32+
#include "more/esp_utils_function_guard.hpp"
33+
#if ESP_UTILS_CONF_PLUGIN_SUPPORT
34+
# include "more/esp_utils_plugin_registry.hpp"
35+
#endif
36+
2937
#endif // defined(__cplusplus)

src/esp_utils_conf_kconfig.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,14 @@
168168
# endif
169169
# endif
170170
#endif
171+
172+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
173+
////////////////////////////////////////////////// Plugin Configurations /////////////////////////////////////////////////
174+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
175+
#ifndef ESP_UTILS_CONF_PLUGIN_SUPPORT
176+
# ifdef CONFIG_ESP_UTILS_CONF_PLUGIN_SUPPORT
177+
# define ESP_UTILS_CONF_PLUGIN_SUPPORT CONFIG_ESP_UTILS_CONF_PLUGIN_SUPPORT
178+
# else
179+
# define ESP_UTILS_CONF_PLUGIN_SUPPORT (0)
180+
# endif
181+
#endif

0 commit comments

Comments
 (0)