Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(repo): support MicroPython #4

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
[codespell]
skip = ./src/touch/port/esp_lcd_touch_xpt2046.c
6 changes: 5 additions & 1 deletion .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
build:
strategy:
matrix:
idf_ver: ["release-v5.1", "release-v5.2", "release-v5.3"]
idf_ver: ["release-v5.1", "release-v5.2", "release-v5.3"]
idf_target: ["esp32", "esp32s3"]
runs-on: ubuntu-20.04
container: espressif/idf:${{ matrix.idf_ver }}
Expand All @@ -28,3 +28,7 @@ jobs:
idf.py build
rm -rf sdkconfig build managed_components dependencies.lock
idf.py -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.ci.cxx_exceptions" build
rm -rf sdkconfig build managed_components dependencies.lock
idf.py -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.ci.cxx_exceptions;sdkconfig.ci.esp_mem" build
rm -rf sdkconfig build managed_components dependencies.lock
idf.py -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.ci.cxx_exceptions;sdkconfig.ci.custom_mem" build
99 changes: 54 additions & 45 deletions Kconfig
Original file line number Diff line number Diff line change
@@ -1,111 +1,120 @@
menu "ESP Library Utils"
config ESP_UTILS_CONFIG_FILE_SKIP
bool "Unckeck this to ignore `esp_utils_config.h`"
menu "ESP Library Utils Configurations"
config ESP_UTILS_CONF_FILE_SKIP
bool "Unckeck this to use custom `esp_utils_conf.h`"
default y

menu "Check functions"
config ESP_UTILS_ENABLE_CHECK
bool "Enable error check"
depends on ESP_UTILS_CONF_FILE_SKIP
config ESP_UTILS_CONF_ENABLE_CHECK
bool "Enable check functions"
default y
help
If enabled, the driver will check the function parameters, return value, etc. Disable them will reduce the code size.

config ESP_UTILS_CHECK_WITH_ERROR_LOG
bool "Print error message on error"
config ESP_UTILS_CONF_CHECK_WITH_ERROR_LOG
bool "Print log messages on error"
default y
depends on ESP_UTILS_ENABLE_CHECK
depends on ESP_UTILS_CONF_ENABLE_CHECK
help
If enabled, the driver will print error message when check failed.

config ESP_UTILS_CHECK_WITH_ASSERT
config ESP_UTILS_CONF_CHECK_WITH_ASSERT
bool "Assert on error"
default n
depends on ESP_UTILS_ENABLE_CHECK
depends on ESP_UTILS_CONF_ENABLE_CHECK
help
If enabled, the driver will assert when check failed.
endmenu

menu "Log functions"
config ESP_UTILS_ENABLE_LOG
bool "Enable output debug log"
depends on ESP_UTILS_CONF_FILE_SKIP
config ESP_UTILS_CONF_ENABLE_LOG
bool "Enable log functions"
default y
help
If enabled, the driver will output log for debugging.

config ESP_UTILS_LOG_BUFFER_SIZE
int "Buffer size for log messages"
depends on ESP_UTILS_ENABLE_LOG
config ESP_UTILS_CONF_LOG_BUFFER_SIZE
int "Buffer size for formatting messages"
depends on ESP_UTILS_CONF_ENABLE_LOG
default 256

choice ESP_UTILS_LOG_LEVEL
prompt "Log level for all messages"
depends on ESP_UTILS_ENABLE_LOG
default ESP_UTILS_LOG_LEVEL_INFO
choice ESP_UTILS_CONF_LOG_LEVEL
prompt "Select global log level"
depends on ESP_UTILS_CONF_ENABLE_LOG
default ESP_UTILS_CONF_LOG_LEVEL_INFO

config ESP_UTILS_LOG_LEVEL_DEBUG
config ESP_UTILS_CONF_LOG_LEVEL_DEBUG
bool "Debug"
help
Extra information which is not necessary for normal use (values, pointers, sizes, etc)

config ESP_UTILS_LOG_LEVEL_INFO
config ESP_UTILS_CONF_LOG_LEVEL_INFO
bool "Info"
help
Information messages which describe the normal flow of events

config ESP_UTILS_LOG_LEVEL_WARNING
config ESP_UTILS_CONF_LOG_LEVEL_WARNING
bool "Warning"
help
Error conditions from which recovery measures have been taken

config ESP_UTILS_LOG_LEVEL_ERROR
config ESP_UTILS_CONF_LOG_LEVEL_ERROR
bool "Error"
help
Critical errors, software module cannot recover on its own
endchoice

config ESP_UTILS_LOG_GLOBAL_LEVEL
config ESP_UTILS_CONF_LOG_LEVEL
int
default 0 if ESP_UTILS_LOG_LEVEL_DEBUG
default 1 if ESP_UTILS_LOG_LEVEL_INFO
default 2 if ESP_UTILS_LOG_LEVEL_WARNING
default 3 if ESP_UTILS_LOG_LEVEL_ERROR
default 0 if ESP_UTILS_CONF_LOG_LEVEL_DEBUG
default 1 if ESP_UTILS_CONF_LOG_LEVEL_INFO
default 2 if ESP_UTILS_CONF_LOG_LEVEL_WARNING
default 3 if ESP_UTILS_CONF_LOG_LEVEL_ERROR

config ESP_UTILS_ENABLE_LOG_TRACE
config ESP_UTILS_CONF_ENABLE_LOG_TRACE
bool "Enable trace function"
depends on ESP_UTILS_LOG_LEVEL_DEBUG
depends on ESP_UTILS_CONF_LOG_LEVEL_DEBUG
default n
help
If enabled, the driver will print trace log messages when enter/exit functions, useful for debugging
endmenu

menu "Memory functions"
choice ESP_UTILS_MEM_GENERAL_ALLOC_TYPE_CHOICE
depends on ESP_UTILS_CONF_FILE_SKIP
choice ESP_UTILS_CONF_MEM_GEN_ALLOC_TYPE_CHOICE
prompt "Select general allocation type"
default ESP_UTILS_MEM_GENERAL_ALLOC_TYPE_STDLIB
default ESP_UTILS_CONF_MEM_GEN_ALLOC_TYPE_STDLIB

config ESP_UTILS_MEM_GENERAL_ALLOC_TYPE_STDLIB
config ESP_UTILS_CONF_MEM_GEN_ALLOC_TYPE_STDLIB
bool "Standard library (malloc, free)"

config ESP_UTILS_MEM_GENERAL_ALLOC_TYPE_ESP
config ESP_UTILS_CONF_MEM_GEN_ALLOC_TYPE_ESP
bool "ESP (heap_caps_malloc, free)"

config ESP_UTILS_MEM_GENERAL_ALLOC_TYPE_MICROPYTHON
config ESP_UTILS_CONF_MEM_GEN_ALLOC_TYPE_MICROPYTHON
bool "MicroPython (mp_malloc, mp_free)"

config ESP_UTILS_MEM_GENERAL_ALLOC_TYPE_CUSTOM
bool "Custom (`ESP_UTILS_MEM_GENERAL_ALLOC_CUSTOM_MALLOC` and `ESP_UTILS_MEM_GENERAL_ALLOC_CUSTOM_FREE`)"
config ESP_UTILS_CONF_MEM_GEN_ALLOC_TYPE_CUSTOM
bool "Custom (`ESP_UTILS_CONF_MEM_GEN_ALLOC_CUSTOM_MALLOC` and `ESP_UTILS_CONF_MEM_GEN_ALLOC_CUSTOM_FREE`)"
endchoice

config ESP_UTILS_MEM_GENERAL_ALLOC_TYPE
config ESP_UTILS_CONF_MEM_GEN_ALLOC_TYPE
int
default 0 if ESP_UTILS_MEM_GENERAL_ALLOC_TYPE_STDLIB
default 1 if ESP_UTILS_MEM_GENERAL_ALLOC_TYPE_ESP
default 2 if ESP_UTILS_MEM_GENERAL_ALLOC_TYPE_MICROPYTHON
default 3 if ESP_UTILS_MEM_GENERAL_ALLOC_TYPE_CUSTOM

config ESP_UTILS_MEM_GENERAL_ALLOC_CUSTOM_INCLUDE
default 0 if ESP_UTILS_CONF_MEM_GEN_ALLOC_TYPE_STDLIB
default 1 if ESP_UTILS_CONF_MEM_GEN_ALLOC_TYPE_ESP
default 2 if ESP_UTILS_CONF_MEM_GEN_ALLOC_TYPE_MICROPYTHON
default 3 if ESP_UTILS_CONF_MEM_GEN_ALLOC_TYPE_CUSTOM

config ESP_UTILS_CONF_MEM_GEN_ALLOC_ESP_ALIGN
int "General esp memory alignment (bytes)"
depends on ESP_UTILS_CONF_MEM_GEN_ALLOC_TYPE_ESP
default 1
range 1 1024

config ESP_UTILS_CONF_MEM_GEN_ALLOC_CUSTOM_INCLUDE
string "General custom memory header file"
depends on ESP_UTILS_MEM_GENERAL_ALLOC_TYPE_CUSTOM
depends on ESP_UTILS_CONF_MEM_GEN_ALLOC_TYPE_CUSTOM
default "stdlib.h"
endmenu
endmenu
Loading
Loading