Skip to content

Commit a21f65c

Browse files
feat(bluetooth/controller): adjust bt/porting code structure and delete redundant code
1 parent 430d652 commit a21f65c

File tree

22 files changed

+73
-666
lines changed

22 files changed

+73
-666
lines changed

components/bt/CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ if(CONFIG_BT_ENABLED)
575575
if(CONFIG_BT_LE_CONTROLLER_NPL_OS_PORTING_SUPPORT)
576576
list(APPEND srcs
577577
"porting/npl/freertos/src/npl_os_freertos.c"
578-
"porting/nimble/src/os_msys_init.c"
578+
"porting/mem/os_msys_init.c"
579579
)
580580

581581
if(CONFIG_BT_CONTROLLER_DISABLED)
@@ -585,7 +585,6 @@ if(CONFIG_BT_ENABLED)
585585
endif()
586586
list(APPEND include_dirs
587587
porting/include
588-
porting/nimble/include
589588
porting/npl/freertos/include
590589
porting/transport/include
591590
)
@@ -727,7 +726,6 @@ if(CONFIG_BT_ENABLED)
727726
"host/nimble/port/src/nvs_port.c"
728727
)
729728
list(APPEND include_dirs
730-
porting/include
731729
host/nimble/nimble/porting/nimble/include
732730
host/nimble/port/include
733731
host/nimble/nimble/nimble/transport/include
@@ -756,9 +754,8 @@ if(CONFIG_BT_ENABLED)
756754
endif()
757755

758756
list(APPEND include_dirs
757+
porting/include
759758
host/nimble/nimble/porting/npl/freertos/include
760-
host/nimble/nimble/porting/nimble/include
761-
host/nimble/nimble/nimble/include
762759
)
763760
endif()
764761

components/bt/controller/esp32c2/bt.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616

1717
#include "sdkconfig.h"
1818

19+
#if CONFIG_BT_NIMBLE_ENABLED
1920
#include "nimble/nimble_port.h"
21+
#endif // CONFIG_BT_NIMBLE_ENABLED
22+
2023
#include "nimble/nimble_port_freertos.h"
2124

2225
#ifdef ESP_PLATFORM
@@ -28,7 +31,7 @@
2831
#endif
2932

3033
#include "nimble/nimble_npl_os.h"
31-
#include "nimble/ble_hci_trans.h"
34+
#include "ble_hci_trans.h"
3235
#include "os/endian.h"
3336

3437
#include "esp_bt.h"

components/bt/controller/esp32c5/bt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
#include "sdkconfig.h"
1717

18+
#if CONFIG_BT_NIMBLE_ENABLED
1819
#include "nimble/nimble_port.h"
20+
#endif // CONFIG_BT_NIMBLE_ENABLED
1921
#include "nimble/nimble_port_freertos.h"
2022
#include "esp_private/esp_modem_clock.h"
2123

@@ -28,7 +30,7 @@
2830
#endif // CONFIG_SW_COEXIST_ENABLE
2931

3032
#include "nimble/nimble_npl_os.h"
31-
#include "nimble/ble_hci_trans.h"
33+
#include "ble_hci_trans.h"
3234
#include "os/endian.h"
3335

3436
#include "esp_bt.h"

components/bt/controller/esp32c6/bt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
#include "sdkconfig.h"
1717

18+
#if CONFIG_BT_NIMBLE_ENABLED
1819
#include "nimble/nimble_port.h"
20+
#endif // CONFIG_BT_NIMBLE_ENABLED
1921
#include "nimble/nimble_port_freertos.h"
2022
#include "esp_private/esp_modem_clock.h"
2123

@@ -28,7 +30,7 @@
2830
#endif // CONFIG_ESP_COEX_ENABLED
2931

3032
#include "nimble/nimble_npl_os.h"
31-
#include "nimble/ble_hci_trans.h"
33+
#include "ble_hci_trans.h"
3234
#include "os/endian.h"
3335

3436
#include "esp_bt.h"

components/bt/controller/esp32h2/bt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
#include "sdkconfig.h"
1717

18+
#if CONFIG_BT_NIMBLE_ENABLED
1819
#include "nimble/nimble_port.h"
20+
#endif // CONFIG_BT_NIMBLE_ENABLED
1921
#include "nimble/nimble_port_freertos.h"
2022
#include "esp_private/esp_modem_clock.h"
2123

@@ -28,7 +30,7 @@
2830
#endif // CONFIG_ESP_COEX_ENABLED
2931

3032
#include "nimble/nimble_npl_os.h"
31-
#include "nimble/ble_hci_trans.h"
33+
#include "ble_hci_trans.h"
3234
#include "os/endian.h"
3335

3436
#include "esp_bt.h"

components/bt/host/bluedroid/hci/hci_hal_h4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include "stack/hcimsgs.h"
3737

3838
#if ((BT_CONTROLLER_INCLUDED == TRUE) && SOC_ESP_NIMBLE_CONTROLLER)
39-
#include "nimble/ble_hci_trans.h"
39+
#include "ble_hci_trans.h"
4040
#endif
4141

4242
#if (C2H_FLOW_CONTROL_INCLUDED == TRUE)

components/bt/porting/nimble/include/nimble/ble_hci_trans.h renamed to components/bt/porting/include/ble_hci_trans.h

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,7 @@
11
/*
2-
* Licensed to the Apache Software Foundation (ASF) under one
3-
* or more contributor license agreements. See the NOTICE file
4-
* distributed with this work for additional information
5-
* regarding copyright ownership. The ASF licenses this file
6-
* to you under the Apache License, Version 2.0 (the
7-
* "License"); you may not use this file except in compliance
8-
* with the License. You may obtain a copy of the License at
9-
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
11-
*
12-
* Unless required by applicable law or agreed to in writing,
13-
* software distributed under the License is distributed on an
14-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15-
* KIND, either express or implied. See the License for the
16-
* specific language governing permissions and limitations
17-
* under the License.
2+
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
185
*/
196

207
#ifndef H_HCI_TRANSPORT_
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)