You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
967 B
52 lines
967 B
#include "httpd.h"
|
|
#include "httpd-platform.h"
|
|
|
|
#include "FreeRTOS/FreeRTOS.h"
|
|
|
|
#define HTTPD_STACKSIZE 4096 // TODO
|
|
|
|
static xQueueHandle httpdMux;
|
|
|
|
//Set/clear global httpd lock.
|
|
void httpdPlatLock()
|
|
{
|
|
xSemaphoreTakeRecursive(httpdMux, portMAX_DELAY);
|
|
}
|
|
|
|
void httpdPlatUnlock()
|
|
{
|
|
xSemaphoreGiveRecursive(httpdMux);
|
|
}
|
|
|
|
void httpdPlatDelayMs(uint32_t ms)
|
|
{
|
|
vTaskDelay(1000 / portTICK_RATE_MS);
|
|
}
|
|
|
|
void httpdPlatTaskEnd()
|
|
{
|
|
vTaskDelete(NULL);
|
|
}
|
|
|
|
void httpdPlatDisableTimeout(ConnTypePtr conn)
|
|
{
|
|
//Unimplemented
|
|
}
|
|
|
|
//Initialize listening socket, do general initialization
|
|
void httpdPlatStart(struct httpd_options *opts)
|
|
{
|
|
httpMaxConnCt = maxConnCt;
|
|
httpdMux = xSemaphoreCreateRecursiveMutex(); // TODO verify arguments
|
|
xTaskCreate(platHttpServerTask, (const char *) "httpd", HTTPD_STACKSIZE, opts, 4, NULL);
|
|
}
|
|
|
|
void* httpdPlatMalloc(size_t len)
|
|
{
|
|
return malloc(len); // TODO
|
|
}
|
|
|
|
void httpdPlatFree(void *ptr)
|
|
{
|
|
free(ptr);// TODO
|
|
}
|
|
|