esp_task.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. */
  23. #ifndef _ESP_TASK_H_
  24. #define _ESP_TASK_H_
  25. #include "sdkconfig.h"
  26. #define ESP_TASK_PRIO_MAX (configMAX_PRIORITIES)
  27. #define ESP_TASK_PRIO_MIN (0)
  28. /* Bt contoller Task */
  29. /* controller */
  30. #define ESP_TASK_BT_CONTROLLER_PRIO (ESP_TASK_PRIO_MAX - 2)
  31. #ifdef CONFIG_NEWLIB_NANO_FORMAT
  32. #define BT_TASK_EXTRA_STACK_SIZE (0)
  33. #else
  34. #define BT_TASK_EXTRA_STACK_SIZE (512)
  35. #endif
  36. #define ESP_TASK_BT_CONTROLLER_STACK (3584 + BT_TASK_EXTRA_STACK_SIZE)
  37. /* idf task */
  38. #define ESP_TASK_TIMER_PRIO (ESP_TASK_PRIO_MAX - 3)
  39. #define ESP_TASK_TIMER_STACK CONFIG_TIMER_TASK_STACK_SIZE
  40. #define ESP_TASKD_EVENT_PRIO (ESP_TASK_PRIO_MAX - 5)
  41. #define ESP_TASKD_EVENT_STACK CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE
  42. #define ESP_TASK_TCPIP_PRIO (ESP_TASK_PRIO_MAX - 7)
  43. #define ESP_TASK_TCPIP_STACK CONFIG_TCPIP_TASK_STACK_SIZE
  44. #define ESP_TASK_MAIN_PRIO (ESP_TASK_PRIO_MIN + 1)
  45. #define ESP_TASK_MAIN_STACK CONFIG_MAIN_TASK_STACK_SIZE
  46. #endif