123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- #ifndef __ESP_HTTP_SERVER_H_
- #define __ESP_HTTP_SERVER_H_
- #include <stdio.h>
- #include <string.h>
- #include <freertos/FreeRTOS.h>
- #include <freertos/task.h>
- #include <http_parser.h>
- #include <sdkconfig.h>
- #include <esp_err.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- esp_err_t __httpd_start(httpd_handle_t *handle, const httpd_config_t *config);
- static inline int __httpd_os_thread_create_static(TaskHandle_t *thread,
- const char *name, uint16_t stacksize, int prio,
- void (*thread_routine)(void *arg), void *arg,
- BaseType_t core_id)
- {
- StaticTask_t *xTaskBuffer = (StaticTask_t*) heap_caps_malloc(sizeof(StaticTask_t), (MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT));
- StackType_t *xStack = heap_caps_malloc(stacksize,(MALLOC_CAP_SPIRAM|MALLOC_CAP_8BIT));
-
- *thread = xTaskCreateStaticPinnedToCore(thread_routine, name, stacksize, arg, prio, xStack,xTaskBuffer,core_id);
- if (*thread) {
- return ESP_OK;
- }
- return ESP_FAIL;
- }
- #ifdef __cplusplus
- }
- #endif
- #endif
|