]> granicus.if.org Git - esp-idf/commitdiff
example: update ulp example to use cmake function
authorRenz Christian Bagaporo <renz@espressif.com>
Mon, 4 Feb 2019 07:07:10 +0000 (15:07 +0800)
committerRenz Christian Bagaporo <renz@espressif.com>
Tue, 21 May 2019 12:00:06 +0000 (20:00 +0800)
examples/system/ulp/main/CMakeLists.txt
examples/system/ulp_adc/main/CMakeLists.txt

index 7b39598ce460e831e4f368b5bb662c0642dfd4fe..d426857dc67c1b0a14f7366db037e078e96e6780 100644 (file)
@@ -6,22 +6,20 @@ set(COMPONENT_REQUIRES soc nvs_flash ulp)
 register_component()
 
 #
-# ULP support additions to component makefile.
+# ULP support additions to component CMakeLists.txt.
 #
-# 1. ULP_APP_NAME must be unique (if multiple components use ULP)
-#    Default value, override if necessary:
-set(ULP_APP_NAME ulp_${COMPONENT_NAME})
+# 1. The ULP app name must be unique (if multiple components use ULP).
+set(ulp_app_name ulp_${COMPONENT_NAME})
 #
-# 2. Specify all assembly source files here.
+# 2. Specify all assembly source files.
 #    Files should be placed into a separate directory (in this case, ulp/),
 #    which should not be added to COMPONENT_SRCS.
-set(ULP_S_SOURCES "ulp/pulse_cnt.S")
+set(ulp_s_sources "ulp/pulse_cnt.S")
 #
 # 3. List all the component source files which include automatically
-#    generated ULP export file, $(ULP_APP_NAME).h:
-set(ULP_EXP_DEP_SRCS "ulp_example_main.c")
+#    generated ULP export file, ${ulp_app_name}.h:
+set(ulp_exp_dep_srcs "ulp_example_main.c")
 #
-# 4. Include build rules for ULP program
-# End of ULP support additions to component makefile.
-#
-include(${IDF_PATH}/components/ulp/component_ulp_common.cmake)
+# 4. Call function to build ULP binary and embed in project using the argument
+#    values above.
+ulp_embed_binary(${ulp_app_name} ${ulp_s_sources} ${ulp_exp_dep_srcs})
index 9c7f456d27cb202b309797a42d0de11a5126e0c6..5f647631791fdbe3ce6a68ef34b94dce3042f420 100644 (file)
@@ -6,22 +6,20 @@ set(COMPONENT_REQUIRES soc nvs_flash ulp driver)
 register_component()
 
 #
-# ULP support additions to component makefile.
+# ULP support additions to component CMakeLists.txt.
 #
-# 1. ULP_APP_NAME must be unique (if multiple components use ULP)
-#    Default value, override if necessary:
-set(ULP_APP_NAME ulp_${COMPONENT_NAME})
+# 1. The ULP app name must be unique (if multiple components use ULP).
+set(ulp_app_name ulp_${COMPONENT_NAME})
 #
-# 2. Specify all assembly source files here.
+# 2. Specify all assembly source files.
 #    Files should be placed into a separate directory (in this case, ulp/),
 #    which should not be added to COMPONENT_SRCS.
-set(ULP_S_SOURCES "ulp/adc.S")
+set(ulp_s_sources "ulp/adc.S")
 #
 # 3. List all the component source files which include automatically
-#    generated ULP export file, $(ULP_APP_NAME).h:
-set(ULP_EXP_DEP_SRCS "ulp_adc_example_main.c")
+#    generated ULP export file, ${ulp_app_name}.h:
+set(ulp_exp_dep_srcs "ulp_adc_example_main.c")
 #
-# 4. Include build rules for ULP program
-# End of ULP support additions to component makefile.
-#
-include(${IDF_PATH}/components/ulp/component_ulp_common.cmake)
+# 4. Call function to build ULP binary and embed in project using the argument
+#    values above.
+ulp_embed_binary(${ulp_app_name} ${ulp_s_sources} ${ulp_exp_dep_srcs})
\ No newline at end of file