Skip to content

Use syscfg settings for sysinit stage numbers#232

Merged
ccollins476ad merged 2 commits intoapache:masterfrom
ccollins476ad:syscfg-stage
Nov 21, 2018
Merged

Use syscfg settings for sysinit stage numbers#232
ccollins476ad merged 2 commits intoapache:masterfrom
ccollins476ad:syscfg-stage

Conversation

@ccollins476ad
Copy link
Copy Markdown
Contributor

@ccollins476ad ccollins476ad commented Oct 26, 2018

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.

I wanted to make this change backwards compatible via an injected newt syscfg setting, e.g.,

pkg.init.NEWT_FEATURE_SYSCFG_STAGES:
    log_init: 'MYNEWT_VAL(LOG_SYSINIT_STAGE)'

pkg.init.!NEWT_FEATURE_SYSCFG_STAGES:
    log_init: 100

Unfortunately, this is not possible, as the old newt does not allow conditionals to be applied to pkg.init. So, as soon as this PR is merged, everything will break for users using older versions of newt.

I think it is still worth it to get this change in. Before we merge, we can send a note to the dev list and the slack channel. When 1.6.0 is released, we can make sure to add the appropriate newt version restriction.

@ccollins476ad ccollins476ad changed the title Use syscfg settings for sysinit stage numbers [DO NOT MERGE] Use syscfg settings for sysinit stage numbers Oct 26, 2018
@ccollins476ad ccollins476ad changed the title [DO NOT MERGE] Use syscfg settings for sysinit stage numbers Use syscfg settings for sysinit stage numbers Nov 1, 2018
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)'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use BLE_MESH_SHELL_SYSINIT_STAGE instead of BLE_MESH_SYSINIT_STAGE_2?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @rymanluk. I agree that BLE_MESH_SYSINIT_STAGE_2 is a poor name.

I renamed it to BLE_MESH_SYSINIT_STAGE_SHELL rather than your suggestion of BLE_MESH_SHELL_SYSINIT_STAGE. I don't have a preference either way, but I already chose this arbitrary convention for other packages with multiple sysinit stages.

I pushed this commit separately with the intent to fixup before merging.

Copy link
Copy Markdown
Contributor

@rymanluk rymanluk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks great, just one minor comment on one MYNEWT_VAL name.

Copy link
Copy Markdown
Contributor

@rymanluk rymanluk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

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.
@ccollins476ad ccollins476ad merged commit c9fa044 into apache:master Nov 21, 2018
@ccollins476ad ccollins476ad deleted the syscfg-stage branch November 21, 2018 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants