Commit 96310d76 authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by rojer

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
parent 96150bf5
......@@ -25,8 +25,6 @@ VPATH = ../..
MONGOOSE_FEATURES = \
-DMG_DISABLE_DIRECTORY_LISTING \
-DMG_DISABLE_JSON_RPC \
-DMG_DISABLE_COAP \
-DMG_DISABLE_DAV \
-DMG_ENABLE_HTTP_STREAMING_MULTIPART \
-DMG_MAX_HTTP_HEADERS=20 \
......
......@@ -48,7 +48,9 @@
#define BM222_ADDR 0x18
#define TMP006_ADDR 0x41
struct sj_event {
extern int cc3200_fs_init();
struct event {
int type;
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));
struct mg_serve_http_opts opts;
memset(&opts, 0, sizeof(opts));
opts.document_root = ".";
opts.document_root = "SL:";
mg_serve_http(nc, (struct http_message *) p, opts);
break;
}
......@@ -285,7 +287,7 @@ static void mg_task(void *arg) {
LOG(LL_INFO, ("MG task running"));
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);
if (!tmp006_init(TMP006_ADDR, TMP006_CONV_2, false)) {
......@@ -300,6 +302,8 @@ static void mg_task(void *arg) {
LOG(LL_INFO, ("Accelerometer initialized"));
}
cc3200_fs_init();
if (strlen(WIFI_SSID) > 0) {
int ret;
SlSecParams_t sp;
......@@ -339,7 +343,7 @@ static void mg_task(void *arg) {
}
while (1) {
struct sj_event e;
struct event e;
mg_mgr_poll(&mg_mgr, 0);
if (osi_MsgQRead(&s_v7_q, &e, 1) != OSI_OK) continue;
}
......@@ -373,6 +377,7 @@ int main() {
setvbuf(stderr, NULL, _IOLBF, 0);
cs_log_set_level(LL_INFO);
cs_log_set_file(stdout);
LOG(LL_INFO, ("Hello, world!"));
MAP_PinTypeI2C(PIN_01, PIN_MODE_1); /* SDA */
......@@ -388,10 +393,10 @@ int main() {
GPIO_IF_LedToggle(MCU_RED_LED_GPIO);
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) {
LOG(LL_ERROR, ("Failed to create MG task"));
LOG(LL_ERROR, ("Failed to create MG task"));
}
osi_start();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment