From cd1f218dd8710f61238307a9fa5b0d11e229bffa Mon Sep 17 00:00:00 2001 From: Jean-François Milants Date: Mon, 14 Mar 2022 21:54:13 +0100 Subject: Fix priorities of BLE tasks --- .../mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libs/mynewt-nimble') diff --git a/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c b/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c index b9902781..205831a9 100644 --- a/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c +++ b/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c @@ -38,7 +38,7 @@ nimble_port_freertos_init(TaskFunction_t host_task_fn) * since it has compatible prototype. */ xTaskCreate(nimble_port_ll_task_func, "ll", configMINIMAL_STACK_SIZE + 200, - NULL, configMAX_PRIORITIES - 1, &ll_task_h); + NULL, 3, &ll_task_h); #endif /* @@ -47,5 +47,5 @@ nimble_port_freertos_init(TaskFunction_t host_task_fn) * default queue it is just easier to make separate task which does this. */ xTaskCreate(host_task_fn, "ble", configMINIMAL_STACK_SIZE + 600, - NULL, tskIDLE_PRIORITY + 1, &host_task_h); + NULL, 2, &host_task_h); } -- cgit v1.2.3 From a8b7fbe48b4a86238f38ed0f084b277b44c428fb Mon Sep 17 00:00:00 2001 From: Jean-François Milants Date: Thu, 17 Mar 2022 21:22:59 +0100 Subject: New changes according to the review : Priority 0 for display, 1 for system, timer and ble host, and 2 for ble LL --- src/FreeRTOSConfig.h | 2 +- src/components/ble/NimbleController.cpp | 1 + .../mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/libs/mynewt-nimble') diff --git a/src/FreeRTOSConfig.h b/src/FreeRTOSConfig.h index 5462b93c..263d8031 100644 --- a/src/FreeRTOSConfig.h +++ b/src/FreeRTOSConfig.h @@ -60,7 +60,7 @@ #define configUSE_TICKLESS_IDLE_SIMPLE_DEBUG 0 /* See into vPortSuppressTicksAndSleep source code for explanation */ #define configCPU_CLOCK_HZ (SystemCoreClock) #define configTICK_RATE_HZ 1024 -#define configMAX_PRIORITIES (4) +#define configMAX_PRIORITIES (3) #define configMINIMAL_STACK_SIZE (120) #define configTOTAL_HEAP_SIZE (1024 * 17) #define configMAX_TASK_NAME_LEN (4) diff --git a/src/components/ble/NimbleController.cpp b/src/components/ble/NimbleController.cpp index 0be7c0f7..10eb429a 100644 --- a/src/components/ble/NimbleController.cpp +++ b/src/components/ble/NimbleController.cpp @@ -77,6 +77,7 @@ int GAPEventCallback(struct ble_gap_event* event, void* arg) { void NimbleController::Init() { while (!ble_hs_synced()) { + vTaskDelay(10); } nptr = this; diff --git a/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c b/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c index 205831a9..49834db1 100644 --- a/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c +++ b/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c @@ -38,7 +38,7 @@ nimble_port_freertos_init(TaskFunction_t host_task_fn) * since it has compatible prototype. */ xTaskCreate(nimble_port_ll_task_func, "ll", configMINIMAL_STACK_SIZE + 200, - NULL, 3, &ll_task_h); + NULL, 2, &ll_task_h); #endif /* @@ -47,5 +47,5 @@ nimble_port_freertos_init(TaskFunction_t host_task_fn) * default queue it is just easier to make separate task which does this. */ xTaskCreate(host_task_fn, "ble", configMINIMAL_STACK_SIZE + 600, - NULL, 2, &host_task_h); + NULL, 1, &host_task_h); } -- cgit v1.2.3