Skip to content

Commit

Permalink
Use syscfg settings for sysinit stage numbers
Browse files Browse the repository at this point in the history
This allows the app or target to rearrange package initialization order
via syscfg overrides.

Note: This requires an updated version of newt
(apache/mynewt-newt#230).  Older versions of
newt fail to parse the updated `pkg.yml` files.
  • Loading branch information
ccollins476ad committed Nov 21, 2018
1 parent 15b1e43 commit 55c5003
Show file tree
Hide file tree
Showing 36 changed files with 198 additions and 19 deletions.
2 changes: 1 addition & 1 deletion nimble/controller/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ pkg.deps:
- nimble

pkg.init:
ble_ll_init: 250
ble_ll_init: 'MYNEWT_VAL(BLE_LL_SYSINIT_STAGE)'
5 changes: 5 additions & 0 deletions nimble/controller/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ syscfg.defs:
line number where assertion occured.
value: 0

BLE_LL_SYSINIT_STAGE:
description: >
Sysinit stage for the NimBLE controller.
value: 250

syscfg.vals.BLE_LL_CFG_FEAT_LL_EXT_ADV:
BLE_LL_CFG_FEAT_LE_CSA2: 1
BLE_HW_WHITELIST_ENABLE: 0
Expand Down
4 changes: 2 additions & 2 deletions nimble/host/mesh/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ pkg.req_apis:
- stats

pkg.init:
bt_mesh_register_gatt: 500
ble_mesh_shell_init: 1000
bt_mesh_register_gatt: 'MYNEWT_VAL(BLE_MESH_SYSINIT_STAGE)'
ble_mesh_shell_init: 'MYNEWT_VAL(BLE_MESH_SYSINIT_STAGE_2)'
10 changes: 10 additions & 0 deletions nimble/host/mesh/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,16 @@ syscfg.defs:
This value defines BLE Mesh device/node name.
value: '"nimble-mesh-node"'

BLE_MESH_SYSINIT_STAGE:
description: >
Primary sysinit stage for BLE mesh functionality.
value: 500

BLE_MESH_SYSINIT_STAGE_2:
description: >
Secondary sysinit stage for BLE mesh functionality.
value: 1000

syscfg.vals.BLE_MESH_SHELL:
BLE_MESH_CFG_CLI: 1
BLE_MESH_HEALTH_CLI: 1
Expand Down
2 changes: 1 addition & 1 deletion nimble/host/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pkg.req_apis:
- stats

pkg.init:
ble_hs_init: 200
ble_hs_init: 'MYNEWT_VAL(BLE_HS_SYSINIT_STAGE)'

pkg.down.BLE_HS_STOP_ON_SHUTDOWN:
ble_hs_shutdown: 200
2 changes: 1 addition & 1 deletion nimble/host/services/ans/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ pkg.deps:
- nimble/host

pkg.init:
ble_svc_ans_init: 303
ble_svc_ans_init: 'MYNEWT_VAL(BLE_SVC_ANS_SYSINIT_STAGE)'
5 changes: 5 additions & 0 deletions nimble/host/services/ans/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ syscfg.defs:
BLE_SVC_ANS_UNR_ALERT_CAT:
description: "Initial supported unread alert category bitmask."
value: 0

BLE_SVC_ANS_SYSINIT_STAGE:
description: >
Sysinit stage for the alert notification service.
value: 303
2 changes: 1 addition & 1 deletion nimble/host/services/bas/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ pkg.deps:
- nimble/host

pkg.init:
ble_svc_bas_init: 303
ble_svc_bas_init: 'MYNEWT_VAL(BLE_SVC_BAS_SYSINIT_STAGE)'
4 changes: 4 additions & 0 deletions nimble/host/services/bas/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ syscfg.defs:
description: >
Set to 1 to support notification or 0 to disable it.
value: 1
BLE_SVC_BAS_SYSINIT_STAGE:
description: >
Sysinit stage for the battery level service.
value: 303
2 changes: 1 addition & 1 deletion nimble/host/services/bleuart/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ pkg.req_apis:
- console

pkg.init:
bleuart_init: 500
bleuart_init: 'MYNEWT_VAL(BLEUART_SYSINIT_STAGE)'
4 changes: 4 additions & 0 deletions nimble/host/services/bleuart/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ syscfg.defs:
The size of the largest line that can be received over the UART
service.
value: 120
BLEUART_SYSINIT_STAGE:
description: >
Sysinit stage for the BLE UART service.
value: 500
2 changes: 1 addition & 1 deletion nimble/host/services/dis/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ pkg.deps:
- nimble/host

pkg.init:
ble_svc_dis_init: 303
ble_svc_dis_init: 'MYNEWT_VAL(BLE_SVC_DIS_SYSINIT_STAGE)'
4 changes: 4 additions & 0 deletions nimble/host/services/dis/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,7 @@ syscfg.defs:
Defines a default value for "Manufacturer name" if not set with
'ble_svc_dis_manufacturer_name_set'.
value: NULL
BLE_SVC_DIS_SYSINIT_STAGE:
description: >
Sysinit stage for the device information BLE service.
value: 303
2 changes: 1 addition & 1 deletion nimble/host/services/gap/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ pkg.deps:
- nimble/host

pkg.init:
ble_svc_gap_init: 301
ble_svc_gap_init: 'MYNEWT_VAL(BLE_SVC_GAP_SYSINIT_STAGE)'
5 changes: 5 additions & 0 deletions nimble/host/services/gap/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,8 @@ syscfg.defs:
by Core specification 5.0, Vol 3, Part C, section 12.
Set to '-1' to disable.
value: -1

BLE_SVC_GAP_SYSINIT_STAGE:
description: >
Sysinit stage for the GAP BLE service.
value: 301
2 changes: 1 addition & 1 deletion nimble/host/services/gatt/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ pkg.deps:
- nimble/host

pkg.init:
ble_svc_gatt_init: 302
ble_svc_gatt_init: 'MYNEWT_VAL(BLE_SVC_GATT_SYSINIT_STAGE)'
24 changes: 24 additions & 0 deletions nimble/host/services/gatt/syscfg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# 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.
#

syscfg.defs:
BLE_SVC_GATT_SYSINIT_STAGE:
description: >
Sysinit stage for the GATT BLE service
value: 302
2 changes: 1 addition & 1 deletion nimble/host/services/ias/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ pkg.deps:
- nimble/host

pkg.init:
ble_svc_ias_init: 303
ble_svc_ias_init: 'MYNEWT_VAL(BLE_SVC_IAS_SYSINIT_STAGE)'
23 changes: 23 additions & 0 deletions nimble/host/services/ias/syscfg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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.
#

syscfg.defs:
BLE_SVC_IAS_SYSINIT_STAGE:
description: >
Sysinit stage for the immediate alert BLE service.
value: 303
2 changes: 1 addition & 1 deletion nimble/host/services/lls/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ pkg.deps:
- nimble/host

pkg.init:
ble_svc_lls_init: 303
ble_svc_lls_init: 'MYNEWT_VAL(BLE_SVC_LLS_SYSINIT_STAGE)'
22 changes: 22 additions & 0 deletions nimble/host/services/lls/syscfg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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.

syscfg.defs:
BLE_SVC_LLS_SYSINIT_STAGE:
description: >
Sysinit stage for the link loss BLE service.
value: 303
2 changes: 1 addition & 1 deletion nimble/host/services/tps/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ pkg.deps:
- nimble/host

pkg.init:
ble_svc_tps_init: 303
ble_svc_tps_init: 'MYNEWT_VAL(BLE_SVC_TPS_SYSINIT_STAGE)'
23 changes: 23 additions & 0 deletions nimble/host/services/tps/syscfg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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.

syscfg.defs:
BLE_SVC_TPS_SYSINIT_STAGE:
description: >
Sysinit stage for the transmit power BLE service.
value: 303

2 changes: 1 addition & 1 deletion nimble/host/store/config/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ pkg.deps.BLE_STORE_CONFIG_PERSIST:
- "@apache-mynewt-core/sys/config"

pkg.init:
ble_store_config_init: 500
ble_store_config_init: 'MYNEWT_VAL(BLE_STORE_SYSINIT_STAGE)'
4 changes: 4 additions & 0 deletions nimble/host/store/config/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ syscfg.defs:
description: >
Whether to save data to sys/config, or just keep it in RAM.
value: 1
BLE_STORE_SYSINIT_STAGE:
description: >
Sysinit stage for BLE host store.
value: 500
2 changes: 1 addition & 1 deletion nimble/host/store/ram/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ pkg.deps:
- nimble/host

pkg.init:
ble_store_ram_init: 500
ble_store_ram_init: 'MYNEWT_VAL(BLE_STORE_RAM_SYSINIT_STAGE)'
23 changes: 23 additions & 0 deletions nimble/host/store/ram/syscfg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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.

syscfg.defs:
BLE_STORE_RAM_SYSINIT_STAGE:
description: >
Sysinit stage for the RAM BLE store.
value: 500

4 changes: 4 additions & 0 deletions nimble/host/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,10 @@ syscfg.defs:
entails aborting all GAP procedures and terminating open
connections.
value: 1
BLE_HS_SYSINIT_STAGE:
description: >
Sysinit stage for the NimBLE host.
value: 200

syscfg.vals.BLE_MESH:
BLE_SM_SC: 1
2 changes: 1 addition & 1 deletion nimble/transport/emspi/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ pkg.apis:
- ble_transport

pkg.init:
ble_hci_emspi_init: 100
ble_hci_emspi_init: 'MYNEWT_VAL(BLE_HCI_EMSPI_SYSINIT_STAGE)'
5 changes: 5 additions & 0 deletions nimble/transport/emspi/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,10 @@ syscfg.defs:
description: 'The size of the emspi task (units: 4-byte words).'
value: 256

BLE_HCI_EMSPI_SYSINIT_STAGE:
description: >
Sysinit stage for the EMSPI BLE transport.
value: 100

syscfg.vals.BLE_EXT_ADV:
BLE_HCI_EVT_BUF_SIZE: 257
2 changes: 1 addition & 1 deletion nimble/transport/ram/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ pkg.apis:
- ble_transport

pkg.init:
ble_hci_ram_init: 100
ble_hci_ram_init: 'MYNEWT_VAL(BLE_TRANS_RAM_SYSINIT_STAGE)'
5 changes: 5 additions & 0 deletions nimble/transport/ram/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,10 @@ syscfg.defs:
packets. It does not include the HCI data header (of 4 bytes).
value: 255

BLE_TRANS_RAM_SYSINIT_STAGE:
description: >
Sysinit stage for the RAM BLE transport.
value: 100

syscfg.vals.BLE_EXT_ADV:
BLE_HCI_EVT_BUF_SIZE: 257
2 changes: 1 addition & 1 deletion nimble/transport/socket/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ pkg.apis:
- ble_transport

pkg.init:
ble_hci_sock_init: 500
ble_hci_sock_init: 'MYNEWT_VAL(BLE_SOCK_CLI_SYSINIT_STAGE)'
5 changes: 5 additions & 0 deletions nimble/transport/socket/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,10 @@ syscfg.defs:
description: 'Size of the HCI socket stack (units=words).'
value: 80

BLE_SOCK_CLI_SYSINIT_STAGE:
description: >
Sysinit stage for the socket BLE transport.
value: 500

syscfg.vals.BLE_EXT_ADV:
BLE_HCI_EVT_BUF_SIZE: 257
2 changes: 1 addition & 1 deletion nimble/transport/uart/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ pkg.apis:
- ble_transport

pkg.init:
ble_hci_uart_init: 500
ble_hci_uart_init: 'MYNEWT_VAL(BLE_TRANS_UART_SYSINIT_STAGE)'
4 changes: 4 additions & 0 deletions nimble/transport/uart/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ syscfg.defs:
BLE_HCI_UART_FLOW_CTRL:
description: 'Flow control used for HCI uart interface'
value: HAL_UART_FLOW_CTL_RTS_CTS
BLE_TRANS_UART_SYSINIT_STAGE:
description: >
Sysinit stage for the UART BLE transport.
value: 500

syscfg.vals.BLE_EXT_ADV:
BLE_HCI_EVT_BUF_SIZE: 257

0 comments on commit 55c5003

Please sign in to comment.