• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15import("//build/ohos/ndk/ndk.gni")
16
17config("bt_warnings") {
18  cflags = [
19    "-Wall",
20    "-Werror",
21    "-Wno-switch",
22    "-Wno-unused-function",
23    "-Wno-unused-parameter",
24    "-Wno-unused-variable",
25    "-Wno-implicit-function-declaration",
26    "-Wno-incompatible-pointer-types",
27  ]
28}
29
30ohos_prebuilt_etc("BCM4345C5.hcd") {
31  source = "//device/board/${product_company}/${product_name}/kernel/bluetooth/BCM4345C5.hcd"
32  install_images = [ chipset_base_dir ]
33  relative_install_dir = "firmware"
34  part_name = "kaihong_products"
35  install_enable = true
36}
37
38ohos_shared_library("libbt_vendor") {
39  output_name = "libbt_vendor"
40  sources = [
41    "src/bt_vendor_brcm.c",
42    "src/conf.c",
43    "src/hardware.c",
44    "src/upio.c",
45    "src/userial_vendor.c",
46  ]
47
48  include_dirs = [
49    "include",
50    "//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
51    "//foundation/communication/bluetooth/services/bluetooth/hardware/include",
52  ]
53
54  cflags = [
55    "-DUSE_CONTROLLER_BDADDR=TRUE",
56    "-DFW_AUTO_DETECTION=TRUE",
57    "-DBT_WAKE_VIA_PROC=FALSE",
58    "-DSCO_PCM_ROUTING=0",
59    "-DSCO_PCM_IF_CLOCK_RATE=1",
60    "-DSCO_PCM_IF_FRAME_TYPE=0",
61    "-DSCO_PCM_IF_SYNC_MODE=0",
62    "-DSCO_PCM_IF_CLOCK_MODE=0",
63    "-DPCM_DATA_FMT_SHIFT_MODE=0",
64    "-DPCM_DATA_FMT_FILL_BITS=0x03",
65    "-DPCM_DATA_FMT_FILL_METHOD=0",
66    "-DPCM_DATA_FMT_FILL_NUM=0",
67    "-DPCM_DATA_FMT_JUSTIFY_MODE=0",
68  ]
69
70  configs = [ ":bt_warnings" ]
71
72  external_deps = [
73    "c_utils:utils",
74    "hilog:libhilog",
75  ]
76
77  install_enable = true
78  install_images = [ chipset_base_dir ]
79
80  part_name = "kaihong_products"
81  subsystem_name = "kaihong_products"
82}
83