From 2c3fe7c8d64a836ef3399dcca8ca198e80154939 Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Thu, 4 Aug 2022 13:14:37 +0530 Subject: [PATCH] Add changes to make `factory_demo` example compatible with ESP-IDF 5.x --- components/bsp/src/peripherals/bsp_i2s.c | 2 +- components/esp-rainmaker | 2 +- components/i2c_bus/CMakeLists.txt | 2 ++ components/iot_button/CMakeLists.txt | 11 ++++++++++- examples/factory_demo/CMakeLists.txt | 2 +- examples/factory_demo/main/CMakeLists.txt | 2 ++ examples/factory_demo/main/idf_component.yml | 4 ++++ 7 files changed, 21 insertions(+), 4 deletions(-) diff --git a/components/bsp/src/peripherals/bsp_i2s.c b/components/bsp/src/peripherals/bsp_i2s.c index cc2e100..be39bc2 100644 --- a/components/bsp/src/peripherals/bsp_i2s.c +++ b/components/bsp/src/peripherals/bsp_i2s.c @@ -29,7 +29,7 @@ .use_apll = false, \ .tx_desc_auto_clear = true, \ .fixed_mclk = 0, \ - .mclk_multiple = I2S_MCLK_MULTIPLE_DEFAULT, \ + .mclk_multiple = I2S_MCLK_MULTIPLE_256, \ .bits_per_chan = I2S_BITS_PER_CHAN_16BIT, \ } diff --git a/components/esp-rainmaker b/components/esp-rainmaker index 2a08ed9..bfd78d6 160000 --- a/components/esp-rainmaker +++ b/components/esp-rainmaker @@ -1 +1 @@ -Subproject commit 2a08ed9cfe7088a49293fba4c38562cb5886d862 +Subproject commit bfd78d6f675ca6082e8f0d20d2c318991b699889 diff --git a/components/i2c_bus/CMakeLists.txt b/components/i2c_bus/CMakeLists.txt index bb3433c..ab5a163 100644 --- a/components/i2c_bus/CMakeLists.txt +++ b/components/i2c_bus/CMakeLists.txt @@ -4,3 +4,5 @@ idf_component_register( INCLUDE_DIRS "include" REQUIRES driver) + +target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/components/iot_button/CMakeLists.txt b/components/iot_button/CMakeLists.txt index 3658af1..1d0ed37 100644 --- a/components/iot_button/CMakeLists.txt +++ b/components/iot_button/CMakeLists.txt @@ -1,3 +1,12 @@ +if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "5.0") + set(PRIVREQ esp_adc) +else() + set(PRIVREQ esp_adc_cal) +endif() + idf_component_register(SRCS "button_adc.c" "button_gpio.c" "iot_button.c" INCLUDE_DIRS include - PRIV_REQUIRES esp_adc_cal) + REQUIRES driver + PRIV_REQUIRES ${PRIVREQ}) + +target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/examples/factory_demo/CMakeLists.txt b/examples/factory_demo/CMakeLists.txt index 96b1663..43aaaf4 100644 --- a/examples/factory_demo/CMakeLists.txt +++ b/examples/factory_demo/CMakeLists.txt @@ -13,7 +13,7 @@ endif(DEFINED ENV{RMAKER_PATH}) set(EXTRA_COMPONENT_DIRS ../../components - $ENV{IDF_PATH}/examples/common_components/led_strip + $ENV{IDF_PATH}/examples/common_components ${RMAKER_PATH}/components ) diff --git a/examples/factory_demo/main/CMakeLists.txt b/examples/factory_demo/main/CMakeLists.txt index 913b05e..cf84c0b 100644 --- a/examples/factory_demo/main/CMakeLists.txt +++ b/examples/factory_demo/main/CMakeLists.txt @@ -14,6 +14,8 @@ idf_component_register( "app" "rmaker") +target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") + target_compile_definitions(${COMPONENT_TARGET} PRIVATE "-D RMAKER_DEMO_PROJECT_NAME=\"${CMAKE_PROJECT_NAME}\"") spiffs_create_partition_image(storage ../spiffs FLASH_IN_PROJECT) diff --git a/examples/factory_demo/main/idf_component.yml b/examples/factory_demo/main/idf_component.yml index 8675c9f..2c883a5 100644 --- a/examples/factory_demo/main/idf_component.yml +++ b/examples/factory_demo/main/idf_component.yml @@ -1,5 +1,9 @@ ## IDF Component Manager Manifest File dependencies: + espressif/led_strip: + version: "~2.0.0" + rules: + - if: "idf_version >=5.0" chmorgan/esp-libhelix-mp3: "1.0.1" chmorgan/esp-file-iterator: "1.0.0" chmorgan/esp-audio-player: "1.0.2"