Skip to content

Commit 9801a99

Browse files
committed
Use old freertos porting layer for all but new esp mcu's.
The old porting layer was more efficient and worked better for non-esp devices.
1 parent de03239 commit 9801a99

File tree

6 files changed

+452
-960
lines changed

6 files changed

+452
-960
lines changed

docs/Command_line_config.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,7 @@ Sets the core the NimBLE host stack will run on
137137
`CONFIG_BT_NIMBLE_TASK_STACK_SIZE`
138138

139139
Set the task stack size for the NimBLE core.
140-
- Default is 4096
141-
<br/>
142-
143-
`CONFIG_NIMBLE_STACK_USE_MEM_POOLS`
144-
145-
Enable the use of memory pools for stack operations. This will use slightly more RAM but may provide more stability.
146-
147-
- Options: 0 or 1, default is disabled (0)
140+
- Default is 4096
148141
<br/>
149142

150143
### Extended advertising settings, For use with ESP32C3, ESP32S3, ESP32H2 ONLY!

src/nimble/nimble/host/src/ble_hs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,11 @@ ble_hs_enqueue_hci_event(uint8_t *hci_evt)
609609
struct ble_npl_event *ev;
610610

611611
ev = os_memblock_get(&ble_hs_hci_ev_pool);
612+
#if CONFIG_BT_LE_CONTROLLER_NPL_OS_PORTING_SUPPORT
612613
if (ev && ble_hs_evq->eventq) {
614+
#else
615+
if (ev && ble_hs_evq->q) {
616+
#endif
613617
memset (ev, 0, sizeof *ev);
614618
ble_npl_event_init(ev, ble_hs_event_rx_hci_ev, hci_evt);
615619
ble_npl_eventq_put(ble_hs_evq, ev);

src/nimble/porting/nimble/src/nimble_port.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -93,30 +93,6 @@ esp_err_t esp_nimble_init(void)
9393
esp_err_t ret;
9494
#endif
9595
#if !SOC_ESP_NIMBLE_CONTROLLER || !CONFIG_BT_CONTROLLER_ENABLED
96-
/* Initialize the function pointers for OS porting */
97-
npl_freertos_funcs_init();
98-
99-
npl_freertos_mempool_init();
100-
101-
#if false // Arduino disable
102-
#if CONFIG_BT_CONTROLLER_ENABLED
103-
if(esp_nimble_hci_init() != ESP_OK) {
104-
ESP_LOGE(NIMBLE_PORT_LOG_TAG, "hci inits failed\n");
105-
return ESP_FAIL;
106-
}
107-
#else
108-
ret = ble_buf_alloc();
109-
if (ret != ESP_OK) {
110-
ble_buf_free();
111-
return ESP_FAIL;
112-
}
113-
ble_transport_init();
114-
#if MYNEWT_VAL(BLE_QUEUE_CONG_CHECK)
115-
ble_adv_list_init();
116-
#endif
117-
#endif
118-
#endif // Arduino disable
119-
12096
/* Initialize default event queue */
12197
ble_npl_eventq_init(&g_eventq_dflt);
12298
/* Initialize the global memory pool */
@@ -345,9 +321,6 @@ nimble_port_get_dflt_eventq(void)
345321
void
346322
nimble_port_init(void)
347323
{
348-
npl_freertos_funcs_init();
349-
npl_freertos_mempool_init();
350-
351324
/* Initialize default event queue */
352325
ble_npl_eventq_init(&g_eventq_dflt);
353326
/* Initialize the global memory pool */

0 commit comments

Comments
 (0)