From 79edd19f31af55fb13251fedb0b7aa70eaa3e6d1 Mon Sep 17 00:00:00 2001 From: xiongchangwu Date: Thu, 29 Aug 2024 11:55:33 +0800 Subject: [PATCH 1/4] add feature Signed-off-by: xiongchangwu --- adapter/BUILD.gn | 5 ++++- adapter/uhdf2/host/peripheral/BUILD.gn | 14 ++++++++------ adapter/uhdf2/uhdf.gni | 1 + bundle.json | 3 ++- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/adapter/BUILD.gn b/adapter/BUILD.gn index 72aa7c730..8dde9cd2f 100644 --- a/adapter/BUILD.gn +++ b/adapter/BUILD.gn @@ -47,9 +47,12 @@ if (defined(ohos_lite)) { "$hdf_adapter_path/uhdf2/pub_utils:libpub_utils", "$hdf_adapter_path/uhdf2/utils:libhdf_utils", "$hdf_framework_path/tools/hdf_dbg:hdf_dbg", - "$hdf_peripheral_path:hdf_peripheral.cfg", ] + if (hdf_core_default_peripheral_config) { + deps += [ "$hdf_peripheral_path:hdf_peripheral.cfg", ] + } + if (with_sample) { deps += [ "$hdf_adapter_path/uhdf2/host/test/unittest/sample1_driver:libsample1_driver", diff --git a/adapter/uhdf2/host/peripheral/BUILD.gn b/adapter/uhdf2/host/peripheral/BUILD.gn index 69cdd389b..4ba39d64e 100644 --- a/adapter/uhdf2/host/peripheral/BUILD.gn +++ b/adapter/uhdf2/host/peripheral/BUILD.gn @@ -13,10 +13,12 @@ import("//build/ohos.gni") -ohos_prebuilt_etc("hdf_peripheral.cfg") { - source = "hdf_peripheral.cfg" - relative_install_dir = "init" - install_images = [ chipset_base_dir ] - subsystem_name = "hdf" - part_name = "hdf_core" +if (hdf_core_default_peripheral_config) { + ohos_prebuilt_etc("hdf_peripheral.cfg") { + source = "hdf_peripheral.cfg" + relative_install_dir = "init" + install_images = [ chipset_base_dir ] + subsystem_name = "hdf" + part_name = "hdf_core" + } } diff --git a/adapter/uhdf2/uhdf.gni b/adapter/uhdf2/uhdf.gni index 478ee1b55..3a7b5f64e 100644 --- a/adapter/uhdf2/uhdf.gni +++ b/adapter/uhdf2/uhdf.gni @@ -20,4 +20,5 @@ declare_args() { hicollie_enabled = false } with_sample = false + hdf_core_default_peripheral_config = true } diff --git a/bundle.json b/bundle.json index 1e83bfccf..7f8a3446d 100644 --- a/bundle.json +++ b/bundle.json @@ -15,7 +15,8 @@ "features": [ "hdf_core_khdf_test_support", "hdf_core_platform_test_support", - "hdf_core_platform_rtc_test_support" + "hdf_core_platform_rtc_test_support", + "hdf_core_default_peripheral_config" ], "adapted_system_type": ["standard", "small", "mini"], "rom": "735KB", -- Gitee From 5ccd1107e6a40575dca4caddd144a4492e52ff56 Mon Sep 17 00:00:00 2001 From: xiongchangwu Date: Sat, 31 Aug 2024 09:42:03 +0800 Subject: [PATCH 2/4] add compile feature Signed-off-by: xiongchangwu --- adapter/uhdf2/host/peripheral/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/adapter/uhdf2/host/peripheral/BUILD.gn b/adapter/uhdf2/host/peripheral/BUILD.gn index 4ba39d64e..1200866a3 100644 --- a/adapter/uhdf2/host/peripheral/BUILD.gn +++ b/adapter/uhdf2/host/peripheral/BUILD.gn @@ -12,6 +12,7 @@ # limitations under the License. import("//build/ohos.gni") +import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") if (hdf_core_default_peripheral_config) { ohos_prebuilt_etc("hdf_peripheral.cfg") { -- Gitee From 64f79593b4db080bed7f0b0ce70dd524e501620f Mon Sep 17 00:00:00 2001 From: xiongchangwu Date: Mon, 2 Sep 2024 16:32:45 +0800 Subject: [PATCH 3/4] modify hdf_peripheral build Signed-off-by: xiongchangwu --- adapter/BUILD.gn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adapter/BUILD.gn b/adapter/BUILD.gn index 8dde9cd2f..9231a4ef5 100644 --- a/adapter/BUILD.gn +++ b/adapter/BUILD.gn @@ -33,7 +33,7 @@ if (defined(ohos_lite)) { } else { group("uhdf_entry") { hdf_framework_path = "./../framework" - hdf_peripheral_path = "./uhdf2/host/peripheral" + deps = [ "$hdf_adapter_path/uhdf2/hdi:libhdi", "$hdf_adapter_path/uhdf2/host:hdf_devhost", @@ -50,7 +50,7 @@ if (defined(ohos_lite)) { ] if (hdf_core_default_peripheral_config) { - deps += [ "$hdf_peripheral_path:hdf_peripheral.cfg", ] + deps += [ "./uhdf2/host/peripheral:hdf_peripheral.cfg", ] } if (with_sample) { -- Gitee From 8969687a5e745f072765e8642dbe77f2520a05f0 Mon Sep 17 00:00:00 2001 From: xiongchangwu Date: Tue, 3 Sep 2024 17:36:19 +0800 Subject: [PATCH 4/4] modify peripheral Signed-off-by: xiongchangwu --- adapter/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adapter/BUILD.gn b/adapter/BUILD.gn index 9231a4ef5..0422193e1 100644 --- a/adapter/BUILD.gn +++ b/adapter/BUILD.gn @@ -50,7 +50,7 @@ if (defined(ohos_lite)) { ] if (hdf_core_default_peripheral_config) { - deps += [ "./uhdf2/host/peripheral:hdf_peripheral.cfg", ] + deps += [ "./uhdf2/host/peripheral:hdf_peripheral.cfg" ] } if (with_sample) { -- Gitee