mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-14 09:48:01 +08:00
Build with -DMG_ENABLE_FS=1
This commit is contained in:
parent
1a5e3d3151
commit
7c0d126edc
@ -6,7 +6,7 @@ DOCKER ?= docker run -it --rm -v $(PROJECT_ROOT_PATH):$(PROJECT_ROOT_PATH) -w $(
|
|||||||
FREERTOS_KERNEL_PATH ?= $(PROJECT_ROOT_PATH)/test/freertos-kernel
|
FREERTOS_KERNEL_PATH ?= $(PROJECT_ROOT_PATH)/test/freertos-kernel
|
||||||
FREERTOS_PLUS_TCP_PATH ?= $(PROJECT_ROOT_PATH)/test/freertos-tcp
|
FREERTOS_PLUS_TCP_PATH ?= $(PROJECT_ROOT_PATH)/test/freertos-tcp
|
||||||
|
|
||||||
MONGOOSE_FLAGS = -DMG_ARCH=MG_ARCH_FREERTOS_TCP -DMG_ENABLE_FS=0
|
MONGOOSE_FLAGS = -DMG_ARCH=MG_ARCH_FREERTOS_TCP -DMG_ENABLE_FS=1
|
||||||
MCU_FLAGS = -mcpu=cortex-m7 -mthumb -mfloat-abi=softfp -mfpu=vfpv4
|
MCU_FLAGS = -mcpu=cortex-m7 -mthumb -mfloat-abi=softfp -mfpu=vfpv4
|
||||||
#-mcpu=cortex-m7 -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard
|
#-mcpu=cortex-m7 -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard
|
||||||
|
|
||||||
|
@ -10,7 +10,12 @@ static const char *s_listening_address = "http://0.0.0.0:80";
|
|||||||
// Event handler for the listening connection.
|
// Event handler for the listening connection.
|
||||||
static void cb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
|
static void cb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
|
||||||
if (ev == MG_EV_HTTP_MSG) {
|
if (ev == MG_EV_HTTP_MSG) {
|
||||||
|
#if MG_ENABLE_FS
|
||||||
|
struct mg_http_serve_opts opts = {.root_dir = "/"};
|
||||||
|
mg_http_serve_dir(c, ev_data, &opts);
|
||||||
|
#else
|
||||||
mg_http_reply(c, 200, "", "hello, %s!\n", "world");
|
mg_http_reply(c, 200, "", "hello, %s!\n", "world");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
(void) fn_data;
|
(void) fn_data;
|
||||||
(void) ev_data;
|
(void) ev_data;
|
||||||
@ -33,7 +38,6 @@ static void blinker(void *args) {
|
|||||||
gpio_toggle(pin);
|
gpio_toggle(pin);
|
||||||
vTaskDelay(pdMS_TO_TICKS(ms));
|
vTaskDelay(pdMS_TO_TICKS(ms));
|
||||||
LOG(LL_INFO, ("blink %s, RAM: %u", (char *) args, xPortGetFreeHeapSize()));
|
LOG(LL_INFO, ("blink %s, RAM: %u", (char *) args, xPortGetFreeHeapSize()));
|
||||||
// printf("blink %s, RAM: %u\n", (char *) args, xPortGetFreeHeapSize());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,8 +92,6 @@ uint32_t SystemCoreClock = 216000000;
|
|||||||
uint32_t HAL_RCC_GetHCLKFreq(void) {
|
uint32_t HAL_RCC_GetHCLKFreq(void) {
|
||||||
return SystemCoreClock;
|
return SystemCoreClock;
|
||||||
}
|
}
|
||||||
// void assert_failed(void) {
|
|
||||||
//}
|
|
||||||
|
|
||||||
uint32_t HAL_GetTick(void) {
|
uint32_t HAL_GetTick(void) {
|
||||||
return configTICK_RATE_HZ;
|
return configTICK_RATE_HZ;
|
||||||
@ -138,4 +140,4 @@ int vLoggingPrintf(const char *fmt, ...) {
|
|||||||
void *_sbrk(ptrdiff_t incr) {
|
void *_sbrk(ptrdiff_t incr) {
|
||||||
(void) incr;
|
(void) incr;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -132,6 +132,10 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
#if MG_ENABLE_FS
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <FreeRTOS.h>
|
#include <FreeRTOS.h>
|
||||||
#include <FreeRTOS_IP.h>
|
#include <FreeRTOS_IP.h>
|
||||||
#include <FreeRTOS_Sockets.h>
|
#include <FreeRTOS_Sockets.h>
|
||||||
|
@ -13,6 +13,10 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
#if MG_ENABLE_FS
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <FreeRTOS.h>
|
#include <FreeRTOS.h>
|
||||||
#include <FreeRTOS_IP.h>
|
#include <FreeRTOS_IP.h>
|
||||||
#include <FreeRTOS_Sockets.h>
|
#include <FreeRTOS_Sockets.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user