kernel.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * SPDX-FileCopyrightText: 2016 Wind River Systems, Inc.
  3. * SPDX-FileContributor: 2020-2021 Espressif Systems (Shanghai) CO LTD
  4. *
  5. * SPDX-License-Identifier: Apache-2.0
  6. */
  7. #ifndef _BLE_MESH_KERNEL_H_
  8. #define _BLE_MESH_KERNEL_H_
  9. #include "freertos/FreeRTOS.h"
  10. #include "freertos/task.h"
  11. #include "freertos/queue.h"
  12. #include "freertos/semphr.h"
  13. #include "mesh/config.h"
  14. #include "mesh/types.h"
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #ifdef CONFIG_BT_BLUEDROID_ENABLED
  19. #ifdef CONFIG_BT_BLUEDROID_PINNED_TO_CORE
  20. #define BLE_MESH_ADV_TASK_CORE (CONFIG_BT_BLUEDROID_PINNED_TO_CORE < portNUM_PROCESSORS ? CONFIG_BT_BLUEDROID_PINNED_TO_CORE : tskNO_AFFINITY)
  21. #else
  22. #define BLE_MESH_ADV_TASK_CORE (0)
  23. #endif
  24. #endif
  25. #ifdef CONFIG_BT_NIMBLE_ENABLED
  26. #ifdef CONFIG_BT_NIMBLE_PINNED_TO_CORE
  27. #define BLE_MESH_ADV_TASK_CORE (CONFIG_BT_NIMBLE_PINNED_TO_CORE < portNUM_PROCESSORS ? CONFIG_BT_NIMBLE_PINNED_TO_CORE : tskNO_AFFINITY)
  28. #else
  29. #define BLE_MESH_ADV_TASK_CORE (0)
  30. #endif
  31. #endif
  32. #define BLE_MESH_ADV_TASK_STACK_SIZE 3072
  33. #define BLE_MESH_ADV_TASK_NAME "mesh_adv_task"
  34. #define BLE_MESH_ADV_TASK_PRIO (configMAX_PRIORITIES - 5)
  35. /**
  36. * @brief Put the current thread to sleep.
  37. *
  38. * This routine puts the current thread to sleep for @a duration
  39. * milliseconds.
  40. *
  41. * @param duration Number of milliseconds to sleep.
  42. *
  43. * @return N/A
  44. */
  45. void k_sleep(int32_t duration);
  46. #ifdef __cplusplus
  47. }
  48. #endif
  49. #endif /* _BLE_MESH_KERNEL_H_ */