Skip to content

Commit b17ae0a

Browse files
committed
Naming update
1 parent d111e77 commit b17ae0a

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

src/nimble/porting/npl/freertos/src/nimble_port_freertos.c

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
#include "../../../nimble/include/nimble/nimble_port.h"
2424
#ifdef ESP_PLATFORM
2525
#include "esp_bt.h"
26+
27+
#ifdef CONFIG_BT_NIMBLE_HOST_TASK_PRIORITY
28+
# define NIMBLE_HOST_TASK_PRIORITY (CONFIG_BT_NIMBLE_HOST_TASK_PRIORITY)
29+
#else
30+
# define NIMBLE_HOST_TASK_PRIORITY (configMAX_PRIORITIES - 4)
31+
#endif
2632
#endif
2733

2834
#ifndef ESP_PLATFORM
@@ -41,17 +47,6 @@ static StackType_t hs_xStack[ NIMBLE_HS_STACK_SIZE ];
4147
static StaticTask_t hs_xTaskBuffer;
4248
#endif
4349

44-
// configMAX_PRIORITIES - 1 is Tmr builtin task
45-
#ifndef NIMBLE_LL_PRIORITY
46-
#define NIMBLE_LL_PRIORITY (configMAX_PRIORITIES - 2)
47-
#endif
48-
#ifndef NIMBLE_BLE_PRIORITY
49-
#define NIMBLE_BLE_PRIORITY (configMAX_PRIORITIES - 3)
50-
#endif
51-
#ifndef NIMBLE_HOST_PRIORITY
52-
#define NIMBLE_HOST_PRIORITY (configMAX_PRIORITIES - 4)
53-
#endif
54-
5550
static TaskHandle_t host_task_h = NULL;
5651

5752
#ifdef ESP_PLATFORM
@@ -69,7 +64,7 @@ esp_err_t esp_nimble_enable(void *host_task)
6964
* default queue it is just easier to make separate task which does this.
7065
*/
7166
xTaskCreatePinnedToCore(host_task, "nimble_host", NIMBLE_HS_STACK_SIZE,
72-
NULL, NIMBLE_HOST_PRIORITY, &host_task_h, NIMBLE_CORE);
67+
NULL, NIMBLE_HOST_TASK_PRIORITY, &host_task_h, NIMBLE_CORE);
7368
return ESP_OK;
7469

7570
}
@@ -112,6 +107,19 @@ nimble_port_freertos_deinit(void)
112107

113108
#else // !ESP_PLATFORM
114109

110+
// configMAX_PRIORITIES - 1 is Tmr builtin task
111+
#ifdef CONFIG_BT_NIMBLE_LL_TASK_PRIORITY
112+
# define NIMBLE_LL_TASK_PRIORITY (CONFIG_BT_NIMBLE_LL_TASK_PRIORITY)
113+
#else
114+
# define NIMBLE_LL_TASK_PRIORITY (configMAX_PRIORITIES - 1)
115+
#endif
116+
117+
#ifdef CONFIG_BT_NIMBLE_HOST_TASK_PRIORITY
118+
# define NIMBLE_HOST_TASK_PRIORITY (CONFIG_BT_NIMBLE_HOST_TASK_PRIORITY)
119+
#else
120+
# define NIMBLE_HOST_TASK_PRIORITY (configMAX_PRIORITIES - 2)
121+
#endif
122+
115123
void
116124
nimble_port_freertos_init(TaskFunction_t host_task_fn)
117125
{
@@ -123,15 +131,15 @@ nimble_port_freertos_init(TaskFunction_t host_task_fn)
123131
* since it has compatible prototype.
124132
*/
125133
ll_task_h = xTaskCreateStatic(nimble_port_ll_task_func, "ll", NIMBLE_LL_STACK_SIZE,
126-
NULL, NIMBLE_LL_PRIORITY, ll_xStack, &ll_xTaskBuffer);
134+
NULL, NIMBLE_LL_TASK_PRIORITY, ll_stack, &ll_task_buffer);
127135
#endif
128136
/*
129137
* Create task where NimBLE host will run. It is not strictly necessary to
130138
* have separate task for NimBLE host, but since something needs to handle
131139
* default queue it is just easier to make separate task which does this.
132140
*/
133141
host_task_h = xTaskCreateStatic(host_task_fn, "ble", NIMBLE_HS_STACK_SIZE,
134-
NULL, NIMBLE_BLE_PRIORITY, hs_xStack, &hs_xTaskBuffer);
142+
NULL, NIMBLE_HOST_TASK_PRIORITY, hs_xStack, &hs_xTaskBuffer);
135143
}
136144

137145
void

0 commit comments

Comments
 (0)