mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-27 06:51:04 +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_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
|
||||
#-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.
|
||||
static void cb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
|
||||
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");
|
||||
#endif
|
||||
}
|
||||
(void) fn_data;
|
||||
(void) ev_data;
|
||||
@ -33,7 +38,6 @@ static void blinker(void *args) {
|
||||
gpio_toggle(pin);
|
||||
vTaskDelay(pdMS_TO_TICKS(ms));
|
||||
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) {
|
||||
return SystemCoreClock;
|
||||
}
|
||||
// void assert_failed(void) {
|
||||
//}
|
||||
|
||||
uint32_t HAL_GetTick(void) {
|
||||
return configTICK_RATE_HZ;
|
||||
|
@ -132,6 +132,10 @@
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#if MG_ENABLE_FS
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#include <FreeRTOS.h>
|
||||
#include <FreeRTOS_IP.h>
|
||||
#include <FreeRTOS_Sockets.h>
|
||||
|
@ -13,6 +13,10 @@
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#if MG_ENABLE_FS
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#include <FreeRTOS.h>
|
||||
#include <FreeRTOS_IP.h>
|
||||
#include <FreeRTOS_Sockets.h>
|
||||
|
Loading…
x
Reference in New Issue
Block a user