mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-10 19:20:01 +00:00
Revert "MYNEWT-512 Replace gen. sysinit with linker sect"
This reverts commit 43a5ef8860cbf4bc5bf43fde8a29fe74361536fa. X-Original-Commit: c870a0fe51e8e2ecc0e42a952799272bb45ef825
This commit is contained in:
@@ -288,6 +288,9 @@ struct ble_dev_addr
|
||||
#define BLE_CONNECT_REQ_PDU_LEN (BLE_CONNECT_REQ_LEN + BLE_LL_PDU_HDR_LEN)
|
||||
|
||||
/*--- External API ---*/
|
||||
/* Initialize the Link Layer */
|
||||
void ble_ll_init(void);
|
||||
|
||||
/* Reset the Link Layer */
|
||||
int ble_ll_reset(void);
|
||||
|
||||
|
||||
@@ -33,3 +33,6 @@ pkg.deps:
|
||||
- kernel/os
|
||||
- sys/stats
|
||||
- net/nimble
|
||||
|
||||
pkg.init_function: ble_ll_init
|
||||
pkg.init_stage: 2
|
||||
|
||||
@@ -1211,7 +1211,7 @@ ble_ll_seed_prng(void)
|
||||
* @return int
|
||||
*/
|
||||
void
|
||||
ble_ll_init(struct sysinit_init_ctxt *ctxt)
|
||||
ble_ll_init(void)
|
||||
{
|
||||
int rc;
|
||||
uint8_t features;
|
||||
@@ -1323,8 +1323,6 @@ ble_ll_init(struct sysinit_init_ctxt *ctxt)
|
||||
ble_hci_trans_cfg_ll(ble_ll_hci_cmd_rx, NULL, ble_ll_hci_acl_rx, NULL);
|
||||
}
|
||||
|
||||
SYSINIT_REGISTER_INIT(ble_ll_init, 2);
|
||||
|
||||
#ifdef BLE_LL_LOG
|
||||
void
|
||||
ble_ll_log_dump_index(int i)
|
||||
|
||||
@@ -153,6 +153,7 @@ extern struct ble_hs_cfg ble_hs_cfg;
|
||||
int ble_hs_synced(void);
|
||||
int ble_hs_start(void);
|
||||
void ble_hs_evq_set(struct os_eventq *evq);
|
||||
void ble_hs_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -41,3 +41,6 @@ pkg.deps.BLE_SM_SC:
|
||||
pkg.req_apis:
|
||||
- ble_transport
|
||||
- console
|
||||
|
||||
pkg.init_function: "ble_hs_init"
|
||||
pkg.init_stage: 2
|
||||
|
||||
@@ -79,5 +79,7 @@ int ble_svc_ans_new_alert_add(uint8_t cat_id,
|
||||
const char * info_str);
|
||||
int ble_svc_ans_unr_alert_add(uint8_t cat_id);
|
||||
|
||||
void ble_svc_ans_init(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -29,3 +29,6 @@ pkg.keywords:
|
||||
|
||||
pkg.deps:
|
||||
- net/nimble/host
|
||||
|
||||
pkg.init_function: ble_svc_ans_init
|
||||
pkg.init_stage: 3
|
||||
|
||||
@@ -441,7 +441,7 @@ ble_svc_ans_chr_write(struct os_mbuf *om, uint16_t min_len,
|
||||
* @return 0 on success, non-zero error code otherwise.
|
||||
*/
|
||||
void
|
||||
ble_svc_ans_init(struct sysinit_init_ctxt *ctxt)
|
||||
ble_svc_ans_init(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -457,5 +457,3 @@ ble_svc_ans_init(struct sysinit_init_ctxt *ctxt)
|
||||
ble_svc_ans_new_alert_cat = MYNEWT_VAL(BLE_SVC_ANS_NEW_ALERT_CAT);
|
||||
ble_svc_ans_unr_alert_cat = MYNEWT_VAL(BLE_SVC_ANS_UNR_ALERT_CAT);
|
||||
}
|
||||
|
||||
SYSINIT_REGISTER_INIT(ble_svc_ans_init, 3);
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void
|
||||
bleuart_init(void);
|
||||
int
|
||||
bleuart_svc_register(void);
|
||||
int
|
||||
|
||||
@@ -32,3 +32,6 @@ pkg.deps:
|
||||
|
||||
pkg.req_apis:
|
||||
- console
|
||||
|
||||
pkg.init_function: bleuart_init
|
||||
pkg.init_stage: 5
|
||||
|
||||
@@ -189,7 +189,7 @@ bleuart_set_conn_handle(uint16_t conn_handle) {
|
||||
* @param Maximum input
|
||||
*/
|
||||
void
|
||||
bleuart_init(struct sysinit_init_ctxt *ctxt)
|
||||
bleuart_init(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -202,5 +202,3 @@ bleuart_init(struct sysinit_init_ctxt *ctxt)
|
||||
console_buf = malloc(MYNEWT_VAL(BLEUART_MAX_INPUT));
|
||||
SYSINIT_PANIC_ASSERT(console_buf != NULL);
|
||||
}
|
||||
|
||||
SYSINIT_REGISTER_INIT(bleuart_init, 5);
|
||||
|
||||
@@ -38,6 +38,8 @@ struct ble_hs_cfg;
|
||||
const char *ble_svc_gap_device_name(void);
|
||||
int ble_svc_gap_device_name_set(const char *name);
|
||||
|
||||
void ble_svc_gap_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -29,3 +29,6 @@ pkg.keywords:
|
||||
|
||||
pkg.deps:
|
||||
- net/nimble/host
|
||||
|
||||
pkg.init_function: ble_svc_gap_init
|
||||
pkg.init_stage: 3
|
||||
|
||||
@@ -151,7 +151,7 @@ ble_svc_gap_device_name_set(const char *name)
|
||||
}
|
||||
|
||||
void
|
||||
ble_svc_gap_init(struct sysinit_init_ctxt *ctxt)
|
||||
ble_svc_gap_init(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -164,5 +164,3 @@ ble_svc_gap_init(struct sysinit_init_ctxt *ctxt)
|
||||
rc = ble_gatts_add_svcs(ble_svc_gap_defs);
|
||||
SYSINIT_PANIC_ASSERT(rc == 0);
|
||||
}
|
||||
|
||||
SYSINIT_REGISTER_INIT(ble_svc_gap_init, 3);
|
||||
|
||||
@@ -31,6 +31,7 @@ struct ble_hs_cfg;
|
||||
#define BLE_SVC_GATT_CHR_SERVICE_CHANGED_UUID16 0x2a05
|
||||
|
||||
void ble_svc_gatt_changed(uint16_t start_handle, uint16_t end_handle);
|
||||
void ble_svc_gatt_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -29,3 +29,6 @@ pkg.keywords:
|
||||
|
||||
pkg.deps:
|
||||
- net/nimble/host
|
||||
|
||||
pkg.init_function: ble_svc_gatt_init
|
||||
pkg.init_stage: 3
|
||||
|
||||
@@ -93,7 +93,7 @@ ble_svc_gatt_changed(uint16_t start_handle, uint16_t end_handle)
|
||||
}
|
||||
|
||||
void
|
||||
ble_svc_gatt_init(struct sysinit_init_ctxt *ctxt)
|
||||
ble_svc_gatt_init(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -106,5 +106,3 @@ ble_svc_gatt_init(struct sysinit_init_ctxt *ctxt)
|
||||
rc = ble_gatts_add_svcs(ble_svc_gatt_defs);
|
||||
SYSINIT_PANIC_ASSERT(rc == 0);
|
||||
}
|
||||
|
||||
SYSINIT_REGISTER_INIT(ble_svc_gatt_init, 3);
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
typedef int ble_svc_ias_event_fn(uint8_t alert_level);
|
||||
|
||||
void ble_svc_ias_set_cb(ble_svc_ias_event_fn *cb);
|
||||
void ble_svc_ias_init(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -29,3 +29,6 @@ pkg.keywords:
|
||||
|
||||
pkg.deps:
|
||||
- net/nimble/host
|
||||
|
||||
pkg.init_function: ble_svc_ias_init
|
||||
pkg.init_stage: 3
|
||||
|
||||
@@ -132,7 +132,7 @@ ble_svc_ias_set_cb(ble_svc_ias_event_fn *cb)
|
||||
* Initialize the IAS package.
|
||||
*/
|
||||
void
|
||||
ble_svc_ias_init(struct sysinit_init_ctxt *ctxt)
|
||||
ble_svc_ias_init(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -145,5 +145,3 @@ ble_svc_ias_init(struct sysinit_init_ctxt *ctxt)
|
||||
rc = ble_gatts_add_svcs(ble_svc_ias_defs);
|
||||
SYSINIT_PANIC_ASSERT(rc == 0);
|
||||
}
|
||||
|
||||
SYSINIT_REGISTER_INIT(ble_svc_ias_init, 3);
|
||||
|
||||
@@ -20,8 +20,12 @@
|
||||
#ifndef H_BLE_SVC_TPS_
|
||||
#define H_BLE_SVC_TPS_
|
||||
|
||||
struct ble_hs_cfg;
|
||||
|
||||
#define BLE_SVC_TPS_UUID16 0x1804
|
||||
#define BLE_SVC_TPS_CHR_UUID16_TX_POWER_LEVEL 0x2a07
|
||||
|
||||
void ble_svc_tps_init(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -29,3 +29,6 @@ pkg.keywords:
|
||||
|
||||
pkg.deps:
|
||||
- net/nimble/host
|
||||
|
||||
pkg.init_function: ble_svc_tps_init
|
||||
pkg.init_stage: 3
|
||||
|
||||
@@ -92,7 +92,7 @@ ble_svc_tps_access(uint16_t conn_handle, uint16_t attr_handle,
|
||||
* Initialize the TPS
|
||||
*/
|
||||
void
|
||||
ble_svc_tps_init(struct sysinit_init_ctxt *ctxt)
|
||||
ble_svc_tps_init(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -105,5 +105,3 @@ ble_svc_tps_init(struct sysinit_init_ctxt *ctxt)
|
||||
rc = ble_gatts_add_svcs(ble_svc_tps_defs);
|
||||
SYSINIT_PANIC_ASSERT(rc == 0);
|
||||
}
|
||||
|
||||
SYSINIT_REGISTER_INIT(ble_svc_tps_init, 3);
|
||||
|
||||
@@ -538,13 +538,15 @@ ble_hs_tx_data(struct os_mbuf *om)
|
||||
* NimBLE by processing events generated by the host.
|
||||
*/
|
||||
void
|
||||
ble_hs_init(struct sysinit_init_ctxt *ctxt)
|
||||
ble_hs_init(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
/* Ensure this function only gets called by sysinit. */
|
||||
SYSINIT_ASSERT_ACTIVE();
|
||||
|
||||
log_init();
|
||||
|
||||
/* Create memory pool of OS events */
|
||||
rc = os_mempool_init(&ble_hs_hci_ev_pool, BLE_HS_HCI_EVT_COUNT,
|
||||
sizeof (struct os_event), ble_hs_hci_os_event_buf,
|
||||
@@ -605,5 +607,3 @@ ble_hs_init(struct sysinit_init_ctxt *ctxt)
|
||||
/* Configure the HCI transport to communicate with a host. */
|
||||
ble_hci_trans_cfg_hs(ble_hs_hci_rx_evt, NULL, ble_hs_rx_data, NULL);
|
||||
}
|
||||
|
||||
SYSINIT_REGISTER_INIT(ble_hs_init, 2);
|
||||
|
||||
@@ -29,3 +29,6 @@ pkg.keywords:
|
||||
|
||||
pkg.deps:
|
||||
- net/nimble/host
|
||||
|
||||
pkg.init_function: ble_store_ram_init
|
||||
pkg.init_stage: 5
|
||||
|
||||
@@ -469,7 +469,7 @@ ble_store_ram_delete(int obj_type, union ble_store_key *key)
|
||||
}
|
||||
|
||||
void
|
||||
ble_store_ram_init(struct sysinit_init_ctxt *ctxt)
|
||||
ble_store_ram_init(void)
|
||||
{
|
||||
/* Ensure this function only gets called by sysinit. */
|
||||
SYSINIT_ASSERT_ACTIVE();
|
||||
@@ -483,5 +483,3 @@ ble_store_ram_init(struct sysinit_init_ctxt *ctxt)
|
||||
ble_store_ram_num_peer_secs = 0;
|
||||
ble_store_ram_num_cccds = 0;
|
||||
}
|
||||
|
||||
SYSINIT_REGISTER_INIT(ble_store_ram_init, 5);
|
||||
|
||||
@@ -31,3 +31,6 @@ pkg.deps:
|
||||
|
||||
pkg.apis:
|
||||
- ble_transport
|
||||
|
||||
pkg.init_function: ble_hci_ram_pkg_init
|
||||
pkg.init_stage: 1
|
||||
|
||||
@@ -241,7 +241,7 @@ err:
|
||||
}
|
||||
|
||||
void
|
||||
ble_hci_ram_pkg_init(struct sysinit_init_ctxt *ctxt)
|
||||
ble_hci_ram_pkg_init(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -251,5 +251,3 @@ ble_hci_ram_pkg_init(struct sysinit_init_ctxt *ctxt)
|
||||
rc = ble_hci_ram_init();
|
||||
SYSINIT_PANIC_ASSERT(rc == 0);
|
||||
}
|
||||
|
||||
SYSINIT_REGISTER_INIT(ble_hci_ram_pkg_init, 1);
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
#ifndef H_BLE_HCI_UART_
|
||||
#define H_BLE_HCI_UART_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int ble_hci_uart_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -33,3 +33,6 @@ pkg.deps:
|
||||
|
||||
pkg.apis:
|
||||
- ble_transport
|
||||
|
||||
pkg.init_function: ble_hci_uart_init
|
||||
pkg.init_stage: 5
|
||||
|
||||
Regular → Executable
+4
-4
@@ -37,6 +37,8 @@
|
||||
#include "nimble/hci_common.h"
|
||||
#include "nimble/ble_hci_trans.h"
|
||||
|
||||
#include "transport/uart/ble_hci_uart.h"
|
||||
|
||||
#define BLE_HCI_UART_EVT_COUNT \
|
||||
(MYNEWT_VAL(BLE_HCI_EVT_HI_BUF_COUNT) + MYNEWT_VAL(BLE_HCI_EVT_LO_BUF_COUNT))
|
||||
|
||||
@@ -957,8 +959,8 @@ ble_hci_trans_reset(void)
|
||||
* @return 0 on success;
|
||||
* A BLE_ERR_[...] error code on failure.
|
||||
*/
|
||||
void
|
||||
ble_hci_uart_init(struct sysinit_init_ctxt *ctxt)
|
||||
int
|
||||
ble_hci_uart_init(void)
|
||||
{
|
||||
int acl_data_length;
|
||||
int acl_block_size;
|
||||
@@ -1060,5 +1062,3 @@ err:
|
||||
ble_hci_uart_free_mem();
|
||||
return rc;
|
||||
}
|
||||
|
||||
SYSINIT_REGISTER_INIT(ble_hci_uart_init, 5);
|
||||
|
||||
Reference in New Issue
Block a user