diff --git a/Kconfig.projbuild b/Kconfig.projbuild index 85608ef..bd8bac4 100644 --- a/Kconfig.projbuild +++ b/Kconfig.projbuild @@ -101,6 +101,62 @@ menu "esp32_BNO08x" Stack size of task responsible for calling shtp_service() when HINT is asserted, to dispatch any sh2 HAL lib callbacks. + config ESP32_BNO08X_CB_TASK_AFFINITY + int "Callback task core affinity" + range -1 1 + default -1 + help + Core to which the callback task is pinned. + -1 = No specific core (tskNO_AFFINITY) + 0 = Core 0 + 1 = Core 1 + + config ESP32_BNO08X_CB_TASK_PRIORITY + int "Callback task priority" + range 0 25 + default 5 + help + Priority of the callback task. + 0 is lowest priority, 25 is highest priority. + + config ESP32_BNO08X_DATA_PROC_TASK_AFFINITY + int "Data processing task core affinity" + range -1 1 + default -1 + help + Core to which the data processing task is pinned. + -1 = No specific core (tskNO_AFFINITY) + 0 = Core 0 + 1 = Core 1 + + config ESP32_BNO08X_DATA_PROC_TASK_PRIORITY + int "Data processing task priority" + range 0 25 + default 6 + help + Priority of the data processing task. + 0 is lowest priority, 25 is highest priority. + + config ESP32_BNO08X_SH2_HAL_SERVICE_TASK_AFFINITY + int "SH2 HAL service task core affinity" + range -1 1 + default -1 + help + Core to which the SH2 HAL service task is pinned. + -1 = No specific core (tskNO_AFFINITY) + 0 = Core 0 + 1 = Core 1 + + config ESP32_BNO08X_SH2_HAL_SERVICE_TASK_PRIORITY + int "SH2 HAL service task priority" + range 0 25 + default 7 + help + Priority of the SH2 HAL service task. + 0 is lowest priority, 25 is highest priority. + + + endmenu #Tasks menu "Callbacks" diff --git a/include/BNO08x.hpp b/include/BNO08x.hpp index 9d0d29f..9608a75 100644 --- a/include/BNO08x.hpp +++ b/include/BNO08x.hpp @@ -150,6 +150,22 @@ class BNO08x static void cb_task_trampoline(void* arg); void cb_task(); + + //------------ addition flyinggorilla ----------- + static const constexpr BaseType_t CB_TASK_AFFINITY = + CONFIG_ESP32_BNO08X_CB_TASK_AFFINITY < 1 ? tskNO_AFFINITY : CONFIG_ESP32_BNO08X_CB_TASK_AFFINITY ; /// tskNO_AFFINITY if not pinned to a core, 0 or 1 + static const constexpr UBaseType_t CB_TASK_PRIORITY = CONFIG_ESP32_BNO08X_CB_TASK_PRIORITY; /// 5 per default, Priority of the callback task, 0-25, 0 is lowest priority, 25 is highest priority + + static const constexpr BaseType_t DATA_PROC_TASK_AFFINITY = + CONFIG_ESP32_BNO08X_DATA_PROC_TASK_AFFINITY < 1 ? tskNO_AFFINITY : CONFIG_ESP32_BNO08X_DATA_PROC_TASK_AFFINITY; /// tskNO_AFFINITY if not pinned to a core, 0 or 1 + static const constexpr UBaseType_t DATA_PROC_TASK_PRIORITY = CONFIG_ESP32_BNO08X_DATA_PROC_TASK_PRIORITY; /// 6 per default, Priority of the data processing task, 0-25, 0 is lowest priority, 25 is highest priority + + static const constexpr BaseType_t SH2_HAL_SERVICE_TASK_AFFINITY = + CONFIG_ESP32_BNO08X_SH2_HAL_SERVICE_TASK_AFFINITY < 1 ? tskNO_AFFINITY : CONFIG_ESP32_BNO08X_SH2_HAL_SERVICE_TASK_AFFINITY; /// tskNO_AFFINITY if not pinned to a core, 0 or 1 + static const constexpr UBaseType_t SH2_HAL_SERVICE_TASK_PRIORITY = CONFIG_ESP32_BNO08X_SH2_HAL_SERVICE_TASK_PRIORITY; /// 7 per default, Priority of the sh2 HAL service task, 0-25, 0 is lowest priority, 25 is highest priority + //----------------------------------------------- + + SemaphoreHandle_t sem_kill_tasks; ///