porting: cleanup porting_init()

- code simplification
- add some more comments
- call ble_hci_ram_init() before ble_ll_init() to make sure the
  buffers are intialized before they are potentially used
This commit is contained in:
Hauke Petersen
2020-06-29 16:46:22 +02:00
committed by Hauke Petersen
parent d4d4fd88e0
commit cd6da7f680
+6 -9
View File
@@ -24,31 +24,28 @@
#include "nimble/nimble_port.h" #include "nimble/nimble_port.h"
#if NIMBLE_CFG_CONTROLLER #if NIMBLE_CFG_CONTROLLER
#include "controller/ble_ll.h" #include "controller/ble_ll.h"
#include "transport/ram/ble_hci_ram.h"
#endif #endif
static struct ble_npl_eventq g_eventq_dflt; static struct ble_npl_eventq g_eventq_dflt;
extern void os_msys_init(void);
void void
nimble_port_init(void) nimble_port_init(void)
{ {
void os_msys_init(void);
#if NIMBLE_CFG_CONTROLLER
void ble_hci_ram_init(void);
#endif
/* Initialize default event queue */ /* Initialize default event queue */
ble_npl_eventq_init(&g_eventq_dflt); ble_npl_eventq_init(&g_eventq_dflt);
/* Initialize the global memory pool */
os_msys_init(); os_msys_init();
/* Initialize the host */
ble_hs_init(); ble_hs_init();
#if NIMBLE_CFG_CONTROLLER #if NIMBLE_CFG_CONTROLLER
ble_hci_ram_init();
hal_timer_init(5, NULL); hal_timer_init(5, NULL);
os_cputime_init(32768); os_cputime_init(32768);
ble_ll_init(); ble_ll_init();
ble_hci_ram_init();
#endif #endif
} }