Func "nimble_port_init" has a err.
- Dominant language
- C
- Stars
- 893
- Forks
- 512
- Avg merge
- 13d 31m
- Merged PRs (30d)
- 7
Description
```c
void
nimble_port_init(void)
{
/* Initialize default event queue */
ble_npl_eventq_init(&g_eventq_dflt);
/* Initialize the global memory pool */
os_mempool_module_init();
os_msys_init();
/* Initialize transport */
ble_transport_init();
/* Initialize the host */
ble_transport_hs_init();
#if NIMBLE_CFG_CONTROLLER
#ifndef RIOT_VERSION
hal_timer_init(5, NULL);
os_cputime_init(32768);
#endif
ble_transport_ll_init();
#endif
}
```
In "ble_transport_ll_init", "ble_transport_hs_init" should swap places with "ble_transport_ll_init".
"NIMBLE_CFG_CONTROLLER" could be placed by MYNEWT_VAL(BLE_CONTROLLER), and add MYNEWT_VAL(BLE_HOST). ==>
```c
void
nimble_port_init(void)
{
/* Initialize default event queue */
ble_npl_eventq_init(&g_eventq_dflt);
/* Initialize the global memory pool */
os_mempool_module_init();
os_msys_init();
/* Initialize transport */
ble_transport_init();
/* Initialize the host */
#if MYNEWT_VAL(BLE_HOST)
ble_transport_ll_init();
#endif
#if MYNEWT_VAL(BLE_CONTROLLER)
#ifndef RIOT_VERSION
hal_timer_init(5, NULL);
os_cputime_init(32768);
#endif
ble_transport_hs_init();
#endif
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the nimble_port_init function shown in the issue and inspect the existing ble_transport_ll_init and ble_transport_hs_init calls. Verify the requested initialization order and MYNEWT_VAL(BLE_HOST)/MYNEWT_VAL(BLE_CONTROLLER) guards against the surrounding transport code. Done means the function reflects the requested guards and ordering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot, networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100