1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- #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
|