esp_task.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. /* Notes:
  14. * 1. Put all task priority and stack size definition in this file
  15. * 2. If the task priority is less than 10, use ESP_TASK_PRIO_MIN + X style,
  16. * otherwise use ESP_TASK_PRIO_MAX - X style
  17. * 3. If this is a daemon task, the macro prefix is ESP_TASKD_, otherwise
  18. * it's ESP_TASK_
  19. * 4. If the configMAX_PRIORITIES is modified, please make all priority are
  20. * greater than 0
  21. * 5. Make sure esp_task.h is consistent between wifi lib and idf
  22. * 6. If changing system task priorities, please check the values documented in /api-guides/performance/speed.rst
  23. * are up to date
  24. */
  25. #ifndef _ESP_TASK_H_
  26. #define _ESP_TASK_H_
  27. #include "sdkconfig.h"
  28. #define ESP_TASK_PRIO_MAX (configMAX_PRIORITIES)
  29. #define ESP_TASK_PRIO_MIN (0)
  30. /* Temporary define until system is properly buildable on Linux */
  31. #define CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE 10
  32. /* Bt contoller Task */
  33. /* controller */
  34. #define ESP_TASK_BT_CONTROLLER_PRIO (ESP_TASK_PRIO_MAX - 2)
  35. #ifdef CONFIG_NEWLIB_NANO_FORMAT
  36. #define TASK_EXTRA_STACK_SIZE (0)
  37. #else
  38. #define TASK_EXTRA_STACK_SIZE (512)
  39. #endif
  40. #define BT_TASK_EXTRA_STACK_SIZE TASK_EXTRA_STACK_SIZE
  41. #define ESP_TASK_BT_CONTROLLER_STACK (3584 + TASK_EXTRA_STACK_SIZE)
  42. /* idf task */
  43. #define ESP_TASKD_EVENT_PRIO (ESP_TASK_PRIO_MAX - 5)
  44. #define ESP_TASKD_EVENT_STACK (2048)
  45. #endif