diff --git a/README.md b/README.md index 0340782..4d3f9e6 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ extern const size_t frogfs_bin_len; You have the option of creating a binary without linking it with your application. A CMake function is provided to output a binary with target -`generate_${name}`. +`generate-${name}`. declare_frogfs_bin(path [CONFIG yaml] [NAME name]) @@ -91,7 +91,7 @@ idf_component_get_property(sub_args esptool_py FLASH_SUB_ARGS) esptool_py_flash_target(${FROGFS_NAME}-flash "${main_args}" "${sub_args}" ALWAYS_PLAINTEXT) esptool_py_flash_to_partition(${FROGFS_NAME}-flash storage ${BUILD_DIR}/CMakeFiles/${FROGFS_NAME}.bin) -add_dependencies(${FROGFS_NAME}-flash generate_${FROGFS_NAME}_bin) +add_dependencies(${FROGFS_NAME}-flash generate-${FROGFS_NAME}-bin) ``` You can invoke the flash process by running `idf.py frogfs-flash`. diff --git a/cmake/functions.cmake b/cmake/functions.cmake index ac2c6e6..cc8b32e 100644 --- a/cmake/functions.cmake +++ b/cmake/functions.cmake @@ -24,7 +24,7 @@ macro(generate_frogfs_rules) set(Python3_VENV_EXECUTABLE ${Python3_VENV}/Scripts/python.exe) else() set(Python3_VENV_EXECUTABLE ${Python3_VENV}/bin/python) - endif() + endif() if(NOT TARGET frogfs_venv) add_custom_target(frogfs_venv @@ -81,7 +81,7 @@ endfunction() function(declare_frogfs_bin) generate_frogfs_rules(${ARGV}) - add_custom_target(generate_${ARG_NAME}_bin + add_custom_target(generate-${ARG_NAME}-bin DEPENDS frogfs_preprocess_${ARG_NAME} ${OUTPUT}.bin ) endfunction() diff --git a/requirements.txt b/requirements.txt index a45015b..24cec9e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ pyyaml~=6.0.2 brotli~=1.1.0 +zopfli~=0.2.3 diff --git a/tools/transform-deflate.py b/tools/transform-deflate.py index 8729ebb..79e7797 100644 --- a/tools/transform-deflate.py +++ b/tools/transform-deflate.py @@ -1,5 +1,9 @@ import sys -import zlib +# Try to use zopfli first, else fallback to zlib +try: + import zopfli.zlib as zlib +except: + import zlib if __name__ == '__main__': while True: