mirror of
https://github.com/cesanta/mongoose.git
synced 2025-06-07 17:42:30 +08:00
Make CC3200 SLFS use "SL:" prefix
This is to make it compatioble with "devices" used in TI's libc. Files without any "device" go to SPIFFS. PUBLISHED_FROM=9adb888951389ccc43974537ee827a8240d79988
This commit is contained in:
parent
96150bf568
commit
96310d761b
@ -25,8 +25,6 @@ VPATH = ../..
|
|||||||
|
|
||||||
MONGOOSE_FEATURES = \
|
MONGOOSE_FEATURES = \
|
||||||
-DMG_DISABLE_DIRECTORY_LISTING \
|
-DMG_DISABLE_DIRECTORY_LISTING \
|
||||||
-DMG_DISABLE_JSON_RPC \
|
|
||||||
-DMG_DISABLE_COAP \
|
|
||||||
-DMG_DISABLE_DAV \
|
-DMG_DISABLE_DAV \
|
||||||
-DMG_ENABLE_HTTP_STREAMING_MULTIPART \
|
-DMG_ENABLE_HTTP_STREAMING_MULTIPART \
|
||||||
-DMG_MAX_HTTP_HEADERS=20 \
|
-DMG_MAX_HTTP_HEADERS=20 \
|
||||||
|
@ -48,7 +48,9 @@
|
|||||||
#define BM222_ADDR 0x18
|
#define BM222_ADDR 0x18
|
||||||
#define TMP006_ADDR 0x41
|
#define TMP006_ADDR 0x41
|
||||||
|
|
||||||
struct sj_event {
|
extern int cc3200_fs_init();
|
||||||
|
|
||||||
|
struct event {
|
||||||
int type;
|
int type;
|
||||||
void *data;
|
void *data;
|
||||||
};
|
};
|
||||||
@ -110,7 +112,7 @@ static void mg_ev_handler(struct mg_connection *nc, int ev, void *p) {
|
|||||||
hm->method.p, (int) hm->uri.len, hm->uri.p));
|
hm->method.p, (int) hm->uri.len, hm->uri.p));
|
||||||
struct mg_serve_http_opts opts;
|
struct mg_serve_http_opts opts;
|
||||||
memset(&opts, 0, sizeof(opts));
|
memset(&opts, 0, sizeof(opts));
|
||||||
opts.document_root = ".";
|
opts.document_root = "SL:";
|
||||||
mg_serve_http(nc, (struct http_message *) p, opts);
|
mg_serve_http(nc, (struct http_message *) p, opts);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -285,7 +287,7 @@ static void mg_task(void *arg) {
|
|||||||
LOG(LL_INFO, ("MG task running"));
|
LOG(LL_INFO, ("MG task running"));
|
||||||
GPIO_IF_LedToggle(MCU_RED_LED_GPIO);
|
GPIO_IF_LedToggle(MCU_RED_LED_GPIO);
|
||||||
|
|
||||||
osi_MsgQCreate(&s_v7_q, "V7", sizeof(struct sj_event), 32 /* len */);
|
osi_MsgQCreate(&s_v7_q, "MG", sizeof(struct event), 32 /* len */);
|
||||||
|
|
||||||
sl_Start(NULL, NULL, NULL);
|
sl_Start(NULL, NULL, NULL);
|
||||||
if (!tmp006_init(TMP006_ADDR, TMP006_CONV_2, false)) {
|
if (!tmp006_init(TMP006_ADDR, TMP006_CONV_2, false)) {
|
||||||
@ -300,6 +302,8 @@ static void mg_task(void *arg) {
|
|||||||
LOG(LL_INFO, ("Accelerometer initialized"));
|
LOG(LL_INFO, ("Accelerometer initialized"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cc3200_fs_init();
|
||||||
|
|
||||||
if (strlen(WIFI_SSID) > 0) {
|
if (strlen(WIFI_SSID) > 0) {
|
||||||
int ret;
|
int ret;
|
||||||
SlSecParams_t sp;
|
SlSecParams_t sp;
|
||||||
@ -339,7 +343,7 @@ static void mg_task(void *arg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
struct sj_event e;
|
struct event e;
|
||||||
mg_mgr_poll(&mg_mgr, 0);
|
mg_mgr_poll(&mg_mgr, 0);
|
||||||
if (osi_MsgQRead(&s_v7_q, &e, 1) != OSI_OK) continue;
|
if (osi_MsgQRead(&s_v7_q, &e, 1) != OSI_OK) continue;
|
||||||
}
|
}
|
||||||
@ -373,6 +377,7 @@ int main() {
|
|||||||
setvbuf(stderr, NULL, _IOLBF, 0);
|
setvbuf(stderr, NULL, _IOLBF, 0);
|
||||||
cs_log_set_level(LL_INFO);
|
cs_log_set_level(LL_INFO);
|
||||||
cs_log_set_file(stdout);
|
cs_log_set_file(stdout);
|
||||||
|
|
||||||
LOG(LL_INFO, ("Hello, world!"));
|
LOG(LL_INFO, ("Hello, world!"));
|
||||||
|
|
||||||
MAP_PinTypeI2C(PIN_01, PIN_MODE_1); /* SDA */
|
MAP_PinTypeI2C(PIN_01, PIN_MODE_1); /* SDA */
|
||||||
@ -388,10 +393,10 @@ int main() {
|
|||||||
GPIO_IF_LedToggle(MCU_RED_LED_GPIO);
|
GPIO_IF_LedToggle(MCU_RED_LED_GPIO);
|
||||||
|
|
||||||
if (VStartSimpleLinkSpawnTask(8) != 0) {
|
if (VStartSimpleLinkSpawnTask(8) != 0) {
|
||||||
LOG(LL_ERROR, ("Failed to create SL task"));
|
LOG(LL_ERROR, ("Failed to create SL task"));
|
||||||
}
|
}
|
||||||
if (osi_TaskCreate(mg_task, (const signed char *) "mg", MG_TASK_STACK_SIZE, NULL, 3, NULL) != 0) {
|
if (osi_TaskCreate(mg_task, (const signed char *) "mg", MG_TASK_STACK_SIZE, NULL, 3, NULL) != 0) {
|
||||||
LOG(LL_ERROR, ("Failed to create MG task"));
|
LOG(LL_ERROR, ("Failed to create MG task"));
|
||||||
}
|
}
|
||||||
|
|
||||||
osi_start();
|
osi_start();
|
||||||
|
Loading…
Reference in New Issue
Block a user