Skip to content

Commit 758b33d

Browse files
committed
feat(repo): update conf file
1 parent 0066f7c commit 758b33d

15 files changed

+294
-294
lines changed

CHANGELOG.md

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

3+
## v0.1.1
4+
5+
### Enhancements:
6+
7+
* feat(repo): update config header and Kconfig file s
8+
39
## v0.1.0
410

511
### Enhancements:

Kconfig

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,32 @@ menu "ESP Library Utils Configurations"
55

66
menu "Check functions"
77
depends on ESP_UTILS_CONF_FILE_SKIP
8-
config ESP_UTILS_CONF_ENABLE_CHECK
9-
bool "Enable check functions"
10-
default y
11-
help
12-
If enabled, the driver will check the function parameters, return value, etc. Disable them will reduce the code size.
8+
choice ESP_UTILS_CONF_CHECK_HANDLE_METHOD
9+
prompt "Select handle method when check failed"
10+
default ESP_UTILS_CHECK_HANDLE_WITH_ERROR_LOG
1311

14-
config ESP_UTILS_CONF_CHECK_WITH_ERROR_LOG
15-
bool "Print log messages on error"
16-
default y
17-
depends on ESP_UTILS_CONF_ENABLE_CHECK
18-
help
19-
If enabled, the driver will print error message when check failed.
12+
config ESP_UTILS_CHECK_HANDLE_WITH_NONE
13+
bool "Do nothing"
2014

21-
config ESP_UTILS_CONF_CHECK_WITH_ASSERT
22-
bool "Assert on error"
23-
default n
24-
depends on ESP_UTILS_CONF_ENABLE_CHECK
25-
help
26-
If enabled, the driver will assert when check failed.
15+
config ESP_UTILS_CHECK_HANDLE_WITH_ERROR_LOG
16+
bool "Print error message"
17+
18+
config ESP_UTILS_CHECK_HANDLE_WITH_ASSERT
19+
bool "Assert"
20+
endchoice
21+
22+
config ESP_UTILS_CONF_CHECK_HANDLE_METHOD
23+
int
24+
default 0 if ESP_UTILS_CHECK_HANDLE_WITH_NONE
25+
default 1 if ESP_UTILS_CHECK_HANDLE_WITH_ERROR_LOG
26+
default 2 if ESP_UTILS_CHECK_HANDLE_WITH_ASSERT
2727
endmenu
2828

2929
menu "Log functions"
3030
depends on ESP_UTILS_CONF_FILE_SKIP
31-
config ESP_UTILS_CONF_ENABLE_LOG
32-
bool "Enable log functions"
33-
default y
34-
help
35-
If enabled, the driver will output log for debugging.
36-
37-
config ESP_UTILS_CONF_LOG_BUFFER_SIZE
38-
int "Buffer size for formatting messages"
39-
depends on ESP_UTILS_CONF_ENABLE_LOG
40-
default 256
4131

4232
choice ESP_UTILS_CONF_LOG_LEVEL
4333
prompt "Select global log level"
44-
depends on ESP_UTILS_CONF_ENABLE_LOG
4534
default ESP_UTILS_CONF_LOG_LEVEL_INFO
4635

4736
config ESP_UTILS_CONF_LOG_LEVEL_DEBUG
@@ -63,6 +52,11 @@ menu "ESP Library Utils Configurations"
6352
bool "Error"
6453
help
6554
Critical errors, software module cannot recover on its own
55+
56+
config ESP_UTILS_CONF_LOG_LEVEL_NONE
57+
bool "None"
58+
help
59+
No log output
6660
endchoice
6761

6862
config ESP_UTILS_CONF_LOG_LEVEL
@@ -71,13 +65,18 @@ menu "ESP Library Utils Configurations"
7165
default 1 if ESP_UTILS_CONF_LOG_LEVEL_INFO
7266
default 2 if ESP_UTILS_CONF_LOG_LEVEL_WARNING
7367
default 3 if ESP_UTILS_CONF_LOG_LEVEL_ERROR
68+
default 4 if ESP_UTILS_CONF_LOG_LEVEL_NONE
7469

7570
config ESP_UTILS_CONF_ENABLE_LOG_TRACE
7671
bool "Enable trace function"
7772
depends on ESP_UTILS_CONF_LOG_LEVEL_DEBUG
7873
default n
7974
help
8075
If enabled, the driver will print trace log messages when enter/exit functions, useful for debugging
76+
77+
config ESP_UTILS_CONF_LOG_BUFFER_SIZE
78+
int "Buffer size for formatting messages"
79+
default 256
8180
endmenu
8281

8382
menu "Memory functions"

README.md

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,17 @@ Since `esp-lib-utils` configures its functionality through the *esp_utils_conf.h
104104

105105
```c
106106
...
107-
/* Set to 1 if use `ESP_UTILS_LOG*()` macros */
108-
#define ESP_UTILS_CONF_ENABLE_LOG (1) // 0/1
109-
#if ESP_UTILS_CONF_ENABLE_LOG
110-
/**
111-
* Global log level, logs with a level lower than this will not be compiled. Choose one of the following:
112-
* - ESP_UTILS_LOG_LEVEL_DEBUG: Extra information which is not necessary for normal use (values, pointers, sizes, etc)
113-
* (lowest level)
114-
* - ESP_UTILS_LOG_LEVEL_INFO: Information messages which describe the normal flow of events
115-
* - ESP_UTILS_LOG_LEVEL_WARNING: Error conditions from which recovery measures have been taken
116-
* - ESP_UTILS_LOG_LEVEL_ERROR: Critical errors, software module cannot recover on its own (highest level)
117-
*
118-
*/
119-
#define ESP_UTILS_CONF_LOG_LEVEL (ESP_UTILS_LOG_LEVEL_DEBUG)
120-
...
121-
#endif // ESP_UTILS_CONF_ENABLE_LOG
107+
/**
108+
* Global log level, logs with a level lower than this will not be compiled. Choose one of the following:
109+
* - ESP_UTILS_LOG_LEVEL_DEBUG: Extra information which is not necessary for normal use (values, pointers, sizes, etc)
110+
* (lowest level)
111+
* - ESP_UTILS_LOG_LEVEL_INFO: Information messages which describe the normal flow of events
112+
* - ESP_UTILS_LOG_LEVEL_WARNING: Error conditions from which recovery measures have been taken
113+
* - ESP_UTILS_LOG_LEVEL_ERROR: Critical errors, software module cannot recover on its own
114+
* - ESP_UTILS_LOG_LEVEL_NONE: No log output (highest level) (Minimum code size)
115+
*
116+
*/
117+
#define ESP_UTILS_CONF_LOG_LEVEL (ESP_UTILS_LOG_LEVEL_DEBUG)
122118
...
123119
```
124120

@@ -166,10 +162,10 @@ bool test_check_false_goto(void)
166162
ESP_UTILS_CHECK_FALSE_GOTO(true, err, "Check false goto failed");
167163
ESP_UTILS_CHECK_FALSE_GOTO(false, end, "Check false goto success");
168164
169-
ESP_UTILS_CHECK_TAG(err)
165+
err:
170166
return false;
171167
172-
ESP_UTILS_CHECK_TAG(end)
168+
end:
173169
return true;
174170
}
175171
@@ -191,10 +187,10 @@ bool test_check_error_goto(void)
191187
ESP_UTILS_CHECK_ERROR_GOTO(ESP_OK, err, "Check error goto failed");
192188
ESP_UTILS_CHECK_ERROR_GOTO(ESP_FAIL, end, "Check error goto success");
193189
194-
ESP_UTILS_CHECK_TAG(err)
190+
err:
195191
return false;
196192
197-
ESP_UTILS_CHECK_TAG(end)
193+
end:
198194
return true;
199195
}
200196
@@ -216,10 +212,10 @@ static bool test_check_null_goto(void)
216212
ESP_UTILS_CHECK_NULL_GOTO((void *)1, err, "Check null goto failed");
217213
ESP_UTILS_CHECK_NULL_GOTO(NULL, end, "Check null goto success");
218214
219-
ESP_UTILS_CHECK_TAG(err)
215+
err:
220216
return false;
221217
222-
ESP_UTILS_CHECK_TAG(end)
218+
end:
223219
return true;
224220
}
225221

esp_utils_conf.h

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,49 +12,37 @@
1212
///////////////////////////////////////////////// Check Configurations /////////////////////////////////////////////////
1313
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1414
/**
15-
* These functions are used to check the function parameters, return value, etc. Disable them will reduce the code size.
15+
* Check handle method, choose one of the following:
16+
* - ESP_UTILS_CHECK_HANDLE_WITH_NONE: Do nothing when check failed (Minimum code size)
17+
* - ESP_UTILS_CHECK_HANDLE_WITH_ERROR_LOG: Print error message when check failed (Recommended)
18+
* - ESP_UTILS_CHECK_HANDLE_WITH_ASSERT: Assert when check failed
1619
*
1720
*/
18-
/* Set to 1 if use `ESP_UTILS_CHECK_*()` macros */
19-
#define ESP_UTILS_CONF_ENABLE_CHECK (1) // 0/1
20-
#if ESP_UTILS_CONF_ENABLE_CHECK
21-
/* Set to 1 if print message when check failed */
22-
#define ESP_UTILS_CONF_CHECK_WITH_ERROR_LOG (1) // 0/1
23-
24-
/* Set to 1 if assert when check failed */
25-
#define ESP_UTILS_CONF_CHECK_WITH_ASSERT (0) // 0/1
26-
#endif // ESP_UTILS_CONF_ENABLE_CHECK
21+
#define ESP_UTILS_CONF_CHECK_HANDLE_METHOD (ESP_UTILS_CHECK_HANDLE_WITH_ERROR_LOG)
2722

2823
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2924
////////////////////////////////////////////////// Log Configurations //////////////////////////////////////////////////
3025
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
3126
/**
32-
* These functions are used to print log messages. Disable them will reduce the code size.
27+
* Global log level, logs with a level lower than this will not be compiled. Choose one of the following:
28+
* - ESP_UTILS_LOG_LEVEL_DEBUG: Extra information which is not necessary for normal use (values, pointers, sizes, etc)
29+
* (lowest level)
30+
* - ESP_UTILS_LOG_LEVEL_INFO: Information messages which describe the normal flow of events
31+
* - ESP_UTILS_LOG_LEVEL_WARNING: Error conditions from which recovery measures have been taken
32+
* - ESP_UTILS_LOG_LEVEL_ERROR: Critical errors, software module cannot recover on its own
33+
* - ESP_UTILS_LOG_LEVEL_NONE: No log output (highest level) (Minimum code size)
3334
*
3435
*/
35-
/* Set to 1 if use `ESP_UTILS_LOG*()` macros */
36-
#define ESP_UTILS_CONF_ENABLE_LOG (1) // 0/1
37-
#if ESP_UTILS_CONF_ENABLE_LOG
38-
/**
39-
* Global log level, logs with a level lower than this will not be compiled. Choose one of the following:
40-
* - ESP_UTILS_LOG_LEVEL_DEBUG: Extra information which is not necessary for normal use (values, pointers, sizes, etc)
41-
* (lowest level)
42-
* - ESP_UTILS_LOG_LEVEL_INFO: Information messages which describe the normal flow of events
43-
* - ESP_UTILS_LOG_LEVEL_WARNING: Error conditions from which recovery measures have been taken
44-
* - ESP_UTILS_LOG_LEVEL_ERROR: Critical errors, software module cannot recover on its own (highest level)
45-
*
46-
*/
47-
#define ESP_UTILS_CONF_LOG_LEVEL (ESP_UTILS_LOG_LEVEL_INFO)
48-
#if ESP_UTILS_CONF_LOG_LEVEL == ESP_UTILS_LOG_LEVEL_DEBUG
36+
#define ESP_UTILS_CONF_LOG_LEVEL (ESP_UTILS_LOG_LEVEL_INFO)
37+
#if ESP_UTILS_CONF_LOG_LEVEL == ESP_UTILS_LOG_LEVEL_DEBUG
4938

50-
/* Set to 1 if print trace log messages when enter/exit functions, useful for debugging */
51-
#define ESP_UTILS_CONF_ENABLE_LOG_TRACE (0)
39+
/* Set to 1 if print trace log messages when enter/exit functions, useful for debugging */
40+
#define ESP_UTILS_CONF_ENABLE_LOG_TRACE (0)
5241

53-
#endif // ESP_UTILS_CONF_LOG_LEVEL
42+
#endif // ESP_UTILS_CONF_LOG_LEVEL
5443

55-
/* Log format buffer size */
56-
#define ESP_UTILS_CONF_LOG_BUFFER_SIZE (256)
57-
#endif // ESP_UTILS_CONF_ENABLE_LOG
44+
/* Log format buffer size */
45+
#define ESP_UTILS_CONF_LOG_BUFFER_SIZE (256)
5846

5947
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
6048
//////////////////////////////////////////////// Memory Configurations /////////////////////////////////////////////////
@@ -96,8 +84,8 @@
9684
* 3. Even if the patch version is not consistent, it will not affect normal functionality.
9785
*
9886
*/
99-
#define ESP_UTILS_CONF_FILE_VERSION_MAJOR 0
100-
#define ESP_UTILS_CONF_FILE_VERSION_MINOR 1
87+
#define ESP_UTILS_CONF_FILE_VERSION_MAJOR 1
88+
#define ESP_UTILS_CONF_FILE_VERSION_MINOR 0
10189
#define ESP_UTILS_CONF_FILE_VERSION_PATCH 0
10290

10391
// *INDENT-OFF*

idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "0.1.0"
1+
version: "0.1.1"
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

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.1.0
2+
version=0.1.1
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.

0 commit comments

Comments
 (0)