esp_task.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. /* Wifi library task */
  29. #define ESP_TASKD_WATCHDOG_PRIO (ESP_TASK_PRIO_MAX - 1)
  30. #define ESP_TASKD_WATCHDOG_STACK 2048
  31. #define ESP_TASK_WPA2_PRIO (ESP_TASK_PRIO_MAX - 1)
  32. #define ESP_TASK_WPA2_STACK 2048
  33. #define ESP_TASKD_WIFI_PRIO (ESP_TASK_PRIO_MAX - 2)
  34. #define ESP_TASKD_WIFI_STACK 8196
  35. #define ESP_TASKD_WIFI_TIMER_PRIO (ESP_TASK_PRIO_MAX - 3)
  36. #define ESP_TASKD_WIFI_TIMER_STACK 2048
  37. #define ESP_TASK_WPS_PRIO (ESP_TASK_PRIO_MIN + 2)
  38. #define ESP_TASK_WPS_STACK 2048
  39. /* Bt contoller Task */
  40. /* controller */
  41. #define ESP_TASK_BT_CONTROLLER_PRIO (ESP_TASK_PRIO_MAX - 1)
  42. #define ESP_TASK_BT_CONTROLLER_STACK 4096
  43. /* idf task */
  44. #define ESP_TASKD_EVENT_PRIO (ESP_TASK_PRIO_MAX - 5)
  45. #define ESP_TASKD_EVENT_STACK CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE
  46. #define ESP_TASK_TCPIP_PRIO (ESP_TASK_PRIO_MAX - 7)
  47. #define ESP_TASK_TCPIP_STACK 2048
  48. #define ESP_TASK_MAIN_PRIO (ESP_TASK_PRIO_MIN + 1)
  49. #define ESP_TASK_MAIN_STACK CONFIG_MAIN_TASK_STACK_SIZE
  50. #endif