mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-29 12:41:03 +00:00
Revert "Stop publish examples to mongoose repo"
This reverts commit 1a17e17c462bdd4e1d26d8742f8b7087273e04c2. PUBLISHED_FROM=80028de308c9a021955d1425d2bfee8feb85f193
This commit is contained in:
1 parent
7cc7df8c0e
commit
eaef5bd133
351 files changed
+195424
No files matched your search
@@ -0,0 +1,27 @@
|
||||
SDK ?= $(shell cat sdk.version)
|
||||
SRC_DIR ?= $(realpath ../../..)
|
||||
PORT ?= auto
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
MAKEFLAGS += w
|
||||
|
||||
all clean:
|
||||
docker run --rm -i -v $(SRC_DIR):/src $(SDK) \
|
||||
/bin/bash -c "\
|
||||
make -C /src/mongoose mongoose.c mongoose.h && \
|
||||
make -C /src/mongoose/examples/CC3200 -f Makefile.build $@ -$(MAKEFLAGS) \
|
||||
"
|
||||
|
||||
ifeq ("$(PORT)", "auto")
|
||||
PORT = $(shell ls -1 /dev/ttyUSB* | tail -n 1)
|
||||
endif
|
||||
flash:
|
||||
docker run --rm -it --privileged -v $(SRC_DIR):/src $(SDK) /bin/bash -c "\
|
||||
cd /usr/local/bin; \
|
||||
./cc3200prog $(PORT) /src/fw/platforms/cc3200/firmware/fw.bin \
|
||||
"
|
||||
|
||||
debug:
|
||||
docker run --rm -it --privileged -v $(SRC_DIR):/src $(SDK) \
|
||||
/bin/bash -c "cd /src/fw/platforms/cc3200 && tools/gdb.sh"
|
||||
@@ -0,0 +1,108 @@
|
||||
# -*- mode: makefile -*-
|
||||
# This file is executed inside Docker build container.
|
||||
# It can be used without container too if SDK_PATH is configured.
|
||||
|
||||
PLATFORM = CC3200
|
||||
SDK_PATH ?= /cc3200-sdk
|
||||
REPO_PATH ?= ../../..
|
||||
BUILD_DIR ?= ./.build
|
||||
FW_DIR ?= ./out
|
||||
SLFS_PATH ?= ./slfs
|
||||
|
||||
BINDIR = $(FW_DIR)
|
||||
OBJDIR = $(BUILD_DIR)
|
||||
|
||||
include $(SDK_PATH)/tools/gcc_scripts/makedefs
|
||||
|
||||
.PHONY: all clean flash
|
||||
|
||||
PROG = cc3200_example
|
||||
|
||||
IPATH = . ../.. $(REPO_PATH)
|
||||
|
||||
VPATH = ../..
|
||||
|
||||
MONGOOSE_FEATURES = -DMG_ENABLE_SSL -DMG_ENABLE_HTTP_STREAMING_MULTIPART
|
||||
|
||||
SDK_FLAGS = -DUSE_FREERTOS -DSL_PLATFORM_MULTI_THREADED
|
||||
# -DTARGET_IS_CC3200 would reduce code size by using functions in ROM
|
||||
# but then the code won't work on pre-release chips (XCC3200HZ).
|
||||
|
||||
CFLAGS += -Os -Wall -Werror \
|
||||
$(SDK_FLAGS) -DCS_PLATFORM=4 -DCC3200_FS_SLFS \
|
||||
$(MONGOOSE_FEATURES) $(CFLAGS_EXTRA)
|
||||
|
||||
FW_ELF = $(FW_DIR)/$(PROG).axf
|
||||
FW_BIN = $(FW_DIR)/$(PROG).bin
|
||||
FW_MANIFEST = $(FW_DIR)/manifest.json
|
||||
FW_ZIP = $(FW_DIR)/firmware.zip
|
||||
BUILD_INFO_JSON = $(OBJDIR)/build_info.json
|
||||
SLFS_FILES = $(wildcard $(SLFS_PATH)/*)
|
||||
|
||||
.PHONY: all clean flash
|
||||
|
||||
all: $(OBJDIR) $(FW_DIR) $(FW_ZIP)
|
||||
|
||||
clean:
|
||||
@rm -rf $(OBJDIR) $(wildcard *~)
|
||||
@rm -rf $(FW_DIR) $(wildcard *~)
|
||||
|
||||
$(OBJDIR):
|
||||
@echo " MKDIR $@"
|
||||
@mkdir -p $(OBJDIR) $(FS_BUILD_DIR)
|
||||
|
||||
$(FW_DIR):
|
||||
@echo " MKDIR $@"
|
||||
@mkdir -p $(FW_DIR)
|
||||
|
||||
$(FW_ZIP): $(FW_ELF) $(FW_BIN) $(SLFS_FILES)
|
||||
@echo " Code size: $(shell ls -l $(FW_BIN) | awk '{print $$5}')"
|
||||
@echo " GEN $(FW_MANIFEST)"
|
||||
@fw_meta gen_build_info \
|
||||
--json_output=$(BUILD_INFO_JSON)
|
||||
@cp -v $(SLFS_FILES) out/
|
||||
@cp $(CC3200_SP_FILE)* $(FW_DIR)
|
||||
@fw_meta create_manifest \
|
||||
--name=$(PROG) --platform=$(PLATFORM) \
|
||||
--build_info=$(BUILD_INFO_JSON) \
|
||||
--output=$(FW_MANIFEST) \
|
||||
--src_dir=$(FW_DIR) \
|
||||
/sys/servicepack.ucf:type=slfile,src=$(CC3200_SP_FILE),falloc=60416,sign=$(notdir $(CC3200_SP_FILE)).sign \
|
||||
$(notdir $(CC3200_SP_FILE)).sign:type=signature,src=$(CC3200_SP_FILE).sign \
|
||||
/sys/mcuimg.bin:type=app,src=$(notdir $(FW_BIN)) \
|
||||
$(foreach f,$(SLFS_FILES), $(notdir $(f)):type=slfile,src=$(notdir $(f)))
|
||||
@echo " ZIP $@"
|
||||
@fw_meta create_fw \
|
||||
--manifest=$(FW_MANIFEST) \
|
||||
--src_dir=$(FW_DIR) \
|
||||
--output=$@
|
||||
|
||||
FREERTOS_SRCS = timers.c list.c queue.c tasks.c port.c heap_3.c osi_freertos.c
|
||||
DRIVER_SRCS = cpu.c gpio.c gpio_if.c i2c.c i2c_if.c interrupt.c pin.c prcm.c spi.c uart.c udma.c utils.c
|
||||
SL_SRCS = socket.c wlan.c driver.c device.c netapp.c netcfg.c network_common.c cc_pal.c fs.c
|
||||
SDK_SRCS = startup_gcc.c $(FREERTOS_SRCS) $(DRIVER_SRCS) $(SL_SRCS)
|
||||
IPATH += $(SDK_PATH) $(SDK_PATH)/inc $(SDK_PATH)/driverlib \
|
||||
$(SDK_PATH)/example/common $(SDK_PATH)/oslib \
|
||||
$(SDK_PATH)/simplelink $(SDK_PATH)/simplelink/include \
|
||||
$(SDK_PATH)/simplelink_extlib/provisioninglib \
|
||||
$(SDK_PATH)/third_party/FreeRTOS/source \
|
||||
$(SDK_PATH)/third_party/FreeRTOS/source/include \
|
||||
$(SDK_PATH)/third_party/FreeRTOS/source/portable/GCC/ARM_CM4
|
||||
VPATH += $(SDK_PATH)/driverlib $(SDK_PATH)/example/common $(SDK_PATH)/oslib \
|
||||
$(SDK_PATH)/simplelink $(SDK_PATH)/simplelink/source \
|
||||
$(SDK_PATH)/third_party/FreeRTOS/source \
|
||||
$(SDK_PATH)/third_party/FreeRTOS/source/portable/GCC/ARM_CM4 \
|
||||
$(SDK_PATH)/third_party/FreeRTOS/source/portable/MemMang \
|
||||
|
||||
APP_SRCS = main.c bm222.c data.c mongoose.c tmp006.c wifi.c $(SDK_SRCS)
|
||||
APP_OBJS = $(addprefix $(OBJDIR)/,$(patsubst %.c,%.o,$(APP_SRCS)))
|
||||
|
||||
$(FW_ELF): $(APP_OBJS)
|
||||
|
||||
SCATTERgcc_$(PROG) = $(PROG).ld
|
||||
ENTRY_$(PROG) = ResetISR
|
||||
|
||||
# Disable certain warnings on SDK sources, we have no control over them anyway.
|
||||
|
||||
SDK_OBJS = $(addprefix $(OBJDIR)/,$(patsubst %.c,%.o,$(SDK_SRCS)))
|
||||
$(SDK_OBJS): CFLAGS += -include mongoose.h -Wno-missing-braces -Wno-strict-aliasing -Wno-parentheses -Wno-unused-variable
|
||||
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2016 Cesanta Software Limited
|
||||
* All rights reserved
|
||||
*/
|
||||
|
||||
#include "bm222.h"
|
||||
|
||||
#include "mongoose.h"
|
||||
#include "cs_dbg.h"
|
||||
|
||||
#include "i2c_if.h"
|
||||
|
||||
#define BM222_REG_FIFO_STATUS 0x0e
|
||||
|
||||
#define BM222_REG_PMU_BW 0x10
|
||||
#define BM222_PMU_BW_7_81_HZ 0x8
|
||||
#define BM222_PMU_BW_31_25_HZ 0xA
|
||||
#define BM222_PMU_BW_62_5_HZ 0xB
|
||||
#define BM222_PMU_BW_125_HZ 0xC
|
||||
|
||||
#define BM222_REG_BGW_SOFTRESET 0x14
|
||||
#define BM222_DO_SOFT_RESET 0xB6
|
||||
|
||||
#define BM222_REG_FIFO_CONFIG_1 0x3e
|
||||
#define BM222_FIFO_MODE_FIFO 0x40
|
||||
#define BM222_FIFO_DATA_ALL 0
|
||||
|
||||
#define BM222_REG_FIFO_DATA 0x3f
|
||||
|
||||
struct bm222_ctx *bm222_init(uint8_t addr) {
|
||||
struct bm222_ctx *ctx = (struct bm222_ctx *) calloc(1, sizeof(*ctx));
|
||||
if (ctx == NULL) return NULL;
|
||||
ctx->addr = addr;
|
||||
{
|
||||
unsigned char val[2] = {BM222_REG_BGW_SOFTRESET, BM222_DO_SOFT_RESET};
|
||||
if (I2C_IF_Write(addr, val, 2, 1) != 0) goto out_err;
|
||||
osi_Sleep(2 /* ms */); /* t_w,up1 = 1.8 ms */
|
||||
}
|
||||
if (!bm222_fifo_init(ctx)) return false;
|
||||
{
|
||||
unsigned char val[2] = {BM222_REG_PMU_BW, BM222_PMU_BW_125_HZ};
|
||||
if (I2C_IF_Write(addr, val, 2, 1) != 0) goto out_err;
|
||||
}
|
||||
return ctx;
|
||||
out_err:
|
||||
free(ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool bm222_fifo_init(struct bm222_ctx *ctx) {
|
||||
unsigned char val[2] = {BM222_REG_FIFO_CONFIG_1,
|
||||
BM222_FIFO_MODE_FIFO | BM222_FIFO_DATA_ALL};
|
||||
return (I2C_IF_Write(ctx->addr, val, 2, 1) == 0);
|
||||
}
|
||||
|
||||
bool bm222_get_data(struct bm222_ctx *ctx) {
|
||||
unsigned char reg = BM222_REG_FIFO_STATUS;
|
||||
unsigned char val;
|
||||
if (I2C_IF_ReadFrom(ctx->addr, ®, 1, &val, 1) < 0) return false;
|
||||
unsigned char len = (val & 0x7f);
|
||||
unsigned char overflow = (val & 0x80 ? 1 : 0);
|
||||
LOG(LL_DEBUG, ("FIFO len: %d (ovf? %d)", len, overflow));
|
||||
reg = BM222_REG_FIFO_DATA;
|
||||
int8_t fifo[32 * 6], *v = fifo;
|
||||
if (I2C_IF_ReadFrom(ctx->addr, ®, 1, (unsigned char *) fifo, len * 6) <
|
||||
0) {
|
||||
return false;
|
||||
}
|
||||
double now = mg_time();
|
||||
/* Of potentially multiple samples, pick one with maximum difference. */
|
||||
int32_t max_d = 0;
|
||||
bool sampled = false;
|
||||
struct bm222_sample *ls = ctx->data + ctx->last_index, *s = NULL;
|
||||
if (ls->ts == 0) {
|
||||
/* The very first sample. */
|
||||
ls->ts = now;
|
||||
ls->x = v[1];
|
||||
ls->y = v[3];
|
||||
ls->z = v[5];
|
||||
v += 6;
|
||||
len--;
|
||||
sampled = true;
|
||||
s = ls;
|
||||
}
|
||||
for (; len > 0; v += 6, len--) {
|
||||
int32_t dx = ((int32_t) v[1]) - ((int32_t) ls->x);
|
||||
int32_t dy = ((int32_t) v[3]) - ((int32_t) ls->y);
|
||||
int32_t dz = ((int32_t) v[5]) - ((int32_t) ls->z);
|
||||
int32_t d = dx * dx + dy * dy + dz * dz;
|
||||
if ((d > 2 && d > max_d) || (!sampled && now - ls->ts > 1.0)) {
|
||||
if (!sampled) {
|
||||
ctx->last_index = (ctx->last_index + 1) % BM222_NUM_SAMPLES;
|
||||
s = ctx->data + ctx->last_index;
|
||||
sampled = true;
|
||||
}
|
||||
s->ts = now;
|
||||
s->x = v[1];
|
||||
s->y = v[3];
|
||||
s->z = v[5];
|
||||
if (d > max_d) max_d = d;
|
||||
LOG(LL_VERBOSE_DEBUG, ("dx %d dy %d dz %d d %d", dx, dy, dz, d));
|
||||
}
|
||||
}
|
||||
return (overflow ? bm222_fifo_init(ctx) : true); /* Clear the ovf flag. */
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2016 Cesanta Software Limited
|
||||
* All rights reserved
|
||||
*/
|
||||
|
||||
#ifndef CS_MONGOOSE_EXAMPLES_CC3200_BM222_H_
|
||||
#define CS_MONGOOSE_EXAMPLES_CC3200_BM222_H_
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define BM222_NUM_SAMPLES 64
|
||||
struct bm222_ctx {
|
||||
uint8_t addr;
|
||||
struct bm222_sample {
|
||||
double ts;
|
||||
int8_t x;
|
||||
int8_t y;
|
||||
int8_t z;
|
||||
} data[BM222_NUM_SAMPLES];
|
||||
int last_index;
|
||||
};
|
||||
|
||||
struct bm222_ctx *bm222_init(uint8_t addr);
|
||||
bool bm222_fifo_init(struct bm222_ctx *ctx);
|
||||
bool bm222_get_data(struct bm222_ctx *ctx);
|
||||
|
||||
#endif /* CS_MONGOOSE_EXAMPLES_CC3200_BM222_H_ */
|
||||
@@ -0,0 +1,94 @@
|
||||
/*****************************************************************************
|
||||
* app.ld
|
||||
*
|
||||
* GCC Linker script for Mongoose OS. Based on TI's example "blinky.ld".
|
||||
*
|
||||
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
HEAP_SIZE = 0xB000;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
/* SRAM size of 240KB (0x3C000) for cc3200 ES 1.33 device onward,
|
||||
* 176KB (0x2C000) for XCC3200HZ (pre-release device). */
|
||||
SRAM (rwx) : ORIGIN = 0x20004000, LENGTH = 0x3C000
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
_text = .;
|
||||
KEEP(*(.intvecs))
|
||||
*(.text*)
|
||||
*(.rodata*)
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
. = ALIGN(8);
|
||||
_etext = .;
|
||||
} > SRAM
|
||||
|
||||
.ARM : {
|
||||
__exidx_start = .;
|
||||
*(.ARM.exidx*)
|
||||
__exidx_end = .;
|
||||
} > SRAM
|
||||
|
||||
__init_data = .;
|
||||
|
||||
.data : AT(__init_data)
|
||||
{
|
||||
_data = .;
|
||||
*(.data*)
|
||||
. = ALIGN (8);
|
||||
_edata = .;
|
||||
} > SRAM
|
||||
|
||||
.bss :
|
||||
{
|
||||
_bss = .;
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
_ebss = .;
|
||||
} > SRAM
|
||||
|
||||
.heap :
|
||||
{
|
||||
_heap = .;
|
||||
. = . + HEAP_SIZE;
|
||||
. = ALIGN(8);
|
||||
_eheap = .;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<?ccsproject version="1.0"?>
|
||||
<projectOptions>
|
||||
<deviceVariant value="Cortex M.CC3200"/>
|
||||
<deviceFamily value="TMS470"/>
|
||||
<deviceEndianness value="little"/>
|
||||
<codegenToolVersion value="5.2.7"/>
|
||||
<isElfFormat value="true"/>
|
||||
<connection value="common/targetdb/connections/Stellaris_ICDI_Connection.xml"/>
|
||||
<linkerCommandFile value="cc3200v1p32.cmd"/>
|
||||
<rts value="libc.a"/>
|
||||
<createSlaveProjects value=""/>
|
||||
<templateProperties value="id=com.ti.common.project.core.emptyProjectWithMainTemplate,"/>
|
||||
<isTargetManual value="false"/>
|
||||
</projectOptions>
|
||||
@@ -0,0 +1,218 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.2139411143">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.2139411143" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.2139411143" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep="" prebuildStep="">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.2139411143." name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.DebugToolchain.929985441" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.linkerDebug.273728804">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.258663176" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.CC3200"/>
|
||||
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
|
||||
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/>
|
||||
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=cc3200v1p32.cmd"/>
|
||||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.324606890" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.8" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformDebug.1595303251" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformDebug"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderDebug.664577987" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderDebug"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerDebug.239238133" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE.1334773591" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_FILESYSTEM=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_HTTP_STREAMING_MULTIPART=1"/>
|
||||
<listOptionValue builtIn="false" value="SL_PLATFORM_MULTI_THREADED=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_FS_SLFS=1"/>
|
||||
<listOptionValue builtIn="false" value="USE_FREERTOS"/>
|
||||
<listOptionValue builtIn="false" value="cc3200"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.731249297" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.1786958507" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.1146878710" name="Application binary interface. [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.eabi" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.627547538" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.vfplib" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN.1274157874" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH.1258458633" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink_extlib/provisioninglib""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/oslib""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/driverlib/""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink/""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink/include""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/inc""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/example/common""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}/../Mongoose""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}/../..""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}/../../../..""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEBUGGING_MODEL.441599099" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.1882962798" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER.988736284" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING.108721469" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="225"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.1654856947" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_FOR_SPEED.610557791" name="Speed vs. size trade-offs (--opt_for_speed, -mf)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_FOR_SPEED.0" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS.82765394" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS.1309113096" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS.637644727" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS.1237578949" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS.1197212538" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.linkerDebug.273728804" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.linkerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.STACK_SIZE.1521937237" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.STACK_SIZE" value="0x100" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.HEAP_SIZE.384792165" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.HEAP_SIZE" value="0xB000" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.MAP_FILE.1759256980" name="Link information (map) listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.OUTPUT_FILE.223170305" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.LIBRARY.941567896" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.LIBRARY" valueType="libs">
|
||||
<listOptionValue builtIn="false" value=""libc.a""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_ROOT}/../Mongoose/Debug/Mongoose.lib""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink/ccs/OS/simplelink.a""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/driverlib/ccs/Release/driverlib.a""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/oslib/ccs/free_rtos/free_rtos.a""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.SEARCH_PATH.1487719636" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.SEARCH_PATH" valueType="libPaths">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DISPLAY_ERROR_NUMBER.527313065" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DIAG_WRAP.470008330" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.XML_LINK_INFO.1060401668" name="Detailed link information data-base into <file> (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.UNUSED_SECTION_ELIMINATION.1518364136" name="Eliminate sections not needed in the executable (--unused_section_elimination)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.UNUSED_SECTION_ELIMINATION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.UNUSED_SECTION_ELIMINATION.on" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD_SRCS.703137823" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD2_SRCS.1106081123" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__GEN_CMDS.1215238770" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__GEN_CMDS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.hex.537525921" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.hex"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings">
|
||||
<externalSettings containerId="Mongoose;com.ti.ccstudio.buildDefinitions.TMS470.Debug.491265557" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier"/>
|
||||
</storageModule>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2030896039">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2030896039" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2030896039" name="Release" parent="com.ti.ccstudio.buildDefinitions.TMS470.Release" postbuildStep="" prebuildStep="">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2030896039." name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.ReleaseToolchain.203807862" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.linkerRelease.603260672">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1946983343" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.CC3200"/>
|
||||
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
|
||||
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/>
|
||||
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=cc3200v1p32.cmd"/>
|
||||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.541661556" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.8" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformRelease.1731528219" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformRelease"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderRelease.1517621311" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderRelease"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerRelease.1511107079" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerRelease">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE.709446512" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_FILESYSTEM=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_HTTP_STREAMING_MULTIPART=1"/>
|
||||
<listOptionValue builtIn="false" value="SL_PLATFORM_MULTI_THREADED=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_FS_SLFS=1"/>
|
||||
<listOptionValue builtIn="false" value="USE_FREERTOS"/>
|
||||
<listOptionValue builtIn="false" value="cc3200"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.25059129" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.1599303984" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.462249516" name="Application binary interface. [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.eabi" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.628710870" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.vfplib" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING.1313521771" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="225"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER.1137425146" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.1217155594" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH.1877995914" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink_extlib/provisioninglib""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/oslib""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/driverlib/""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink/""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink/include""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/inc""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/example/common""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}/../Mongoose""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}/../..""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}/../../../..""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN.1313166043" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.release.1366420658" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.release" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_FOR_SPEED.1169603203" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_FOR_SPEED.0" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS.884396305" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS.1552076672" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS.1932242817" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS.564471106" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.linkerRelease.603260672" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.linkerRelease">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.STACK_SIZE.999455186" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.STACK_SIZE" value="0x512" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.HEAP_SIZE.1142745068" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.HEAP_SIZE" value="0x0" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.OUTPUT_FILE.592894575" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.MAP_FILE.767606951" name="Link information (map) listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.XML_LINK_INFO.88933399" name="Detailed link information data-base into <file> (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DISPLAY_ERROR_NUMBER.670906651" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DIAG_WRAP.69171285" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.SEARCH_PATH.2058160037" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.SEARCH_PATH" valueType="libPaths">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/>
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.LIBRARY.1140912133" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.LIBRARY" valueType="libs">
|
||||
<listOptionValue builtIn="false" value=""libc.a""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_ROOT}/../Mongoose/Release/Mongoose.lib""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink/ccs/OS/simplelink.a""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/driverlib/ccs/Release/driverlib.a""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/oslib/ccs/free_rtos/free_rtos.a""/>
|
||||
</option>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD_SRCS.852025912" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD2_SRCS.445406552" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__GEN_CMDS.1688064227" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__GEN_CMDS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.hex.1751465904" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.hex"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings">
|
||||
<externalSettings containerId="Mongoose;com.ti.ccstudio.buildDefinitions.TMS470.Release.900958360" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier"/>
|
||||
</storageModule>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="MG_hello.com.ti.ccstudio.buildDefinitions.TMS470.ProjectType.218900570" name="ARM" projectType="com.ti.ccstudio.buildDefinitions.TMS470.ProjectType"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.language.mapping">
|
||||
<project-mappings>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.asmSource" language="com.ti.ccstudio.core.TIASMLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cHeader" language="com.ti.ccstudio.core.TIGCCLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cSource" language="com.ti.ccstudio.core.TIGCCLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxHeader" language="com.ti.ccstudio.core.TIGPPLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxSource" language="com.ti.ccstudio.core.TIGPPLanguage"/>
|
||||
</project-mappings>
|
||||
</storageModule>
|
||||
<storageModule moduleId="refreshScope"/>
|
||||
</cproject>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>MG_hello</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
<project>Mongoose</project>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.ti.ccstudio.core.ccsNature</nature>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>gpio_if.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>CC3200_SDK_ROOT/example/common/gpio_if.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>network_common.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>CC3200_SDK_ROOT/example/common/network_common.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>startup_ccs.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>CC3200_SDK_ROOT/example/common/startup_ccs.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wifi.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-2-PROJECT_LOC/wifi.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wifi.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-2-PROJECT_LOC/wifi.h</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
<variableList>
|
||||
<variable>
|
||||
<name>CC3200_SDK_ROOT</name>
|
||||
<value>$%7BTI_PRODUCTS_DIR%7D/CC3200SDK_1.2.0/cc3200-sdk</value>
|
||||
</variable>
|
||||
</variableList>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,82 @@
|
||||
//*****************************************************************************
|
||||
// cc3200v1p32.cmd
|
||||
//
|
||||
// CCS linker configuration file for cc3200 ES 1.32.
|
||||
//
|
||||
// Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
//*****************************************************************************
|
||||
|
||||
|
||||
--retain=g_pfnVectors
|
||||
|
||||
//*****************************************************************************
|
||||
// The following command line options are set as part of the CCS project.
|
||||
// If you are building using the command line, or for some reason want to
|
||||
// define them here, you can uncomment and modify these lines as needed.
|
||||
// If you are using CCS for building, it is probably better to make any such
|
||||
// modifications in your CCS project and leave this file alone.
|
||||
//*****************************************************************************
|
||||
|
||||
|
||||
//*****************************************************************************
|
||||
// The starting address of the application. Normally the interrupt vectors
|
||||
// must be located at the beginning of the application.
|
||||
//*****************************************************************************
|
||||
#define RAM_BASE 0x20004000
|
||||
|
||||
/* System memory map */
|
||||
|
||||
MEMORY
|
||||
{
|
||||
/* Application uses internal RAM for program and data */
|
||||
SRAM_CODE (RWX) : origin = 0x20004000, length = 0x20000
|
||||
SRAM_DATA (RWX) : origin = 0x20024000, length = 0x1C000
|
||||
}
|
||||
|
||||
/* Section allocation in memory */
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.intvecs: > RAM_BASE
|
||||
.init_array : > SRAM_CODE
|
||||
.vtable : > SRAM_CODE
|
||||
.text : > SRAM_CODE
|
||||
.const : > SRAM_CODE
|
||||
.cinit : > SRAM_CODE
|
||||
.pinit : > SRAM_CODE
|
||||
.data : > SRAM_DATA
|
||||
.bss : > SRAM_DATA
|
||||
.sysmem : > SRAM_DATA
|
||||
.stack : > SRAM_DATA(HIGH)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,246 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2016 Cesanta Software Limited
|
||||
* All rights reserved
|
||||
*/
|
||||
|
||||
/* Set up an AP or connect to existing WiFi network. */
|
||||
#define WIFI_AP_SSID "Mongoose"
|
||||
#define WIFI_AP_PASS ""
|
||||
#define WIFI_AP_CHAN 6
|
||||
// #define WIFI_STA_SSID "YourWiFi"
|
||||
// #define WIFI_STA_PASS "YourPass"
|
||||
|
||||
#define MGOS_TASK_PRIORITY 3
|
||||
#define MG_TASK_STACK_SIZE 8192
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <inc/hw_types.h>
|
||||
#include <inc/hw_ints.h>
|
||||
#include <inc/hw_memmap.h>
|
||||
|
||||
#include <driverlib/gpio.h>
|
||||
#include <driverlib/interrupt.h>
|
||||
#include <driverlib/pin.h>
|
||||
#include <driverlib/prcm.h>
|
||||
#include <driverlib/rom.h>
|
||||
#include <driverlib/rom_map.h>
|
||||
|
||||
#include <example/common/gpio_if.h>
|
||||
|
||||
/* Mongoose.h brings in SimpleLink support. Do not include simplelink.h. */
|
||||
#include <mongoose.h>
|
||||
|
||||
#include <simplelink/include/device.h>
|
||||
|
||||
#include "cs_dbg.h"
|
||||
#include "wifi.h"
|
||||
|
||||
void fs_slfs_set_new_file_size(const char *name, size_t size);
|
||||
|
||||
static const char *upload_form =
|
||||
"\
|
||||
<h1>Upload file</h1> \
|
||||
<form action='/upload' method='POST' enctype='multipart/form-data'> \
|
||||
<input type='file' name='file'> \
|
||||
<input type='submit' value='Upload'> \
|
||||
</form>";
|
||||
|
||||
static struct mg_str upload_fname(struct mg_connection *nc,
|
||||
struct mg_str fname) {
|
||||
struct mg_str lfn;
|
||||
char *fn = malloc(fname.len + 4);
|
||||
memcpy(fn, "SL:", 3);
|
||||
memcpy(fn + 3, fname.p, fname.len);
|
||||
fn[3 + fname.len] = '\0';
|
||||
if (nc->user_data != NULL) {
|
||||
intptr_t cl = (intptr_t) nc->user_data;
|
||||
if (cl >= 0) {
|
||||
fs_slfs_set_new_file_size(fn + 3, cl);
|
||||
}
|
||||
}
|
||||
lfn.len = fname.len + 4;
|
||||
lfn.p = fn;
|
||||
return lfn;
|
||||
}
|
||||
|
||||
void mg_ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
|
||||
LOG(LL_DEBUG, ("%p ev %d", nc, ev));
|
||||
|
||||
switch (ev) {
|
||||
case MG_EV_ACCEPT: {
|
||||
char addr[32];
|
||||
mg_sock_addr_to_str(&nc->sa, addr, sizeof(addr),
|
||||
MG_SOCK_STRINGIFY_IP | MG_SOCK_STRINGIFY_PORT);
|
||||
LOG(LL_INFO, ("Connection %p from %s", nc, addr));
|
||||
break;
|
||||
}
|
||||
case MG_EV_HTTP_REQUEST: {
|
||||
char addr[32];
|
||||
struct http_message *hm = (struct http_message *) ev_data;
|
||||
cs_stat_t st;
|
||||
mg_sock_addr_to_str(&nc->sa, addr, sizeof(addr),
|
||||
MG_SOCK_STRINGIFY_IP | MG_SOCK_STRINGIFY_PORT);
|
||||
LOG(LL_INFO,
|
||||
("HTTP request from %s: %.*s %.*s", addr, (int) hm->method.len,
|
||||
hm->method.p, (int) hm->uri.len, hm->uri.p));
|
||||
if (mg_vcmp(&hm->uri, "/upload") == 0 ||
|
||||
(mg_vcmp(&hm->uri, "/") == 0 && mg_stat("SL:index.html", &st) != 0)) {
|
||||
mg_send(nc, upload_form, strlen(upload_form));
|
||||
nc->flags |= MG_F_SEND_AND_CLOSE;
|
||||
break;
|
||||
}
|
||||
struct mg_serve_http_opts opts;
|
||||
memset(&opts, 0, sizeof(opts));
|
||||
opts.document_root = "SL:";
|
||||
mg_serve_http(nc, hm, opts);
|
||||
break;
|
||||
}
|
||||
case MG_EV_CLOSE: {
|
||||
LOG(LL_INFO, ("Connection %p closed", nc));
|
||||
break;
|
||||
}
|
||||
/* SimpleLink FS requires pre-declaring max file size. We use Content-Length
|
||||
* for that purpose - it will not exactly match file size, but is guaranteed
|
||||
* to exceed it and should be close enough. */
|
||||
case MG_EV_HTTP_MULTIPART_REQUEST: {
|
||||
struct http_message *hm = (struct http_message *) ev_data;
|
||||
struct mg_str *cl_header = mg_get_http_header(hm, "Content-Length");
|
||||
intptr_t cl = -1;
|
||||
if (cl_header != NULL && cl_header->len < 20) {
|
||||
char buf[20];
|
||||
memcpy(buf, cl_header->p, cl_header->len);
|
||||
buf[cl_header->len] = '\0';
|
||||
cl = atoi(buf);
|
||||
if (cl < 0) cl = -1;
|
||||
}
|
||||
nc->user_data = (void *) cl;
|
||||
break;
|
||||
}
|
||||
case MG_EV_HTTP_PART_BEGIN:
|
||||
case MG_EV_HTTP_PART_DATA:
|
||||
case MG_EV_HTTP_PART_END: {
|
||||
struct mg_http_multipart_part *mp =
|
||||
(struct mg_http_multipart_part *) ev_data;
|
||||
if (ev == MG_EV_HTTP_PART_BEGIN) {
|
||||
LOG(LL_INFO, ("Begin file upload: %s", mp->file_name));
|
||||
} else if (ev == MG_EV_HTTP_PART_END) {
|
||||
LOG(LL_INFO, ("End file upload: %s", mp->file_name));
|
||||
}
|
||||
mg_file_upload_handler(nc, ev, ev_data, upload_fname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void mg_init(struct mg_mgr *mgr) {
|
||||
LOG(LL_INFO, ("MG task running"));
|
||||
|
||||
stop_nwp(); /* See function description in wifi.c */
|
||||
LOG(LL_INFO, ("Starting NWP..."));
|
||||
int role = sl_Start(0, 0, 0);
|
||||
if (role < 0) {
|
||||
LOG(LL_ERROR, ("Failed to start NWP"));
|
||||
return;
|
||||
}
|
||||
|
||||
LOG(LL_INFO, ("NWP started"));
|
||||
|
||||
sl_fs_init();
|
||||
|
||||
#if defined(WIFI_STA_SSID)
|
||||
if (!wifi_setup_sta(WIFI_STA_SSID, WIFI_STA_PASS)) {
|
||||
LOG(LL_ERROR, ("Error setting up WiFi station"));
|
||||
}
|
||||
#elif defined(WIFI_AP_SSID)
|
||||
if (!wifi_setup_ap(WIFI_AP_SSID, WIFI_AP_PASS, WIFI_AP_CHAN)) {
|
||||
LOG(LL_ERROR, ("Error setting up WiFi AP"));
|
||||
}
|
||||
#else
|
||||
#error WiFi not configured
|
||||
#endif
|
||||
|
||||
/* We don't need SimpleLink's web server. */
|
||||
sl_NetAppStop(SL_NET_APP_HTTP_SERVER_ID);
|
||||
|
||||
const char *err = "";
|
||||
struct mg_bind_opts opts;
|
||||
memset(&opts, 0, sizeof(opts));
|
||||
opts.error_string = &err;
|
||||
|
||||
struct mg_connection *nc = mg_bind(mgr, "80", mg_ev_handler);
|
||||
if (nc != NULL) {
|
||||
mg_set_protocol_http_websocket(nc);
|
||||
} else {
|
||||
LOG(LL_ERROR, ("Failed to create listener: %s", err));
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef USE_TIRTOS
|
||||
/* Int vector table, defined in startup_gcc.c */
|
||||
extern void (*const g_pfnVectors[])(void);
|
||||
#endif
|
||||
|
||||
int main(void) {
|
||||
#ifndef USE_TIRTOS
|
||||
MAP_IntVTableBaseSet((unsigned long) &g_pfnVectors[0]);
|
||||
#endif
|
||||
MAP_IntEnable(FAULT_SYSTICK);
|
||||
MAP_IntMasterEnable();
|
||||
PRCMCC3200MCUInit();
|
||||
|
||||
setvbuf(stdout, NULL, _IOLBF, 0);
|
||||
setvbuf(stderr, NULL, _IOLBF, 0);
|
||||
cs_log_set_level(LL_INFO);
|
||||
cs_log_set_file(stdout);
|
||||
|
||||
LOG(LL_INFO, ("Hello, world!"));
|
||||
|
||||
/* Set up the red LED. Note that amber and green cannot be used as they share
|
||||
* pins with I2C. */
|
||||
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA1, PRCM_RUN_MODE_CLK);
|
||||
MAP_PinTypeGPIO(PIN_64, PIN_MODE_0, false);
|
||||
MAP_GPIODirModeSet(GPIOA1_BASE, 0x2, GPIO_DIR_MODE_OUT);
|
||||
GPIO_IF_LedConfigure(LED1);
|
||||
GPIO_IF_LedOn(MCU_RED_LED_GPIO);
|
||||
|
||||
if (VStartSimpleLinkSpawnTask(8) != 0) {
|
||||
LOG(LL_ERROR, ("Failed to create SL task"));
|
||||
}
|
||||
|
||||
if (!mg_start_task(MGOS_TASK_PRIORITY, MG_TASK_STACK_SIZE, mg_init)) {
|
||||
LOG(LL_ERROR, ("Failed to create MG task"));
|
||||
}
|
||||
|
||||
osi_start();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* These are FreeRTOS hooks for various life situations. */
|
||||
void vApplicationMallocFailedHook(void) {
|
||||
}
|
||||
|
||||
void vApplicationIdleHook(void) {
|
||||
}
|
||||
|
||||
void vApplicationStackOverflowHook(OsiTaskHandle *th, signed char *tn) {
|
||||
}
|
||||
|
||||
void SimpleLinkHttpServerCallback(SlHttpServerEvent_t *e,
|
||||
SlHttpServerResponse_t *resp) {
|
||||
}
|
||||
|
||||
void SimpleLinkSockEventHandler(SlSockEvent_t *e) {
|
||||
}
|
||||
|
||||
void SimpleLinkGeneralEventHandler(SlDeviceEvent_t *e) {
|
||||
LOG(LL_ERROR, ("status %d sender %d", e->EventData.deviceEvent.status,
|
||||
e->EventData.deviceEvent.sender));
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<configurations XML_version="1.2" id="configurations_0">
|
||||
<configuration XML_version="1.2" id="configuration_0">
|
||||
<instance XML_version="1.2" desc="Stellaris In-Circuit Debug Interface" href="connections/Stellaris_ICDI_Connection.xml" id="Stellaris In-Circuit Debug Interface" xml="Stellaris_ICDI_Connection.xml" xmlpath="connections"/>
|
||||
<connection XML_version="1.2" id="Stellaris In-Circuit Debug Interface">
|
||||
<instance XML_version="1.2" href="drivers/cc3200_cs_icepick.xml" id="drivers" xml="cc3200_cs_icepick.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/stellaris_cs_dap.xml" id="drivers" xml="stellaris_cs_dap.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/cc3200_cortex_m4.xml" id="drivers" xml="cc3200_cortex_m4.xml" xmlpath="drivers"/>
|
||||
<platform XML_version="1.2" id="platform_0">
|
||||
<instance XML_version="1.2" desc="CC3200" href="devices/CC3200.xml" id="CC3200" xml="CC3200.xml" xmlpath="devices"/>
|
||||
</platform>
|
||||
</connection>
|
||||
</configuration>
|
||||
</configurations>
|
||||
@@ -0,0 +1,9 @@
|
||||
The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based
|
||||
on the device and connection settings specified in your project on the Properties > General page.
|
||||
|
||||
Please note that in automatic target-configuration management, changes to the project's device and/or
|
||||
connection settings will either modify an existing or generate a new target-configuration file. Thus,
|
||||
if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively,
|
||||
you may create your own target-configuration file for this project and manage it manually. You can
|
||||
always switch back to automatic target-configuration management by checking the "Manage the project's
|
||||
target-configuration automatically" checkbox on the project's Properties > General page.
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<?ccsproject version="1.0"?>
|
||||
<projectOptions>
|
||||
<deviceVariant value="Cortex M.CC3200"/>
|
||||
<deviceFamily value="TMS470"/>
|
||||
<deviceEndianness value="little"/>
|
||||
<codegenToolVersion value="5.2.7"/>
|
||||
<isElfFormat value="true"/>
|
||||
<connection value="common/targetdb/connections/Stellaris_ICDI_Connection.xml"/>
|
||||
<linkerCommandFile value="cc3200v1p32.cmd"/>
|
||||
<rts value="libc.a"/>
|
||||
<createSlaveProjects value=""/>
|
||||
<templateProperties value="id=com.ti.common.project.core.emptyProjectWithMainTemplate,"/>
|
||||
<isTargetManual value="false"/>
|
||||
</projectOptions>
|
||||
@@ -0,0 +1,218 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.2139411143">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.2139411143" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.2139411143" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep="" prebuildStep="">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.2139411143." name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.DebugToolchain.929985441" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.linkerDebug.273728804">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.258663176" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.CC3200"/>
|
||||
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
|
||||
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/>
|
||||
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=cc3200v1p32.cmd"/>
|
||||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.324606890" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.8" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformDebug.1595303251" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformDebug"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderDebug.664577987" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderDebug"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerDebug.239238133" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE.1334773591" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_FILESYSTEM=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_HTTP_STREAMING_MULTIPART=1"/>
|
||||
<listOptionValue builtIn="false" value="SL_PLATFORM_MULTI_THREADED=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_FS_SLFS=1"/>
|
||||
<listOptionValue builtIn="false" value="USE_FREERTOS"/>
|
||||
<listOptionValue builtIn="false" value="cc3200"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.731249297" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.1786958507" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.1146878710" name="Application binary interface. [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.eabi" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.627547538" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.vfplib" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN.1274157874" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH.1258458633" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink_extlib/provisioninglib""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/oslib""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/driverlib/""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink/""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink/include""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/inc""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/example/common""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}/../Mongoose""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}/../..""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}/../../../..""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEBUGGING_MODEL.441599099" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.1882962798" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER.988736284" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING.108721469" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="225"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.1654856947" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_FOR_SPEED.610557791" name="Speed vs. size trade-offs (--opt_for_speed, -mf)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_FOR_SPEED.0" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS.1171949946" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS.1309113096" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS.637644727" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS.1237578949" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS.1197212538" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.linkerDebug.273728804" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.linkerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.STACK_SIZE.1521937237" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.STACK_SIZE" value="0x100" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.HEAP_SIZE.384792165" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.HEAP_SIZE" value="0xB000" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.MAP_FILE.1759256980" name="Link information (map) listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.OUTPUT_FILE.223170305" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.LIBRARY.941567896" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.LIBRARY" valueType="libs">
|
||||
<listOptionValue builtIn="false" value=""libc.a""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_ROOT}/../Mongoose/Debug/Mongoose.lib""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink/ccs/OS/simplelink.a""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/driverlib/ccs/Release/driverlib.a""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/oslib/ccs/free_rtos/free_rtos.a""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.SEARCH_PATH.1487719636" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.SEARCH_PATH" valueType="libPaths">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DISPLAY_ERROR_NUMBER.527313065" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DIAG_WRAP.470008330" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.XML_LINK_INFO.1060401668" name="Detailed link information data-base into <file> (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.UNUSED_SECTION_ELIMINATION.1575545300" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.UNUSED_SECTION_ELIMINATION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.UNUSED_SECTION_ELIMINATION.on" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD_SRCS.703137823" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD2_SRCS.1106081123" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__GEN_CMDS.1215238770" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__GEN_CMDS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.hex.537525921" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.hex"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings">
|
||||
<externalSettings containerId="Mongoose;com.ti.ccstudio.buildDefinitions.TMS470.Debug.491265557" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier"/>
|
||||
</storageModule>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2030896039">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2030896039" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2030896039" name="Release" parent="com.ti.ccstudio.buildDefinitions.TMS470.Release" postbuildStep="" prebuildStep="">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2030896039." name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.ReleaseToolchain.203807862" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.linkerRelease.603260672">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1946983343" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.CC3200"/>
|
||||
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
|
||||
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/>
|
||||
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=cc3200v1p32.cmd"/>
|
||||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.541661556" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.8" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformRelease.1731528219" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformRelease"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderRelease.1517621311" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderRelease"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerRelease.1511107079" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerRelease">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE.709446512" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_FILESYSTEM=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_HTTP_STREAMING_MULTIPART=1"/>
|
||||
<listOptionValue builtIn="false" value="SL_PLATFORM_MULTI_THREADED=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_FS_SLFS=1"/>
|
||||
<listOptionValue builtIn="false" value="USE_FREERTOS"/>
|
||||
<listOptionValue builtIn="false" value="cc3200"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.25059129" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.1599303984" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.462249516" name="Application binary interface. [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.eabi" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.628710870" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.vfplib" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING.1313521771" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="225"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER.1137425146" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.1217155594" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH.1877995914" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink_extlib/provisioninglib""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/oslib""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/driverlib/""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink/""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink/include""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/inc""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/example/common""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}/../Mongoose""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}/../..""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}/../../../..""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN.1313166043" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.release.1366420658" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.release" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_FOR_SPEED.1169603203" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_FOR_SPEED.0" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS.884396305" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS.1552076672" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS.1932242817" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS.564471106" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.linkerRelease.603260672" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.linkerRelease">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.STACK_SIZE.999455186" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.STACK_SIZE" value="0x512" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.HEAP_SIZE.1142745068" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.HEAP_SIZE" value="0x0" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.OUTPUT_FILE.592894575" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.MAP_FILE.767606951" name="Link information (map) listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.XML_LINK_INFO.88933399" name="Detailed link information data-base into <file> (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DISPLAY_ERROR_NUMBER.670906651" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DIAG_WRAP.69171285" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.SEARCH_PATH.2058160037" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.SEARCH_PATH" valueType="libPaths">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/>
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.LIBRARY.1140912133" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.LIBRARY" valueType="libs">
|
||||
<listOptionValue builtIn="false" value=""libc.a""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_ROOT}/../Mongoose/Release/Mongoose.lib""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink/ccs/OS/simplelink.a""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/driverlib/ccs/Release/driverlib.a""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/oslib/ccs/free_rtos/free_rtos.a""/>
|
||||
</option>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD_SRCS.852025912" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD2_SRCS.445406552" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__GEN_CMDS.1688064227" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__GEN_CMDS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.hex.1751465904" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.hex"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings">
|
||||
<externalSettings containerId="Mongoose;com.ti.ccstudio.buildDefinitions.TMS470.Release.900958360" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier"/>
|
||||
</storageModule>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="MG_sensor_demo.com.ti.ccstudio.buildDefinitions.TMS470.ProjectType.218900570" name="ARM" projectType="com.ti.ccstudio.buildDefinitions.TMS470.ProjectType"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.language.mapping">
|
||||
<project-mappings>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.asmSource" language="com.ti.ccstudio.core.TIASMLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cHeader" language="com.ti.ccstudio.core.TIGCCLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cSource" language="com.ti.ccstudio.core.TIGCCLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxHeader" language="com.ti.ccstudio.core.TIGPPLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxSource" language="com.ti.ccstudio.core.TIGPPLanguage"/>
|
||||
</project-mappings>
|
||||
</storageModule>
|
||||
<storageModule moduleId="refreshScope"/>
|
||||
</cproject>
|
||||
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>MG_sensor_demo</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
<project>Mongoose</project>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.ti.ccstudio.core.ccsNature</nature>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>bm222.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-2-PROJECT_LOC/bm222.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>bm222.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-2-PROJECT_LOC/bm222.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>data.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-2-PROJECT_LOC/data.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>data.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-2-PROJECT_LOC/data.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>gpio_if.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>CC3200_SDK_ROOT/example/common/gpio_if.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>i2c_if.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>CC3200_SDK_ROOT/example/common/i2c_if.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>main.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-2-PROJECT_LOC/main.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>network_common.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>CC3200_SDK_ROOT/example/common/network_common.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>startup_ccs.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>CC3200_SDK_ROOT/example/common/startup_ccs.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>tmp006.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-2-PROJECT_LOC/tmp006.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>tmp006.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-2-PROJECT_LOC/tmp006.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wifi.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-2-PROJECT_LOC/wifi.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wifi.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-2-PROJECT_LOC/wifi.h</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
<variableList>
|
||||
<variable>
|
||||
<name>CC3200_SDK_ROOT</name>
|
||||
<value>$%7BTI_PRODUCTS_DIR%7D/CC3200SDK_1.2.0/cc3200-sdk</value>
|
||||
</variable>
|
||||
</variableList>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,82 @@
|
||||
//*****************************************************************************
|
||||
// cc3200v1p32.cmd
|
||||
//
|
||||
// CCS linker configuration file for cc3200 ES 1.32.
|
||||
//
|
||||
// Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
//*****************************************************************************
|
||||
|
||||
|
||||
--retain=g_pfnVectors
|
||||
|
||||
//*****************************************************************************
|
||||
// The following command line options are set as part of the CCS project.
|
||||
// If you are building using the command line, or for some reason want to
|
||||
// define them here, you can uncomment and modify these lines as needed.
|
||||
// If you are using CCS for building, it is probably better to make any such
|
||||
// modifications in your CCS project and leave this file alone.
|
||||
//*****************************************************************************
|
||||
|
||||
|
||||
//*****************************************************************************
|
||||
// The starting address of the application. Normally the interrupt vectors
|
||||
// must be located at the beginning of the application.
|
||||
//*****************************************************************************
|
||||
#define RAM_BASE 0x20004000
|
||||
|
||||
/* System memory map */
|
||||
|
||||
MEMORY
|
||||
{
|
||||
/* Application uses internal RAM for program and data */
|
||||
SRAM_CODE (RWX) : origin = 0x20004000, length = 0x20000
|
||||
SRAM_DATA (RWX) : origin = 0x20024000, length = 0x1C000
|
||||
}
|
||||
|
||||
/* Section allocation in memory */
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.intvecs: > RAM_BASE
|
||||
.init_array : > SRAM_CODE
|
||||
.vtable : > SRAM_CODE
|
||||
.text : > SRAM_CODE
|
||||
.const : > SRAM_CODE
|
||||
.cinit : > SRAM_CODE
|
||||
.pinit : > SRAM_CODE
|
||||
.data : > SRAM_DATA
|
||||
.bss : > SRAM_DATA
|
||||
.sysmem : > SRAM_DATA
|
||||
.stack : > SRAM_DATA(HIGH)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<configurations XML_version="1.2" id="configurations_0">
|
||||
<configuration XML_version="1.2" id="configuration_0">
|
||||
<instance XML_version="1.2" desc="Stellaris In-Circuit Debug Interface" href="connections/Stellaris_ICDI_Connection.xml" id="Stellaris In-Circuit Debug Interface" xml="Stellaris_ICDI_Connection.xml" xmlpath="connections"/>
|
||||
<connection XML_version="1.2" id="Stellaris In-Circuit Debug Interface">
|
||||
<instance XML_version="1.2" href="drivers/cc3200_cs_icepick.xml" id="drivers" xml="cc3200_cs_icepick.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/stellaris_cs_dap.xml" id="drivers" xml="stellaris_cs_dap.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/cc3200_cortex_m4.xml" id="drivers" xml="cc3200_cortex_m4.xml" xmlpath="drivers"/>
|
||||
<platform XML_version="1.2" id="platform_0">
|
||||
<instance XML_version="1.2" desc="CC3200" href="devices/CC3200.xml" id="CC3200" xml="CC3200.xml" xmlpath="devices"/>
|
||||
</platform>
|
||||
</connection>
|
||||
</configuration>
|
||||
</configurations>
|
||||
@@ -0,0 +1,9 @@
|
||||
The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based
|
||||
on the device and connection settings specified in your project on the Properties > General page.
|
||||
|
||||
Please note that in automatic target-configuration management, changes to the project's device and/or
|
||||
connection settings will either modify an existing or generate a new target-configuration file. Thus,
|
||||
if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively,
|
||||
you may create your own target-configuration file for this project and manage it manually. You can
|
||||
always switch back to automatic target-configuration management by checking the "Manage the project's
|
||||
target-configuration automatically" checkbox on the project's Properties > General page.
|
||||
@@ -0,0 +1,2 @@
|
||||
clean:
|
||||
rm -rf */Debug */Release */.launches */.settings */.xdchelp */src
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<?ccsproject version="1.0"?>
|
||||
<projectOptions>
|
||||
<deviceVariant value="Cortex M.CC3200"/>
|
||||
<deviceFamily value="TMS470"/>
|
||||
<deviceEndianness value="little"/>
|
||||
<codegenToolVersion value="5.2.7"/>
|
||||
<isElfFormat value="true"/>
|
||||
<connection value="common/targetdb/connections/Stellaris_ICDI_Connection.xml"/>
|
||||
<createSlaveProjects value=""/>
|
||||
<templateProperties value="id=com.ti.common.project.core.emptyProjectWithMainTemplate,"/>
|
||||
<isTargetManual value="false"/>
|
||||
</projectOptions>
|
||||
@@ -0,0 +1,166 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.491265557">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.491265557" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="lib" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.491265557" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep="" prebuildStep="">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.491265557." name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.libraryDebugToolchain.244233268" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.libraryDebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.librarianDebug.1509527371">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1442571441" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.CC3200"/>
|
||||
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
|
||||
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=staticLibrary"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1832131686" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.8" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.targetPlatformDebug.299496807" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.targetPlatformDebug"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.builderDebug.120381516" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.builderDebug"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.compilerDebug.272902152" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.compilerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE.2068422510" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_FILESYSTEM=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_HTTP_STREAMING_MULTIPART=1"/>
|
||||
<listOptionValue builtIn="false" value="SL_PLATFORM_MULTI_THREADED=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_FS_SLFS=1"/>
|
||||
<listOptionValue builtIn="false" value="cc3200"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.1338331575" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.1347923655" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.1255051417" name="Application binary interface. [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.eabi" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.776774167" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.vfplib" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEBUGGING_MODEL.42164570" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING.1942824714" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="225"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER.1603355331" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.236456106" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH.1427839717" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink_extlib/provisioninglib""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink/include""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/oslib""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}/../..""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}/../../../..""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN.2146523713" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.1654856947" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_FOR_SPEED.610557791" name="Speed vs. size trade-offs (--opt_for_speed, -mf)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_FOR_SPEED.0" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS.184955523" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS.677106420" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS.844089326" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS.512556736" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS.845246795" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.librarianDebug.1509527371" name="ARM Archiver" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.librarianDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.archiverID.OUTPUT_FILE.1154288099" name="Output file" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.archiverID.OUTPUT_FILE" value=""${ProjName}.lib"" valueType="string"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Release.900958360">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.900958360" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="lib" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.900958360" name="Release" parent="com.ti.ccstudio.buildDefinitions.TMS470.Release" postbuildStep="" prebuildStep="">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Release.900958360." name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.ReleaseToolchain.1361429433" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.librarianRelease.761130555">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.684085319" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.CC3200"/>
|
||||
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
|
||||
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=staticLibrary"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1385252318" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.8" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.targetPlatformRelease.1983840374" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.targetPlatformRelease"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.builderRelease.1696443488" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.builderRelease"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.compilerRelease.1871833554" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.compilerRelease">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE.1633469996" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_FILESYSTEM=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_HTTP_STREAMING_MULTIPART=1"/>
|
||||
<listOptionValue builtIn="false" value="SL_PLATFORM_MULTI_THREADED=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_FS_SLFS=1"/>
|
||||
<listOptionValue builtIn="false" value="cc3200"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.627114921" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.297847373" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.906178230" name="Application binary interface. [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.eabi" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.1539769902" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.vfplib" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING.498836379" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="225"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER.1464954868" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.1547084924" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH.1070323914" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink_extlib/provisioninglib""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/simplelink/include""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}/oslib""/>
|
||||
<listOptionValue builtIn="false" value=""${CC3200_SDK_ROOT}""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}/../..""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_LOC}/../../../..""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN.1988330306" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.library.release.1366420658" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.library.release" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_FOR_SPEED.1169603203" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_FOR_SPEED.0" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS.2007627314" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS.800017124" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS.198177467" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS.1388857952" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.librarianRelease.761130555" name="ARM Archiver" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.librarianRelease">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.archiverID.OUTPUT_FILE.1312006799" name="Output file" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.archiverID.OUTPUT_FILE" value=""${ProjName}.lib"" valueType="string"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="cc3200v1p32.cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="Mongoose.com.ti.ccstudio.buildDefinitions.TMS470.ProjectType.368747604" name="ARM" projectType="com.ti.ccstudio.buildDefinitions.TMS470.ProjectType"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.language.mapping">
|
||||
<project-mappings>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.asmSource" language="com.ti.ccstudio.core.TIASMLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cHeader" language="com.ti.ccstudio.core.TIGCCLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cSource" language="com.ti.ccstudio.core.TIGCCLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxHeader" language="com.ti.ccstudio.core.TIGPPLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxSource" language="com.ti.ccstudio.core.TIGPPLanguage"/>
|
||||
</project-mappings>
|
||||
</storageModule>
|
||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||
<configuration configurationName="Release">
|
||||
<resource resourceType="PROJECT" workspacePath="/Mongoose"/>
|
||||
</configuration>
|
||||
<configuration configurationName="Debug">
|
||||
<resource resourceType="PROJECT" workspacePath="/Mongoose"/>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
</cproject>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Mongoose</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.ti.ccstudio.core.ccsNature</nature>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>mongoose.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-4-PROJECT_LOC/mongoose.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>mongoose.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-4-PROJECT_LOC/mongoose.h</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
<variableList>
|
||||
<variable>
|
||||
<name>CC3200_SDK_ROOT</name>
|
||||
<value>$%7BTI_PRODUCTS_DIR%7D/CC3200SDK_1.2.0/cc3200-sdk</value>
|
||||
</variable>
|
||||
</variableList>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,57 @@
|
||||
# Code Composer Studio example projects
|
||||
|
||||
To run them you will need:
|
||||
- [CC3200-LAUNCHXL](http://www.ti.com/tool/cc3200-launchxl) dev board.
|
||||
- [CC3200SDK 1.2.0](http://www.ti.com/tool/cc3200sdk) installed in `TI_PRODUCTS_DIR/CC3200SDK_1.2.0` (typically `C:\ti\CC3200SDK_1.2.0` on Windows, `/home/USER/ti/CC3200SDK_1.2.0` on Linux).
|
||||
- The latest CC3200SDK-SERVICEPACK should also be installed and flashed to the device
|
||||
- Code Composer Studio 6 IDE
|
||||
- Mongoose source code. Either clone the [Git repo](https://github.com/cesanta/mongoose.git) or download the [ZIP archive](https://github.com/cesanta/mongoose/archive/master.zip).
|
||||
|
||||
## Mongoose - The library project
|
||||
This project produces `Mongoose.lib` - a static library meant to be used by other projects.
|
||||
Feel free to use it as a dependency for your own projects or just copy `mongoose.c` and `mongoose.h`.
|
||||
Note that by default a lot of features are enabled, including file serving (which we use in our examples).
|
||||
You can trim a lot of fat by turning various build options off.
|
||||
A minimal HTTP serving configuration is about 25 K (compiled for ARM® Cortex®M4 with GCC 4.9 with size optimization on).
|
||||
|
||||
## MG_hello - A simple demo
|
||||
MG_hello project is a simple web server that serves files from the SimpleLink file system and allows them to be uploaded.
|
||||
This project depends on the Mongoose library project, make sure you import them both.
|
||||
When importing, ensure the “copy project to workspace” checkbox is *unchecked*, otherwise file references will be broken.
|
||||
|
||||
When built and run on the device, by default, the example will set up a Wi-Fi network called “Mongoose” (no password).
|
||||
|
||||
Assuming everything works, you should see the following output in CIO:
|
||||
|
||||
```
|
||||
main Hello, world!
|
||||
mg_init MG task running
|
||||
mg_init Starting NWP...
|
||||
mg_init NWP started
|
||||
wifi_setup_ap WiFi: AP Mongoose configured
|
||||
```
|
||||
|
||||
Note: If the demo does not proceed past “Starting NWP…”, please reset the board (possibly related to [this](https://e2e.ti.com/support/wireless_connectivity/simplelink_wifi_cc31xx_cc32xx/f/968/p/499123/1806610#1806610) and our [workaround](https://github.com/cesanta/mongoose/commit/848c884fff80de03051344e230392a68d4b51b84) is not always effective).
|
||||
|
||||
And after connecting to Wi-Fi network Mongoose, the following page on http://192.168.4.1/:
|
||||
|
||||
<img src="upload_form.png" width="364" height="239">
|
||||
|
||||
Pick a small file (say favicon.ico) and upload.
|
||||
You should get “Ok, favicon.ico - 16958 bytes.” and it will be served back to you ([link](http://192.168.4.1/)).
|
||||
If you upload index.html, it will be served instead of the form (but the form will be accessible at [/upload](http://192.168.4.1/upload)).
|
||||
|
||||
## MG_sensor_demo - A more elaborate demo project
|
||||
|
||||
This demo shows the use of [timers](https://docs.cesanta.com/mongoose/latest/#/c-api/net.h/mg_set_timer/) and serving a WebSocket data stream to (potentially) multiple subscribers.
|
||||
Data from the on-board temperature sensors and accelerometer is streamed to any clients connected over WebSocket, which allows building of responsive, near-real time dashboards.
|
||||
|
||||
The main [event handler function](https://github.com/cesanta/mongoose/blob/master/examples/CC3200/main.c#L81) in main.c does everything MG_hello’s function does, but also handles the websocket connection event - when `MG_EV_WEBSOCKET_HANDSHAKE_DONE` arrives, it switches the event handler to a different one - data_conn_handler (defined [here](https://github.com/cesanta/mongoose/blob/master/examples/CC3200/data.c#L144) in data.c). Doing this is not required, but it keeps the code modular and function size manageable.
|
||||
|
||||
Data acquisition is performed at regular intervals by a timer. Mongoose timers are not very accurate (remember - everything is executed in single thread), but good enough for this case.The timer is first set [in mg_init()](https://github.com/cesanta/mongoose/blob/master/examples/CC3200/main.c#L200), and the `MG_EV_TIMER` event is handled [in the main handler](https://github.com/cesanta/mongoose/blob/master/examples/CC3200/main.c#L123). Mongoose timers must be re-armed manually.
|
||||
|
||||
To try this demo from Code Composer Studio IDE, follow the steps above for MG_hello. Same as for MG_hello, you will only see an upload for initially. Please upload `main.js` and `index.html` from the [slfs directory](https://github.com/cesanta/mongoose/tree/master/examples/CC3200/slfs) and reload the page. You should see something like this:
|
||||
|
||||
<img src="sensor_demo.png" width="770" height="856">
|
||||
|
||||
[This short video](https://youtu.be/T0aFUKIBZxk) shows the demo in action.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 137 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2016 Cesanta Software Limited
|
||||
* All rights reserved
|
||||
*/
|
||||
|
||||
#ifndef CS_COMMON_CS_DBG_H_
|
||||
#define CS_COMMON_CS_DBG_H_
|
||||
|
||||
#if CS_ENABLE_STDIO
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifndef CS_ENABLE_DEBUG
|
||||
#define CS_ENABLE_DEBUG 0
|
||||
#endif
|
||||
|
||||
#ifndef CS_LOG_ENABLE_TS_DIFF
|
||||
#define CS_LOG_ENABLE_TS_DIFF 0
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
enum cs_log_level {
|
||||
LL_NONE = -1,
|
||||
LL_ERROR = 0,
|
||||
LL_WARN = 1,
|
||||
LL_INFO = 2,
|
||||
LL_DEBUG = 3,
|
||||
LL_VERBOSE_DEBUG = 4,
|
||||
|
||||
_LL_MIN = -2,
|
||||
_LL_MAX = 5,
|
||||
};
|
||||
|
||||
void cs_log_set_level(enum cs_log_level level);
|
||||
|
||||
#if CS_ENABLE_STDIO
|
||||
|
||||
void cs_log_set_file(FILE *file);
|
||||
|
||||
extern enum cs_log_level cs_log_level;
|
||||
void cs_log_print_prefix(const char *func);
|
||||
void cs_log_printf(const char *fmt, ...);
|
||||
|
||||
#define LOG(l, x) \
|
||||
if (cs_log_level >= l) { \
|
||||
cs_log_print_prefix(__func__); \
|
||||
cs_log_printf x; \
|
||||
}
|
||||
|
||||
#ifndef CS_NDEBUG
|
||||
|
||||
#define DBG(x) \
|
||||
if (cs_log_level >= LL_VERBOSE_DEBUG) { \
|
||||
cs_log_print_prefix(__func__); \
|
||||
cs_log_printf x; \
|
||||
}
|
||||
|
||||
#else /* NDEBUG */
|
||||
|
||||
#define DBG(x)
|
||||
|
||||
#endif
|
||||
|
||||
#else /* CS_ENABLE_STDIO */
|
||||
|
||||
#define LOG(l, x)
|
||||
#define DBG(x)
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* CS_COMMON_CS_DBG_H_ */
|
||||
@@ -0,0 +1,179 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2016 Cesanta Software Limited
|
||||
* All rights reserved
|
||||
*/
|
||||
|
||||
#include "data.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "gpio_if.h"
|
||||
|
||||
#include "bm222.h"
|
||||
#include "tmp006.h"
|
||||
#include "cs_dbg.h"
|
||||
|
||||
struct temp_data {
|
||||
double ts;
|
||||
double volt;
|
||||
double temp;
|
||||
};
|
||||
|
||||
struct conn_state {
|
||||
struct temp_data td;
|
||||
double last_sent_td;
|
||||
unsigned char led;
|
||||
double last_sent_led;
|
||||
double last_sent_acc;
|
||||
};
|
||||
|
||||
static int s_tmp006_addr;
|
||||
static struct temp_data s_temp_data;
|
||||
static struct bm222_ctx *s_accel_ctx;
|
||||
|
||||
void data_init_sensors(int tmp006_addr, int bm222_addr) {
|
||||
s_tmp006_addr = tmp006_addr;
|
||||
if (!tmp006_init(tmp006_addr, TMP006_CONV_2, false)) {
|
||||
LOG(LL_ERROR, ("Failed to init temperature sensor"));
|
||||
} else {
|
||||
LOG(LL_INFO, ("Temperature sensor initialized"));
|
||||
}
|
||||
s_accel_ctx = bm222_init(bm222_addr);
|
||||
if (s_accel_ctx == NULL) {
|
||||
LOG(LL_ERROR, ("Failed to init accelerometer"));
|
||||
} else {
|
||||
LOG(LL_INFO, ("Accelerometer initialized"));
|
||||
}
|
||||
}
|
||||
|
||||
void data_collect(void) {
|
||||
double volt = tmp006_read_sensor_voltage(s_tmp006_addr);
|
||||
double temp = tmp006_read_die_temp(s_tmp006_addr);
|
||||
if (volt != TMP006_INVALID_READING && temp != TMP006_INVALID_READING) {
|
||||
s_temp_data.temp = temp;
|
||||
s_temp_data.volt = volt;
|
||||
s_temp_data.ts = mg_time();
|
||||
LOG(LL_DEBUG, ("V = %lf mV, T = %lf C", volt, temp));
|
||||
}
|
||||
bm222_get_data(s_accel_ctx);
|
||||
}
|
||||
|
||||
static void send_temp(struct mg_connection *nc, const struct temp_data *td) {
|
||||
if (td->ts == 0) return;
|
||||
mg_printf_websocket_frame(nc, WEBSOCKET_OP_TEXT,
|
||||
"{\"t\": 0, \"ts\": %lf, \"sv\": %lf, \"dt\": %lf}",
|
||||
td->ts, td->volt, td->temp);
|
||||
}
|
||||
|
||||
static void send_led(struct mg_connection *nc, double ts, unsigned char led) {
|
||||
if (ts == 0) return;
|
||||
mg_printf_websocket_frame(nc, WEBSOCKET_OP_TEXT,
|
||||
"{\"t\": 1, \"ts\": %lf, \"v\": %d}", ts, led);
|
||||
}
|
||||
|
||||
static void send_acc_sample(struct mg_connection *nc,
|
||||
const struct bm222_sample *s) {
|
||||
if (s->ts == 0) return;
|
||||
mg_printf_websocket_frame(
|
||||
nc, WEBSOCKET_OP_TEXT,
|
||||
"{\"t\": 2, \"ts\": %lf, \"x\": %d, \"y\": %d, \"z\": %d}", s->ts, s->x,
|
||||
s->y, s->z);
|
||||
}
|
||||
|
||||
static double send_acc_data_since(struct mg_connection *nc,
|
||||
const struct bm222_ctx *ctx, double since) {
|
||||
int i = (ctx->last_index + 1) % BM222_NUM_SAMPLES, n = BM222_NUM_SAMPLES;
|
||||
double last_sent_ts = 0;
|
||||
for (; n > 0; i = (i + 1) % BM222_NUM_SAMPLES, n--) {
|
||||
const struct bm222_sample *s = ctx->data + i;
|
||||
if (s->ts <= since) continue;
|
||||
send_acc_sample(nc, s);
|
||||
last_sent_ts = s->ts;
|
||||
}
|
||||
return last_sent_ts;
|
||||
}
|
||||
|
||||
static void process_command(struct mg_connection *nc, unsigned char *data,
|
||||
size_t len) {
|
||||
// TODO(lsm): use proper JSON parser
|
||||
int cmd, val;
|
||||
if (sscanf((char *) data, "{\"t\":%d,\"v\":%d}", &cmd, &val) != 2) {
|
||||
LOG(LL_ERROR, ("Invalid request: %.*s", (int) len, data));
|
||||
return;
|
||||
}
|
||||
if (cmd == 1) {
|
||||
switch (val) {
|
||||
case '0': {
|
||||
GPIO_IF_LedOff(MCU_RED_LED_GPIO);
|
||||
break;
|
||||
}
|
||||
case '1': {
|
||||
GPIO_IF_LedOn(MCU_RED_LED_GPIO);
|
||||
break;
|
||||
}
|
||||
case '2': {
|
||||
GPIO_IF_LedToggle(MCU_RED_LED_GPIO);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
LOG(LL_ERROR, ("Invalid value: %.*s", (int) len, data));
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
LOG(LL_ERROR, ("Unknown command: %.*s", (int) len, data));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void data_conn_handler(struct mg_connection *nc, int ev, void *ev_data) {
|
||||
struct conn_state *cs = (struct conn_state *) nc->user_data;
|
||||
if (cs == NULL) {
|
||||
cs = (struct conn_state *) calloc(1, sizeof(*cs));
|
||||
nc->user_data = cs;
|
||||
}
|
||||
switch (ev) {
|
||||
case MG_EV_POLL:
|
||||
case MG_EV_TIMER: {
|
||||
const double now = mg_time();
|
||||
const unsigned char led = GPIO_IF_LedStatus(MCU_RED_LED_GPIO);
|
||||
/* Send if there was a change or repeat last data every second. */
|
||||
if (s_temp_data.volt != cs->td.volt || s_temp_data.temp != cs->td.temp ||
|
||||
now > cs->last_sent_td + 1.0) {
|
||||
memcpy(&cs->td, &s_temp_data, sizeof(cs->td));
|
||||
send_temp(nc, &cs->td);
|
||||
cs->last_sent_td = now;
|
||||
}
|
||||
if (led != cs->led || now > cs->last_sent_led + 1.0) {
|
||||
send_led(nc, now, led);
|
||||
cs->led = led;
|
||||
cs->last_sent_led = now;
|
||||
}
|
||||
if (s_accel_ctx != NULL) {
|
||||
const struct bm222_sample *ls =
|
||||
s_accel_ctx->data + s_accel_ctx->last_index;
|
||||
if (cs->last_sent_acc == 0) {
|
||||
send_acc_sample(nc, ls);
|
||||
cs->last_sent_acc = ls->ts;
|
||||
} else {
|
||||
double last_sent_ts =
|
||||
send_acc_data_since(nc, s_accel_ctx, cs->last_sent_acc);
|
||||
if (last_sent_ts > 0) cs->last_sent_acc = last_sent_ts;
|
||||
}
|
||||
}
|
||||
nc->ev_timer_time = now + 0.05;
|
||||
break;
|
||||
}
|
||||
case MG_EV_WEBSOCKET_FRAME: {
|
||||
struct websocket_message *wm = (struct websocket_message *) ev_data;
|
||||
process_command(nc, wm->data, wm->size);
|
||||
break;
|
||||
}
|
||||
case MG_EV_CLOSE: {
|
||||
LOG(LL_INFO, ("%p closed", nc));
|
||||
free(cs);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2016 Cesanta Software Limited
|
||||
* All rights reserved
|
||||
*/
|
||||
|
||||
#ifndef CS_MONGOOSE_EXAMPLES_CC3200_DATA_H_
|
||||
#define CS_MONGOOSE_EXAMPLES_CC3200_DATA_H_
|
||||
|
||||
#include "mongoose.h"
|
||||
|
||||
void data_collect(void);
|
||||
void data_init_sensors(int tmp006_addr, int bm222_addr);
|
||||
void data_conn_handler(struct mg_connection *nc, int ev, void *p);
|
||||
|
||||
#endif /* CS_MONGOOSE_EXAMPLES_CC3200_DATA_H_ */
|
||||
@@ -0,0 +1,296 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2016 Cesanta Software Limited
|
||||
* All rights reserved
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <inc/hw_types.h>
|
||||
#include <inc/hw_ints.h>
|
||||
#include <inc/hw_memmap.h>
|
||||
|
||||
#include <driverlib/gpio.h>
|
||||
#include <driverlib/interrupt.h>
|
||||
#include <driverlib/pin.h>
|
||||
#include <driverlib/prcm.h>
|
||||
#include <driverlib/rom.h>
|
||||
#include <driverlib/rom_map.h>
|
||||
#include <driverlib/uart.h>
|
||||
#include <driverlib/utils.h>
|
||||
|
||||
#include <example/common/gpio_if.h>
|
||||
#include <example/common/i2c_if.h>
|
||||
|
||||
/* Mongoose.h brings in SimpleLink support. Do not include simplelink.h. */
|
||||
#include <mongoose.h>
|
||||
#include "cs_dbg.h"
|
||||
#include <simplelink/include/device.h>
|
||||
|
||||
#include "data.h"
|
||||
#include "wifi.h"
|
||||
|
||||
/* Set up an AP or connect to existing WiFi network. */
|
||||
#define WIFI_AP_SSID "Mongoose"
|
||||
#define WIFI_AP_PASS ""
|
||||
#define WIFI_AP_CHAN 6
|
||||
// #define WIFI_STA_SSID "YourWiFi"
|
||||
// #define WIFI_STA_PASS "YourPass"
|
||||
|
||||
#define DATA_COLLECTION_INTERVAL_MS 20
|
||||
|
||||
#define CONSOLE_BAUD_RATE 115200
|
||||
#define CONSOLE_UART UARTA0_BASE
|
||||
#define CONSOLE_UART_PERIPH PRCM_UARTA0
|
||||
#define MGOS_TASK_PRIORITY 3
|
||||
#define MG_TASK_STACK_SIZE 8192
|
||||
|
||||
#define BM222_ADDR 0x18
|
||||
#define TMP006_ADDR 0x41
|
||||
|
||||
void fs_slfs_set_new_file_size(const char *name, size_t size);
|
||||
|
||||
static const char *upload_form =
|
||||
"\
|
||||
<h1>Upload file</h1> \
|
||||
<form action='/upload' method='POST' enctype='multipart/form-data'> \
|
||||
<input type='file' name='file'> \
|
||||
<input type='submit' value='Upload'> \
|
||||
</form>";
|
||||
|
||||
static struct mg_str upload_fname(struct mg_connection *nc,
|
||||
struct mg_str fname) {
|
||||
struct mg_str lfn;
|
||||
char *fn = malloc(fname.len + 4);
|
||||
memcpy(fn, "SL:", 3);
|
||||
memcpy(fn + 3, fname.p, fname.len);
|
||||
fn[3 + fname.len] = '\0';
|
||||
if (nc->user_data != NULL) {
|
||||
intptr_t cl = (intptr_t) nc->user_data;
|
||||
if (cl >= 0) {
|
||||
fs_slfs_set_new_file_size(fn + 3, cl);
|
||||
}
|
||||
}
|
||||
lfn.len = fname.len + 4;
|
||||
lfn.p = fn;
|
||||
return lfn;
|
||||
}
|
||||
|
||||
static void mg_ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
|
||||
switch (ev) {
|
||||
case MG_EV_ACCEPT: {
|
||||
char addr[32];
|
||||
mg_conn_addr_to_str(nc, addr, sizeof(addr), MG_SOCK_STRINGIFY_REMOTE |
|
||||
MG_SOCK_STRINGIFY_IP |
|
||||
MG_SOCK_STRINGIFY_PORT);
|
||||
LOG(LL_INFO, ("%p conn from %s", nc, addr));
|
||||
break;
|
||||
}
|
||||
case MG_EV_HTTP_REQUEST: {
|
||||
char addr[32];
|
||||
struct http_message *hm = (struct http_message *) ev_data;
|
||||
cs_stat_t st;
|
||||
mg_conn_addr_to_str(nc, addr, sizeof(addr), MG_SOCK_STRINGIFY_REMOTE |
|
||||
MG_SOCK_STRINGIFY_IP |
|
||||
MG_SOCK_STRINGIFY_PORT);
|
||||
LOG(LL_INFO,
|
||||
("HTTP request from %s: %.*s %.*s", addr, (int) hm->method.len,
|
||||
hm->method.p, (int) hm->uri.len, hm->uri.p));
|
||||
if (mg_vcmp(&hm->uri, "/upload") == 0 ||
|
||||
(mg_vcmp(&hm->uri, "/") == 0 && mg_stat("SL:index.html", &st) != 0)) {
|
||||
mg_send(nc, upload_form, strlen(upload_form));
|
||||
nc->flags |= MG_F_SEND_AND_CLOSE;
|
||||
break;
|
||||
}
|
||||
struct mg_serve_http_opts opts;
|
||||
memset(&opts, 0, sizeof(opts));
|
||||
opts.document_root = "SL:";
|
||||
mg_serve_http(nc, hm, opts);
|
||||
break;
|
||||
}
|
||||
case MG_EV_CLOSE: {
|
||||
LOG(LL_INFO, ("%p closed", nc));
|
||||
break;
|
||||
}
|
||||
case MG_EV_WEBSOCKET_HANDSHAKE_DONE: {
|
||||
LOG(LL_INFO, ("%p switching to data mode", nc));
|
||||
nc->handler = data_conn_handler;
|
||||
nc->ev_timer_time = mg_time(); /* Immediately */
|
||||
break;
|
||||
}
|
||||
case MG_EV_TIMER: {
|
||||
data_collect();
|
||||
nc->ev_timer_time = mg_time() + (DATA_COLLECTION_INTERVAL_MS * 0.001);
|
||||
break;
|
||||
}
|
||||
/* SimpleLink FS requires pre-declaring max file size. We use Content-Length
|
||||
* for that purpose - it will not exactly match file size, but is guaranteed
|
||||
* to exceed it and should be close enough. */
|
||||
case MG_EV_HTTP_MULTIPART_REQUEST: {
|
||||
struct http_message *hm = (struct http_message *) ev_data;
|
||||
struct mg_str *cl_header = mg_get_http_header(hm, "Content-Length");
|
||||
intptr_t cl = -1;
|
||||
if (cl_header != NULL && cl_header->len < 20) {
|
||||
char buf[20];
|
||||
memcpy(buf, cl_header->p, cl_header->len);
|
||||
buf[cl_header->len] = '\0';
|
||||
cl = atoi(buf);
|
||||
if (cl < 0) cl = -1;
|
||||
}
|
||||
nc->user_data = (void *) cl;
|
||||
break;
|
||||
}
|
||||
case MG_EV_HTTP_PART_BEGIN:
|
||||
case MG_EV_HTTP_PART_DATA:
|
||||
case MG_EV_HTTP_PART_END: {
|
||||
struct mg_http_multipart_part *mp =
|
||||
(struct mg_http_multipart_part *) ev_data;
|
||||
if (ev == MG_EV_HTTP_PART_BEGIN) {
|
||||
LOG(LL_INFO, ("Begin file upload: %s", mp->file_name));
|
||||
} else if (ev == MG_EV_HTTP_PART_END) {
|
||||
LOG(LL_INFO, ("End file upload: %s", mp->file_name));
|
||||
}
|
||||
mg_file_upload_handler(nc, ev, ev_data, upload_fname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void mg_init(struct mg_mgr *mgr) {
|
||||
LOG(LL_INFO, ("MG task running"));
|
||||
|
||||
stop_nwp(); /* See function description in wifi.c */
|
||||
LOG(LL_INFO, ("Starting NWP..."));
|
||||
int role = sl_Start(0, 0, 0);
|
||||
if (role < 0) {
|
||||
LOG(LL_ERROR, ("Failed to start NWP"));
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
SlVersionFull ver;
|
||||
unsigned char opt = SL_DEVICE_GENERAL_VERSION;
|
||||
unsigned char len = sizeof(ver);
|
||||
|
||||
memset(&ver, 0, sizeof(ver));
|
||||
sl_DevGet(SL_DEVICE_GENERAL_CONFIGURATION, &opt, &len,
|
||||
(unsigned char *) (&ver));
|
||||
LOG(LL_INFO, ("NWP v%d.%d.%d.%d started, host v%d.%d.%d.%d",
|
||||
ver.NwpVersion[0], ver.NwpVersion[1], ver.NwpVersion[2],
|
||||
ver.NwpVersion[3], SL_MAJOR_VERSION_NUM, SL_MINOR_VERSION_NUM,
|
||||
SL_VERSION_NUM, SL_SUB_VERSION_NUM));
|
||||
}
|
||||
|
||||
GPIO_IF_LedToggle(MCU_RED_LED_GPIO);
|
||||
|
||||
data_init_sensors(TMP006_ADDR, BM222_ADDR);
|
||||
|
||||
sl_fs_init();
|
||||
|
||||
#if defined(WIFI_STA_SSID)
|
||||
if (!wifi_setup_sta(WIFI_STA_SSID, WIFI_STA_PASS)) {
|
||||
LOG(LL_ERROR, ("Error setting up WiFi station"));
|
||||
}
|
||||
#elif defined(WIFI_AP_SSID)
|
||||
if (!wifi_setup_ap(WIFI_AP_SSID, WIFI_AP_PASS, WIFI_AP_CHAN)) {
|
||||
LOG(LL_ERROR, ("Error setting up WiFi AP"));
|
||||
}
|
||||
#else
|
||||
#error WiFi not configured
|
||||
#endif
|
||||
|
||||
/* We don't need SimpleLink's web server. */
|
||||
sl_NetAppStop(SL_NET_APP_HTTP_SERVER_ID);
|
||||
|
||||
const char *err = "";
|
||||
struct mg_bind_opts opts;
|
||||
memset(&opts, 0, sizeof(opts));
|
||||
opts.error_string = &err;
|
||||
|
||||
struct mg_connection *nc = mg_bind_opt(mgr, "80", mg_ev_handler, opts);
|
||||
if (nc != NULL) {
|
||||
mg_set_protocol_http_websocket(nc);
|
||||
nc->ev_timer_time = mg_time(); /* Start data collection */
|
||||
} else {
|
||||
LOG(LL_ERROR, ("Failed to create listener: %s", err));
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef USE_TIRTOS
|
||||
/* Int vector table, defined in startup_gcc.c */
|
||||
extern void (*const g_pfnVectors[])(void);
|
||||
#endif
|
||||
|
||||
int main(void) {
|
||||
#ifndef USE_TIRTOS
|
||||
MAP_IntVTableBaseSet((unsigned long) &g_pfnVectors[0]);
|
||||
#endif
|
||||
MAP_IntEnable(FAULT_SYSTICK);
|
||||
MAP_IntMasterEnable();
|
||||
PRCMCC3200MCUInit();
|
||||
|
||||
/* Console UART init. */
|
||||
MAP_PRCMPeripheralClkEnable(CONSOLE_UART_PERIPH, PRCM_RUN_MODE_CLK);
|
||||
MAP_PinTypeUART(PIN_55, PIN_MODE_3); /* PIN_55 -> UART0_TX */
|
||||
MAP_PinTypeUART(PIN_57, PIN_MODE_3); /* PIN_57 -> UART0_RX */
|
||||
MAP_UARTConfigSetExpClk(
|
||||
CONSOLE_UART, MAP_PRCMPeripheralClockGet(CONSOLE_UART_PERIPH),
|
||||
CONSOLE_BAUD_RATE,
|
||||
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
|
||||
MAP_UARTFIFOLevelSet(CONSOLE_UART, UART_FIFO_TX1_8, UART_FIFO_RX4_8);
|
||||
MAP_UARTFIFOEnable(CONSOLE_UART);
|
||||
|
||||
setvbuf(stdout, NULL, _IOLBF, 0);
|
||||
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 */
|
||||
MAP_PinTypeI2C(PIN_02, PIN_MODE_1); /* SCL */
|
||||
I2C_IF_Open(I2C_MASTER_MODE_FST);
|
||||
|
||||
/* Set up the red LED. Note that amber and green cannot be used as they share
|
||||
* pins with I2C. */
|
||||
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA1, PRCM_RUN_MODE_CLK);
|
||||
MAP_PinTypeGPIO(PIN_64, PIN_MODE_0, false);
|
||||
MAP_GPIODirModeSet(GPIOA1_BASE, 0x2, GPIO_DIR_MODE_OUT);
|
||||
GPIO_IF_LedConfigure(LED1);
|
||||
GPIO_IF_LedOn(MCU_RED_LED_GPIO);
|
||||
|
||||
if (VStartSimpleLinkSpawnTask(8) != 0) {
|
||||
LOG(LL_ERROR, ("Failed to create SL task"));
|
||||
}
|
||||
|
||||
if (!mg_start_task(MGOS_TASK_PRIORITY, MG_TASK_STACK_SIZE, mg_init)) {
|
||||
LOG(LL_ERROR, ("Failed to create MG task"));
|
||||
}
|
||||
|
||||
osi_start();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* These are FreeRTOS hooks for various life situations. */
|
||||
void vApplicationMallocFailedHook(void) {
|
||||
}
|
||||
|
||||
void vApplicationIdleHook(void) {
|
||||
}
|
||||
|
||||
void vApplicationStackOverflowHook(OsiTaskHandle *th, signed char *tn) {
|
||||
}
|
||||
|
||||
void SimpleLinkHttpServerCallback(SlHttpServerEvent_t *e,
|
||||
SlHttpServerResponse_t *resp) {
|
||||
}
|
||||
|
||||
void SimpleLinkSockEventHandler(SlSockEvent_t *e) {
|
||||
}
|
||||
|
||||
void SimpleLinkGeneralEventHandler(SlDeviceEvent_t *e) {
|
||||
LOG(LL_ERROR, ("status %d sender %d", e->EventData.deviceEvent.status,
|
||||
e->EventData.deviceEvent.sender));
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
docker.cesanta.com/cc3200-build:1.2.0-r8
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
@@ -0,0 +1,83 @@
|
||||
l<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>CC3200 Mongoose sensor demo</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<script type="text/javascript" src="main.js"></script>
|
||||
|
||||
<style>
|
||||
* {
|
||||
outline: none;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
background: #7cf;
|
||||
color: #555;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font: 16px/1.4 Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
div.content {
|
||||
width: 800px;
|
||||
margin: 1em auto;
|
||||
padding: 2em;
|
||||
background-color: #fff;
|
||||
border-radius: 1em;
|
||||
}
|
||||
|
||||
a:link, a:visited {
|
||||
color: #69c;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#graphs {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.graph {
|
||||
min-height: 12em;
|
||||
border: 0px solid #ccc;
|
||||
position: relative;
|
||||
margin: 0;
|
||||
padding-right: 5px;
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.graph_title {
|
||||
position: absolute;
|
||||
top: 0.5em; left: 1em;
|
||||
color: #ccc;
|
||||
font-weight: bold;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
button { font-size: 100%; }
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAABECAYAAAA85kOPAAAWc0lEQVR42u1bCXxU1dUPiAKCpUqxlYqKYmttq1W6fLbWtVXR2vpVsbQfS5pltrfct81kI2TYioKoiBtFFAHZFAVUrCwiFMQKik0IW1YgBBKEBJIQssyc73/ezIRJMkCA4Jev+n7en8Pkvjf3/u85//M/594XF/f19fX19fWfcqU4HL1cuv5dlyvUNE27TNf17l95YLzeFKHq+nuq0N9TVO19oemLTNMc9JUGZdCgQV3TMjLfBSgkNMNu+NygGVaW3+/v8h81WUyoszs19eK29LUscQNAyHG5pYDbIxM3WRF1iqK96PMlXHSq+wcPHnyex+Pp2eFBcVnWpYqmJWi6Oc1U1YGn6i/L2kOSLMoASPA4MFoAbQl45pJT3N7ZMLy/A7CTFEX5jX+w/4IOB0hCQsJFqqrer2r6LKz4XrhEQNeN9+SEhL4t+4I/voWJ3IT+d3tk8ZJHUmoioHCTZJXbDkXosiSJ22RZvi4WGeMZt8OytghhsIVl67o5Gv1+7HA4zu8wwGBA9+jC/EyW1cbwxEhRRYNheuckhF2CgZBVMUFV9cWq0D6RhZYHa6mMtpZIA1j1sqLuwzNyFU1fi/tew31CMozvhZ91rSyLj0HWdPz3tKOqpi2VdP2HHQYYhNibVc3IgbU0myD+fVRR1fdgQfN1wyrEv6vxfSODgclHQIjZ3BKeEerDfRtUYRwyTCsHAEyXJHUlntX0DG4MEixniSSZV3YYYB50+C/EQOeiNbZcff6OIw1/Bsk2TUINR6Hwqgfw/zr0rZcw4egoFQ02A4FwXof+jS3dD1ZVDddM7VCuFDJvU8HkKqJXseXgwRtBEHOl0MzNsjAWAoAJumm6oGP+IrzGw5ppPgLOGA7XBHcbzwqhLQNvFQjdrGWATvRs/pusalvBX7d2OALGoG4DdxQwACHrCJu4ooX8X2ibMemnNM26Q5Kk3qfSKRz2hw0b1kNRvNcI4R0OEBeCc3YBhEAMl8Vv6IuThPh2hwJFUczrEWLnww2OHh+sGuCVxqqvklQtCTx0FfdlU5dlX18hxBUcbRiAtvxGfHx8N48QP5NVdYwitO0AqjGap8A7+xD+fW532zTUOb+EMH+mqmINc0WEOPG5UbALGFZyRI8wAADjVo9HneN2qzlut5wLTpiLyd6K0Nu1rb9HRJ0cCOH43eckWamBhQabXBU8he8nsCT4kixC6RrL9BE2B8JS1sKMm3gEYbUWofQNt7BuiPTz+D09XR6P0yMZJeP+NolmzZlNs+fMowmPTeTJlEOvqKebOEL1XgArGQZu2QzijQanXgj9MYy5Tyz3bKuFtuXqJAuRCK6Ix49dwyZtg2Uq18Ok/wEyDZmyPSj9EAY1Cj/eM9oFXJKUoArfwVdffY5Kd2QQHXQQ1a2iffv30auz5hDuQWgWI88kPxJucQPc9S3WTVERqhGAZTkcKb24z7BhVg9Y0XVYsIcNw7ipnaKN8Uuswl4mOIDwEbjCAlD3os2Gu0SRn7ZfVTWlxYp0gtsM9Ki+nJmvTKIjxX8mKj2PqAAeUfpromA+1R2ro5kzZ7JmqZVU/dEz1FFXqULMAzh1YVfmRToIsnfquvc+VbOykD5sYNkACTA3ljWdXkLI+kTVXwPSNtGxdbC20HSjGCtT32QpilYG1StacEWnhATfRYrqnf7EExlU9O8H6WBuHyre0JsaCjpREC1wcAwoo5YqKytoypRnyOmSP3c43A+wFXg82g+wuv18Pt9FbRmrLFv9Acgc1kI8Lpm1ktBLNN3aZRg+e+y8gFi8A/DbEWenaA0jHtqjzONRKCLQbB6B6Ue5z2FYVYYFc201WGH8yevTj61eeg/VFFxMC2bcShPHDqadG75LweI4Cuy6nujYZuIrJyeXkpLdAYdTKnA63esSEpPf/2tCwtzExOTHk5I8wxmoU4IDd2H3joRzJQQO8fgj4tK2bqGtlpFXnXH5ACbqw4OYTClGPsOWwiH5ZQtZdcv7h0OrYACfTn5sOH2xpRf9e1V/rJaLho7w0Yxn76Wq7d1DLlU5kWqPEa1d9ym9vugdWrN+Ey17fx3NmfcuTZk6g7KyxtcpwihzOF1rHG4pXVGMG082bgk5GQDZ0VLrRBoDhYBRjNB+5sUwnjBMMhM/dCSWqIJZbgZ4t8QWfGqSBHH3/qKBdCTvQpoy8SGQrJNGpg+nx8c9SgXr+4aA2TuQyoufpvzNbqo9MIqoajI1HH6Fqg8tp4MHtlFh8R7a8K9cmv3aIsoYOara4fRsTHJ5xqSm+q86UbAAt6iw9MqI2DyeT+lsRTsBHnRV/DfPyp0c4BlJ0pIA0N5oQYUfqMb3abHuSU39y8UeyftBVmYCVed1p88/6E8LX/k1bV1zJe39rDflb7iMDuX0pEAh3KmwC9XlX0zBoovQelGwEK34UgruvhoEfTvRFzI1HplFVVU7aWdeCc1fuJj5ojoxybkS3HF3zAV1WZdCW70ZnbsBpAZY8DronN+2Wz7FlTIkfYbpTSGXjTz7qf5RRM22CqGyGByfkFL90Ts/JtodRyWf9KbDuRdiwp2IiuIAAIi3EA0W06zlh1oQn4OF3EDShV0pUPRNCu65kYKHRlHt0a2UnZNP/tGPBZKSHMVQwi4eX+toqj/KkTK8mEHZjpre+89Bkmi8yxHJI8mITGaF0C05thgc0DXRMXL+OH881eWdbwMRQASiwrjWQMRo3J/b0R1xuD/OBpaKQ2AF+Hm7r6dg1XTavSeHpk59gbgC6PHIvvh4f7dm40hL68PFdc7cw0R8hGs67QoKiyKoTLvSxmUBEO4GSQoVjVoDYz3oktLKPnzrJntSbQEj0hrzO9MeWNe6ZbfT5vUSrVo6hN5bcDMVbOhLdTvPD4Gbz5bWHdZj0BeV1bRgwVIEAfWg2y2lsbxoVkAzfQ7wYHXY/Rs50Wxr+I9rm0ZQfZz/hJE/hh97JlZ+o/h8lyclp659fNz/BCq29AhbS9tbff55tHbJD+jJJycgfOfRrNlz4QaCZs/Mom3rb6GarV2P999zM1H1HDpypJxef+MfHI7LYTmJnEs1pSK6PgBRaCuTMIAJqsLIQdj/SfvlSkLM53TfjkaqKFcUMbx1eB98gdttTYYCrdv4/nW2+Z8OKHaDRZRu6kXPT4mnZxCq09NGwkJ9tGhuAh3c0pdqdlxAjU39macuINp3F1WUL6cXpr0KHeTcpERJfiZZSIpFkYgKkMp13Xq0XUCBnrkED9/IiNuoq9p2SYhfxMiy73W5rd3zZ/yWGnafZ5PnaQPDpAuC3rmuL02d9CCNHT2C/v7M72jXx71DPBPDAoP5nF4MoLzc6ZSZNS6Y5JAzoxNSkK4vErYRlWosy5fl98edVSJpm6Tu8/0USd4uZna7BKmI9Q6HuKLZNmtKSq9EV9q8v40d0ViefXFoAvlnBgxbDZWAb3Z1oortPRC2OxPtCX3fsm9d3nloXWzQ6kDKS9/IRGBIXeN0qtc2CT4hfqeEas2svepV3ZzXhq2Z1rUORUnrI8v6jzl5NFNS7hWm90k8+EhYCzRCPC3U9Se7N+eg9EGQ/7tWLx5IgeLOJ594fttAo11xNiC2S8bqj5BfAD303oKf0rY1fWFVfejteYPI6/UecSspDzTRgKHcyGE7wjMAJ1e3fImQGr9SVfVHHuRjpyx5QOn2kFXDAkl9AivJRrK4Gw+tiarE1yG5fir6Ht4JTHakvTjxb0MbSz//VgvC5QjSJRRqI6AUfgufe565RUVcCMBs+2c/8IaLLDORxmQOoRTvCIg/PajrPjMyWQSJy5HSNJVcOTox1zApgyLW8Q6GrGl3xNJCTVdion4JYv1s0/KFCswhlKMldS2E3pgWRfCBLk/KZ4tn30HH8s9vxi2NBZ2peucAOlZ4gy3/A4g6dHAkBcsd+Nz5rIDhVrW9G8164S47/4pPMCnZgTRFGGQYFheqvsHjc7vdF0uKsj06pbFrNqFSCVcLjsJDIBJPspPJDwG5zuQU/QQJ2FGh6yOj73F6vMNNUzmweeX3Q4q2hS4p3zKQSnY8Dd64GX+/Atn0RgJiFCy966yB4UU4kPMNWvjyrylr5FDyWkmkG5is7h2bENYrbNHQOTmxkkpedBhCNajCyVH1ZDuKl2iaMceC9OcHSS0shoGBxWRF9e+e6EgdN3pUfP3uTX1ihuiKLb3p0w1PUcW+JUSHM6nmSB7tL6ui+prVFNx7y1m7FHPRsaLzqQRuvOrNmygzw93oljOaLIAtB5af23J/KlwGZQurl1RNOmndObQHrY2Dy+zjPSKEOnvzqwkYiDsA93ikf1qa1DshOeWlqZMfoUN5V2KQ3WJEjs60aeUt9OGHy6mhvpIqK7+gefMXISEsImr4GODcBqkfd1YA8YLQvjj6dPn1lJqifOHwjLrzeGnV8x2AkB8BhgGxN/qg4PFdFeZXhHzrLydNLLkGw3VdkBGijBiqaIYm7G1PpTYS7uBmMyO1WcjryxOTfIvmvDyEDuQ9RPWFl7bWL/j3oZxu9O7CP9Db766hQxVVNPW5F2jM+ClUUnoAbrWFaP8QCuw4c3Ds3GpnV3r9lUEYY8oKruYdpwfxfeRTJSHrh7XISqkQ2osILibcaATm+yAs/7vRivmE+oUZmhFkoHQ99R6guj+8hxyACl4VKUwpyshrXJK2fOrTKr01789wm14x0wAGqwLZ9YKXBwGQaZTlH02mNpTGjHmM9paWYUyH8J+fAjvPDBzOybavv4rSU52NSY6U1Gi3QEi+U1a0SrvcqYhGRKJlsiz35/nxTkN4kTudQQKZ0Q+mlxNRvgh92ViFG8LJ5feQAnzgcln01ON/xOQvOmF+xOA0FJ9Haxb/kCaMeYQ+XHwjPT/5LjINi7JzYDXUQFS7FATd77TAYTc6CAJ+dvKjlOjwfiyEuKFF+cGBBLgxbPG1UL6Line truncated
|
||||
" style="float:right; height: 50px; border-radius: 3px;">
|
||||
<h1>Mongoose on CC3200 LaunchPad</h1>
|
||||
|
||||
<p>
|
||||
This web page demonstrates how Mongoose embedded networking library can be
|
||||
used to implement real-time data exchange. Here, a TI CC3200 board pushes
|
||||
JSON-encoded WebSocket frames to the connected browser, which in turn
|
||||
graphs the data. Also, the browser can send commands to the device wrapped
|
||||
into a WebSocket frame to turn an LED on/off.
|
||||
</p>
|
||||
|
||||
<button id="on_off_button">Switch LED off</button>
|
||||
|
||||
<div id="graphs"></div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,587 @@
|
||||
/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
|
||||
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^Line truncated
|
||||
|
||||
return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var
Line truncated
|
||||
return new Za.prototype.init(a,b,c,d,e)}m.Tween=Za,Za.prototype={constructor:Za,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Za.propHooks[this.prop];return a&&a.get?a.get(this):Za.propHooks._default.get(this)},run:function(a){var b,c=Za.propHooks[this.prop];return this.options.duration?this.pos=b=m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Za.propHooks._default.set(this),this}},Za.prototype.init.prototype=Za.prototype,Za.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Za.propHooks.scrollTop=Za.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Za.prototype.init,m.fx.step={};var $a,_a,ab=/^(?:toggle|show|hide)$/,bb=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cb=/queueHooks$/,db=[ib],eb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bb.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bb.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fb(){return setTimeout(function(){$a=void 0}),$a=m.now()}function gb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hb(a,b,c){for(var d,e=(eb[b]||[]).concat(eb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fa(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fa(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ab.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fa(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hb(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=db.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$a||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$a||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);g>f;f++)if(d=db[f].call(j,a,k,j.opts))return d;return m.map(k,hb,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kb,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],eb[cLine truncated
|
||||
|
||||
/* Javascript plotting library for jQuery, version 0.8.3.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
*/
|
||||
(function($){$.color={};$.color.make=function(r,g,b,a){var o={};o.r=r||0;o.g=g||0;o.b=b||0;o.a=a!=null?a:1;o.add=function(c,d){for(var i=0;i<c.length;++i)o[c.charAt(i)]+=d;return o.normalize()};o.scale=function(c,f){for(var i=0;i<c.length;++i)o[c.charAt(i)]*=f;return o.normalize()};o.toString=function(){if(o.a>=1){return"rgb("+[o.r,o.g,o.b].join(",")+")"}else{return"rgba("+[o.r,o.g,o.b,o.a].join(",")+")"}};o.normalize=function(){function clamp(min,value,max){return value<min?min:value>max?max:value}o.r=clamp(0,parseInt(o.r),255);o.g=clamp(0,parseInt(o.g),255);o.b=clamp(0,parseInt(o.b),255);o.a=clamp(0,o.a,1);return o};o.clone=function(){return $.color.make(o.r,o.b,o.g,o.a)};return o.normalize()};$.color.extract=function(elem,css){var c;do{c=elem.css(css).toLowerCase();if(c!=""&&c!="transparent")break;elem=elem.parent()}while(elem.length&&!$.nodeName(elem.get(0),"body"));if(c=="rgba(0, 0, 0, 0)")c="transparent";return $.color.parse(c)};$.color.parse=function(str){var res,m=$.color.make;if(res=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10));if(res=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10),parseFloat(res[4]));if(res=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55);if(res=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55,parseFloat(res[4]));if(res=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str))return m(parseInt(res[1],16),parseInt(res[2],16),parseInt(res[3],16));if(res=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(str))return m(parseInt(res[1]+res[1],16),parseInt(res[2]+res[2],16),parseInt(res[3]+res[3],16));var name=$.trim(str).toLowerCase();if(name=="transparent")return m(255,255,255,0);else{res=lookupColors[name]||[0,0,0];return m(res[0],res[1],res[2])}};var lookupColors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);(function($){var hasOwnProperty=Object.prototype.hasOwnProperty;if(!$.fn.detach){$.fn.detach=function(){return this.each(function(){if(this.parentNode){this.parentNode.removeChild(this)}})}}function Canvas(cls,container){var element=container.children("."+cls)[0];if(element==null){element=document.createElement("canvas");element.className=cls;$(element).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(container);if(!element.getContext){if(window.G_vmlCanvasManager){element=window.G_vmlCanvasManager.initElement(element)}else{throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.")}}}this.element=element;var context=this.context=element.getContext("2d");var devicePixelRatio=window.devicePixelRatio||1,backingStoreRatio=context.webkitBackingStorePixelRatio||context.mozBackingStorePixelRatio||context.msBackingStorePixelRatio||context.oBackingStorePixelRatio||context.backingStorePixelRatio||1;this.pixelRatio=devicePixelRatio/backingStoreRatio;this.resize(container.width(),container.height());this.textContainer=null;this.text={};this._textCache={}}Canvas.prototype.resize=function(width,height){if(width<=0||height<=0){throw new Error("Invalid dimensions for plot, width = "+width+", height = "+height)}var element=this.element,context=this.context,pixelRatio=this.pixelRatio;if(this.width!=width){element.width=width*pixelRatio;element.style.width=width+"px";this.width=width}if(this.height!=height){element.height=height*pixelRatio;element.style.height=height+"px";this.height=height}context.restore();context.save();context.scale(pixelRatio,pixelRatio)};Canvas.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)};Canvas.prototype.render=function(){vaLine truncated
|
||||
if(yrange.from==null)yrange.from=yrange.axis.min;if(yrange.to==null)yrange.to=yrange.axis.max;if(xrange.to<xrange.axis.min||xrange.from>xrange.axis.max||yrange.to<yrange.axis.min||yrange.from>yrange.axis.max)continue;xrange.from=Math.max(xrange.from,xrange.axis.min);xrange.to=Math.min(xrange.to,xrange.axis.max);yrange.from=Math.max(yrange.from,yrange.axis.min);yrange.to=Math.min(yrange.to,yrange.axis.max);var xequal=xrange.from===xrange.to,yequal=yrange.from===yrange.to;if(xequal&&yequal){continue}xrange.from=Math.floor(xrange.axis.p2c(xrange.from));xrange.to=Math.floor(xrange.axis.p2c(xrange.to));yrange.from=Math.floor(yrange.axis.p2c(yrange.from));yrange.to=Math.floor(yrange.axis.p2c(yrange.to));if(xequal||yequal){var lineWidth=m.lineWidth||options.grid.markingsLineWidth,subPixel=lineWidth%2?.5:0;ctx.beginPath();ctx.strokeStyle=m.color||options.grid.markingsColor;ctx.lineWidth=lineWidth;if(xequal){ctx.moveTo(xrange.to+subPixel,yrange.from);ctx.lineTo(xrange.to+subPixel,yrange.to)}else{ctx.moveTo(xrange.from,yrange.to+subPixel);ctx.lineTo(xrange.to,yrange.to+subPixel)}ctx.stroke()}else{ctx.fillStyle=m.color||options.grid.markingsColor;ctx.fillRect(xrange.from,yrange.to,xrange.to-xrange.from,yrange.from-yrange.to)}}}axes=allAxes();bw=options.grid.borderWidth;for(var j=0;j<axes.length;++j){var axis=axes[j],box=axis.box,t=axis.tickLength,x,y,xoff,yoff;if(!axis.show||axis.ticks.length==0)continue;ctx.lineWidth=1;if(axis.direction=="x"){x=0;if(t=="full")y=axis.position=="top"?0:plotHeight;else y=box.top-plotOffset.top+(axis.position=="top"?box.height:0)}else{y=0;if(t=="full")x=axis.position=="left"?0:plotWidth;else x=box.left-plotOffset.left+(axis.position=="left"?box.width:0)}if(!axis.innermost){ctx.strokeStyle=axis.options.color;ctx.beginPath();xoff=yoff=0;if(axis.direction=="x")xoff=plotWidth+1;else yoff=plotHeight+1;if(ctx.lineWidth==1){if(axis.direction=="x"){y=Math.floor(y)+.5}else{x=Math.floor(x)+.5}}ctx.moveTo(x,y);ctx.lineTo(x+xoff,y+yoff);ctx.stroke()}ctx.strokeStyle=axis.options.tickColor;ctx.beginPath();for(i=0;i<axis.ticks.length;++i){var v=axis.ticks[i].v;xoff=yoff=0;if(isNaN(v)||v<axis.min||v>axis.max||t=="full"&&(typeof bw=="object"&&bw[axis.position]>0||bw>0)&&(v==axis.min||v==axis.max))continue;if(axis.direction=="x"){x=axis.p2c(v);yoff=t=="full"?-plotHeight:t;if(axis.position=="top")yoff=-yoff}else{y=axis.p2c(v);xoff=t=="full"?-plotWidth:t;if(axis.position=="left")xoff=-xoff}if(ctx.lineWidth==1){if(axis.direction=="x")x=Math.floor(x)+.5;else y=Math.floor(y)+.5}ctx.moveTo(x,y);ctx.lineTo(x+xoff,y+yoff)}ctx.stroke()}if(bw){bc=options.grid.borderColor;if(typeof bw=="object"||typeof bc=="object"){if(typeof bw!=="object"){bw={top:bw,right:bw,bottom:bw,left:bw}}if(typeof bc!=="object"){bc={top:bc,right:bc,bottom:bc,left:bc}}if(bw.top>0){ctx.strokeStyle=bc.top;ctx.lineWidth=bw.top;ctx.beginPath();ctx.moveTo(0-bw.left,0-bw.top/2);ctx.lineTo(plotWidth,0-bw.top/2);ctx.stroke()}if(bw.right>0){ctx.strokeStyle=bc.right;ctx.lineWidth=bw.right;ctx.beginPath();ctx.moveTo(plotWidth+bw.right/2,0-bw.top);ctx.lineTo(plotWidth+bw.right/2,plotHeight);ctx.stroke()}if(bw.bottom>0){ctx.strokeStyle=bc.bottom;ctx.lineWidth=bw.bottom;ctx.beginPath();ctx.moveTo(plotWidth+bw.right,plotHeight+bw.bottom/2);ctx.lineTo(0,plotHeight+bw.bottom/2);ctx.stroke()}if(bw.left>0){ctx.strokeStyle=bc.left;ctx.lineWidth=bw.left;ctx.beginPath();ctx.moveTo(0-bw.left/2,plotHeight+bw.bottom);ctx.lineTo(0-bw.left/2,0);ctx.stroke()}}else{ctx.lineWidth=bw;ctx.strokeStyle=options.grid.borderColor;ctx.strokeRect(-bw/2,-bw/2,plotWidth+bw,plotHeight+bw)}}ctx.restore()}function drawAxisLabels(){$.each(allAxes(),function(_,axis){var box=axis.box,legacyStyles=axis.direction+"Axis "+axis.direction+axis.n+"Axis",layer="flot-"+axis.direction+"-axis flot-"+axis.direction+axis.n+"-axis "+legacyStyles,font=axis.options.font||"flot-tick-label tickLabel",tick,x,y,halign,valign;surface.removeText(layer);if(!axis.show||axis.ticks.length==0)return;for(var i=0;i<axis.ticks.length;++i){tick=axis.ticks[i];if(!tick.label||tick.v<axis.min||tick.v>axis.max)continue;if(axis.direction=="x"){halign="center";x=plotOffset.left+axis.p2c(tick.v);if(axis.position=="bottom"){y=box.top+box.padding}else{y=box.top+box.height-box.padding;valign="bottom"}}else{valign="middle";y=plotOffset.top+axis.p2c(tick.v);if(axis.position=="left"){x=box.left+box.width-box.padding;halign="right"}else{x=box.left+box.padding}}surface.addText(layer,x,y,tick.label,font,null,null,halign,valign)}})}function drawSeries(series){if(series.lines.show)drawSeriesLines(series);if(series.bars.show)drawSeriesBars(series);if(series.points.show)drawSeriesPoints(series)}function drawSeriesLines(series){function plotLine(datapoints,xoffset,yoffset,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize,prevx=null,prevy=null;ctx.beginPath();for(var i=ps;i<points.length;i+=ps){var x1=points[i-ps],y1=points[i-ps+1],x2=points[i],y2=points[i+1];if(x1==null||x2==null)continue;if(y1<=y2&&y1<axisy.min){if(y2<axLine truncated
|
||||
|
||||
|
||||
/* Pretty handling of time axes.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
Set axis.mode to "time" to enable. See the section "Time series data" in
|
||||
API.txt for details.
|
||||
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
var options = {
|
||||
xaxis: {
|
||||
timezone: null, // "browser" for local to the client or timezone for timezone-js
|
||||
timeformat: null, // format string to use
|
||||
twelveHourClock: false, // 12 or 24 time in time mode
|
||||
monthNames: null // list of names of months
|
||||
}
|
||||
};
|
||||
|
||||
// round to nearby lower multiple of base
|
||||
|
||||
function floorInBase(n, base) {
|
||||
return base * Math.floor(n / base);
|
||||
}
|
||||
|
||||
// Returns a string with the date d formatted according to fmt.
|
||||
// A subset of the Open Group's strftime format is supported.
|
||||
|
||||
function formatDate(d, fmt, monthNames, dayNames) {
|
||||
|
||||
if (typeof d.strftime == "function") {
|
||||
return d.strftime(fmt);
|
||||
}
|
||||
|
||||
var leftPad = function(n, pad) {
|
||||
n = "" + n;
|
||||
pad = "" + (pad == null ? "0" : pad);
|
||||
return n.length == 1 ? pad + n : n;
|
||||
};
|
||||
|
||||
var r = [];
|
||||
var escape = false;
|
||||
var hours = d.getHours();
|
||||
var isAM = hours < 12;
|
||||
|
||||
if (monthNames == null) {
|
||||
monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
||||
}
|
||||
|
||||
if (dayNames == null) {
|
||||
dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
||||
}
|
||||
|
||||
var hours12;
|
||||
|
||||
if (hours > 12) {
|
||||
hours12 = hours - 12;
|
||||
} else if (hours == 0) {
|
||||
hours12 = 12;
|
||||
} else {
|
||||
hours12 = hours;
|
||||
}
|
||||
|
||||
for (var i = 0; i < fmt.length; ++i) {
|
||||
|
||||
var c = fmt.charAt(i);
|
||||
|
||||
if (escape) {
|
||||
switch (c) {
|
||||
case 'a': c = "" + dayNames[d.getDay()]; break;
|
||||
case 'b': c = "" + monthNames[d.getMonth()]; break;
|
||||
case 'd': c = leftPad(d.getDate()); break;
|
||||
case 'e': c = leftPad(d.getDate(), " "); break;
|
||||
case 'h': // For back-compat with 0.7; remove in 1.0
|
||||
case 'H': c = leftPad(hours); break;
|
||||
case 'I': c = leftPad(hours12); break;
|
||||
case 'l': c = leftPad(hours12, " "); break;
|
||||
case 'm': c = leftPad(d.getMonth() + 1); break;
|
||||
case 'M': c = leftPad(d.getMinutes()); break;
|
||||
// quarters not in Open Group's strftime specification
|
||||
case 'q':
|
||||
c = "" + (Math.floor(d.getMonth() / 3) + 1); break;
|
||||
case 'S': c = leftPad(d.getSeconds()); break;
|
||||
case 'y': c = leftPad(d.getFullYear() % 100); break;
|
||||
case 'Y': c = "" + d.getFullYear(); break;
|
||||
case 'p': c = (isAM) ? ("" + "am") : ("" + "pm"); break;
|
||||
case 'P': c = (isAM) ? ("" + "AM") : ("" + "PM"); break;
|
||||
case 'w': c = "" + d.getDay(); break;
|
||||
}
|
||||
r.push(c);
|
||||
escape = false;
|
||||
} else {
|
||||
if (c == "%") {
|
||||
escape = true;
|
||||
} else {
|
||||
r.push(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return r.join("");
|
||||
}
|
||||
|
||||
// To have a consistent view of time-based data independent of which time
|
||||
// zone the client happens to be in we need a date-like object independent
|
||||
// of time zones. This is done through a wrapper that only calls the UTC
|
||||
// versions of the accessor methods.
|
||||
|
||||
function makeUtcWrapper(d) {
|
||||
|
||||
function addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {
|
||||
sourceObj[sourceMethod] = function() {
|
||||
return targetObj[targetMethod].apply(targetObj, arguments);
|
||||
};
|
||||
};
|
||||
|
||||
var utc = {
|
||||
date: d
|
||||
};
|
||||
|
||||
// support strftime, if found
|
||||
|
||||
if (d.strftime != undefined) {
|
||||
addProxyMethod(utc, "strftime", d, "strftime");
|
||||
}
|
||||
|
||||
addProxyMethod(utc, "getTime", d, "getTime");
|
||||
addProxyMethod(utc, "setTime", d, "setTime");
|
||||
|
||||
var props = ["Date", "Day", "FullYear", "Hours", "Milliseconds", "Minutes", "Month", "Seconds"];
|
||||
|
||||
for (var p = 0; p < props.length; p++) {
|
||||
addProxyMethod(utc, "get" + props[p], d, "getUTC" + props[p]);
|
||||
addProxyMethod(utc, "set" + props[p], d, "setUTC" + props[p]);
|
||||
}
|
||||
|
||||
return utc;
|
||||
};
|
||||
|
||||
// select time zone strategy. This returns a date-like object tied to the
|
||||
// desired timezone
|
||||
|
||||
function dateGenerator(ts, opts) {
|
||||
if (opts.timezone == "browser") {
|
||||
return new Date(ts);
|
||||
} else if (!opts.timezone || opts.timezone == "utc") {
|
||||
return makeUtcWrapper(new Date(ts));
|
||||
} else if (typeof timezoneJS != "undefined" && typeof timezoneJS.Date != "undefined") {
|
||||
var d = new timezoneJS.Date();
|
||||
// timezone-js is fickle, so be sure to set the time zone before
|
||||
// setting the time.
|
||||
d.setTimezone(opts.timezone);
|
||||
d.setTime(ts);
|
||||
return d;
|
||||
} else {
|
||||
return makeUtcWrapper(new Date(ts));
|
||||
}
|
||||
}
|
||||
|
||||
// map of app. size of time units in milliseconds
|
||||
|
||||
var timeUnitSize = {
|
||||
"second": 1000,
|
||||
"minute": 60 * 1000,
|
||||
"hour": 60 * 60 * 1000,
|
||||
"day": 24 * 60 * 60 * 1000,
|
||||
"month": 30 * 24 * 60 * 60 * 1000,
|
||||
"quarter": 3 * 30 * 24 * 60 * 60 * 1000,
|
||||
"year": 365.2425 * 24 * 60 * 60 * 1000
|
||||
};
|
||||
|
||||
// the allowed tick sizes, after 1 year we use
|
||||
// an integer algorithm
|
||||
|
||||
var baseSpec = [
|
||||
[1, "second"], [2, "second"], [5, "second"], [10, "second"],
|
||||
[30, "second"],
|
||||
[1, "minute"], [2, "minute"], [5, "minute"], [10, "minute"],
|
||||
[30, "minute"],
|
||||
[1, "hour"], [2, "hour"], [4, "hour"],
|
||||
[8, "hour"], [12, "hour"],
|
||||
[1, "day"], [2, "day"], [3, "day"],
|
||||
[0.25, "month"], [0.5, "month"], [1, "month"],
|
||||
[2, "month"]
|
||||
];
|
||||
|
||||
// we don't know which variant(s) we'll need yet, but generating both is
|
||||
// cheap
|
||||
|
||||
var specMonths = baseSpec.concat([[3, "month"], [6, "month"],
|
||||
[1, "year"]]);
|
||||
var specQuarters = baseSpec.concat([[1, "quarter"], [2, "quarter"],
|
||||
[1, "year"]]);
|
||||
|
||||
function init(plot) {
|
||||
plot.hooks.processOptions.push(function (plot, options) {
|
||||
$.each(plot.getAxes(), function(axisName, axis) {
|
||||
|
||||
var opts = axis.options;
|
||||
|
||||
if (opts.mode == "time") {
|
||||
axis.tickGenerator = function(axis) {
|
||||
|
||||
var ticks = [];
|
||||
var d = dateGenerator(axis.min, opts);
|
||||
var minSize = 0;
|
||||
|
||||
// make quarter use a possibility if quarters are
|
||||
// mentioned in either of these options
|
||||
|
||||
var spec = (opts.tickSize && opts.tickSize[1] ===
|
||||
"quarter") ||
|
||||
(opts.minTickSize && opts.minTickSize[1] ===
|
||||
"quarter") ? specQuarters : specMonths;
|
||||
|
||||
if (opts.minTickSize != null) {
|
||||
if (typeof opts.tickSize == "number") {
|
||||
minSize = opts.tickSize;
|
||||
} else {
|
||||
minSize = opts.minTickSize[0] * timeUnitSize[opts.minTickSize[1]];
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < spec.length - 1; ++i) {
|
||||
if (axis.delta < (spec[i][0] * timeUnitSize[spec[i][1]]
|
||||
+ spec[i + 1][0] * timeUnitSize[spec[i + 1][1]]) / 2
|
||||
&& spec[i][0] * timeUnitSize[spec[i][1]] >= minSize) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var size = spec[i][0];
|
||||
var unit = spec[i][1];
|
||||
|
||||
// special-case the possibility of several years
|
||||
|
||||
if (unit == "year") {
|
||||
|
||||
// if given a minTickSize in years, just use it,
|
||||
// ensuring that it's an integer
|
||||
|
||||
if (opts.minTickSize != null && opts.minTickSize[1] == "year") {
|
||||
size = Math.floor(opts.minTickSize[0]);
|
||||
} else {
|
||||
|
||||
var magn = Math.pow(10, Math.floor(Math.log(axis.delta / timeUnitSize.year) / Math.LN10));
|
||||
var norm = (axis.delta / timeUnitSize.year) / magn;
|
||||
|
||||
if (norm < 1.5) {
|
||||
size = 1;
|
||||
} else if (norm < 3) {
|
||||
size = 2;
|
||||
} else if (norm < 7.5) {
|
||||
size = 5;
|
||||
} else {
|
||||
size = 10;
|
||||
}
|
||||
|
||||
size *= magn;
|
||||
}
|
||||
|
||||
// minimum size for years is 1
|
||||
|
||||
if (size < 1) {
|
||||
size = 1;
|
||||
}
|
||||
}
|
||||
|
||||
axis.tickSize = opts.tickSize || [size, unit];
|
||||
var tickSize = axis.tickSize[0];
|
||||
unit = axis.tickSize[1];
|
||||
|
||||
var step = tickSize * timeUnitSize[unit];
|
||||
|
||||
if (unit == "second") {
|
||||
d.setSeconds(floorInBase(d.getSeconds(), tickSize));
|
||||
} else if (unit == "minute") {
|
||||
d.setMinutes(floorInBase(d.getMinutes(), tickSize));
|
||||
} else if (unit == "hour") {
|
||||
d.setHours(floorInBase(d.getHours(), tickSize));
|
||||
} else if (unit == "month") {
|
||||
d.setMonth(floorInBase(d.getMonth(), tickSize));
|
||||
} else if (unit == "quarter") {
|
||||
d.setMonth(3 * floorInBase(d.getMonth() / 3,
|
||||
tickSize));
|
||||
} else if (unit == "year") {
|
||||
d.setFullYear(floorInBase(d.getFullYear(), tickSize));
|
||||
}
|
||||
|
||||
// reset smaller components
|
||||
|
||||
d.setMilliseconds(0);
|
||||
|
||||
if (step >= timeUnitSize.minute) {
|
||||
d.setSeconds(0);
|
||||
}
|
||||
if (step >= timeUnitSize.hour) {
|
||||
d.setMinutes(0);
|
||||
}
|
||||
if (step >= timeUnitSize.day) {
|
||||
d.setHours(0);
|
||||
}
|
||||
if (step >= timeUnitSize.day * 4) {
|
||||
d.setDate(1);
|
||||
}
|
||||
if (step >= timeUnitSize.month * 2) {
|
||||
d.setMonth(floorInBase(d.getMonth(), 3));
|
||||
}
|
||||
if (step >= timeUnitSize.quarter * 2) {
|
||||
d.setMonth(floorInBase(d.getMonth(), 6));
|
||||
}
|
||||
if (step >= timeUnitSize.year) {
|
||||
d.setMonth(0);
|
||||
}
|
||||
|
||||
var carry = 0;
|
||||
var v = Number.NaN;
|
||||
var prev;
|
||||
|
||||
do {
|
||||
|
||||
prev = v;
|
||||
v = d.getTime();
|
||||
ticks.push(v);
|
||||
|
||||
if (unit == "month" || unit == "quarter") {
|
||||
if (tickSize < 1) {
|
||||
|
||||
// a bit complicated - we'll divide the
|
||||
// month/quarter up but we need to take
|
||||
// care of fractions so we don't end up in
|
||||
// the middle of a day
|
||||
|
||||
d.setDate(1);
|
||||
var start = d.getTime();
|
||||
d.setMonth(d.getMonth() +
|
||||
(unit == "quarter" ? 3 : 1));
|
||||
var end = d.getTime();
|
||||
d.setTime(v + carry * timeUnitSize.hour + (end - start) * tickSize);
|
||||
carry = d.getHours();
|
||||
d.setHours(0);
|
||||
} else {
|
||||
d.setMonth(d.getMonth() +
|
||||
tickSize * (unit == "quarter" ? 3 : 1));
|
||||
}
|
||||
} else if (unit == "year") {
|
||||
d.setFullYear(d.getFullYear() + tickSize);
|
||||
} else {
|
||||
d.setTime(v + step);
|
||||
}
|
||||
} while (v < axis.max && v != prev);
|
||||
|
||||
return ticks;
|
||||
};
|
||||
|
||||
axis.tickFormatter = function (v, axis) {
|
||||
|
||||
var d = dateGenerator(v, axis.options);
|
||||
|
||||
// first check global format
|
||||
|
||||
if (opts.timeformat != null) {
|
||||
return formatDate(d, opts.timeformat, opts.monthNames, opts.dayNames);
|
||||
}
|
||||
|
||||
// possibly use quarters if quarters are mentioned in
|
||||
// any of these places
|
||||
|
||||
var useQuarters = (axis.options.tickSize &&
|
||||
axis.options.tickSize[1] == "quarter") ||
|
||||
(axis.options.minTickSize &&
|
||||
axis.options.minTickSize[1] == "quarter");
|
||||
|
||||
var t = axis.tickSize[0] * timeUnitSize[axis.tickSize[1]];
|
||||
var span = axis.max - axis.min;
|
||||
var suffix = (opts.twelveHourClock) ? " %p" : "";
|
||||
var hourCode = (opts.twelveHourClock) ? "%I" : "%H";
|
||||
var fmt;
|
||||
|
||||
if (t < timeUnitSize.minute) {
|
||||
fmt = hourCode + ":%M:%S" + suffix;
|
||||
} else if (t < timeUnitSize.day) {
|
||||
if (span < 2 * timeUnitSize.day) {
|
||||
fmt = hourCode + ":%M" + suffix;
|
||||
} else {
|
||||
fmt = "%b %d " + hourCode + ":%M" + suffix;
|
||||
}
|
||||
} else if (t < timeUnitSize.month) {
|
||||
fmt = "%b %d";
|
||||
} else if ((useQuarters && t < timeUnitSize.quarter) ||
|
||||
(!useQuarters && t < timeUnitSize.year)) {
|
||||
if (span < timeUnitSize.year) {
|
||||
fmt = "%b";
|
||||
} else {
|
||||
fmt = "%b %Y";
|
||||
}
|
||||
} else if (useQuarters && t < timeUnitSize.year) {
|
||||
if (span < timeUnitSize.year) {
|
||||
fmt = "Q%q";
|
||||
} else {
|
||||
fmt = "Q%q %Y";
|
||||
}
|
||||
} else {
|
||||
fmt = "%Y";
|
||||
}
|
||||
|
||||
var rt = formatDate(d, fmt, opts.monthNames, opts.dayNames);
|
||||
|
||||
return rt;
|
||||
};
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'time',
|
||||
version: '1.0'
|
||||
});
|
||||
|
||||
// Time-axis support used to be in Flot core, which exposed the
|
||||
// formatDate function on the plot object. Various plugins depend
|
||||
// on the function, so we need to re-expose it here.
|
||||
|
||||
$.plot.formatDate = formatDate;
|
||||
$.plot.dateGenerator = dateGenerator;
|
||||
|
||||
})(jQuery);
|
||||
|
||||
var ws = null;
|
||||
var connected = false;
|
||||
|
||||
$(document).ready(function() {
|
||||
var startTime = Date.now();
|
||||
var graphDurationSeconds = 30;
|
||||
|
||||
// Initialize graph
|
||||
var createGraph = function(title) {
|
||||
var $c = $('<div class="graph"/>').appendTo('#graphs');
|
||||
var past = Date.now() - graphDurationSeconds * 1000;
|
||||
var options = {
|
||||
lines: {
|
||||
xfill: true,
|
||||
lineWidth: 1,
|
||||
xfillColor: {colors: [ { opacity: 0 }, { opacity: 1 } ] }
|
||||
},
|
||||
grid: { borderWidth: 1, borderColor: '#ccc'},
|
||||
xaxis: { mode: 'time', ticks: 5 },
|
||||
legend: { labelBoxBorderColor: '#fff' },
|
||||
xcolors: [ '#fec', '#396', '#e39', '#9e2' ],
|
||||
hooks: {
|
||||
draw: [function(plot, canvas) {
|
||||
canvas.font = '15px sans-serif';
|
||||
canvas.fillStyle = '#999';
|
||||
canvas.fillText(title, 35, 25);
|
||||
}]
|
||||
}
|
||||
};
|
||||
return $.plot($c, [], options);
|
||||
};
|
||||
|
||||
var updateGraph = function(g) {
|
||||
if (!connected) return;
|
||||
var now = Date.now();
|
||||
//if (now - g.lastUpdateTime < 50) return;
|
||||
g.lastUpdateTime = now;
|
||||
var oldest = now - graphDurationSeconds * 1000;
|
||||
g.data[0].data = [[oldest, null], [now, null]];
|
||||
|
||||
// Remove old points
|
||||
$.each(g.data, function(di, d) {
|
||||
while (d.data.length > 0 && d.data[0][0] < oldest) {
|
||||
d.data.shift();
|
||||
}
|
||||
});
|
||||
|
||||
g.plot.setData(g.data);
|
||||
g.plot.setupGrid();
|
||||
g.plot.draw();
|
||||
};
|
||||
|
||||
var graphs = {
|
||||
led: {
|
||||
title: 'LED state',
|
||||
plot: null,
|
||||
lastUpdateTime: null,
|
||||
data: [
|
||||
{ show: false, data: [] },
|
||||
{ label: "LED state", color: '#36c', data: [] },
|
||||
]
|
||||
},
|
||||
accel: {
|
||||
title: 'Accelerometer',
|
||||
plot: null,
|
||||
lastUpdateTime: null,
|
||||
data: [
|
||||
{ show: false, data: [] },
|
||||
{ label: "x", color: '#f00', data: [] },
|
||||
{ label: "y", color: '#0f0', data: [] },
|
||||
{ label: "z", color: '#00f', data: [] },
|
||||
]
|
||||
},
|
||||
temp: {
|
||||
title: 'Sensor die temperature',
|
||||
plot: null,
|
||||
lastUpdateTime: null,
|
||||
data: [
|
||||
{ show: false, data: [] },
|
||||
{ label: 'Celsius', color: '#36c', data: []},
|
||||
]
|
||||
},
|
||||
};
|
||||
|
||||
$.each(graphs, function(k, v) {
|
||||
v.plot = createGraph(v.title);
|
||||
setInterval(function() { updateGraph(v); }, 100);
|
||||
});
|
||||
|
||||
function wsConnect() {
|
||||
if (ws != null) return;
|
||||
var wsAddr = 'ws://' + location.host;
|
||||
console.log('Connecting to', wsAddr);
|
||||
ws = new WebSocket(wsAddr);
|
||||
ws.onopen = function() {
|
||||
console.log('Connected');
|
||||
connected = true;
|
||||
};
|
||||
ws.onclose = function() {
|
||||
console.log('Disconnected');
|
||||
connected = false;
|
||||
ws = null;
|
||||
};
|
||||
ws.onmessage = handleWsMessage;
|
||||
}
|
||||
|
||||
function handleWsMessage(ev) {
|
||||
try {
|
||||
var obj = JSON.parse(ev.data);
|
||||
//var timestamp = startTime + parseInt(obj.ts * 1000);
|
||||
var timestamp = Date.now();
|
||||
|
||||
if (obj.t == 0) {
|
||||
graphs.temp.data[1].data.push([timestamp, obj.dt]);
|
||||
updateGraph(graphs.temp);
|
||||
} else if (obj.t == 1) {
|
||||
graphs.led.data[1].data.push([timestamp, obj.v]);
|
||||
updateGraph(graphs.led);
|
||||
} else if (obj.t == 2) {
|
||||
graphs.accel.data[1].data.push([timestamp, obj.x]);
|
||||
graphs.accel.data[2].data.push([timestamp, obj.y]);
|
||||
graphs.accel.data[3].data.push([timestamp, obj.z]);
|
||||
updateGraph(graphs.accel);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e, ev.data);
|
||||
};
|
||||
};
|
||||
|
||||
$(document).on('click', '#on_off_button', function() {
|
||||
var state = $(this).text().match(/off/) ? 0 : 1;
|
||||
$(this).text(state ? 'Switch LED off' : 'Switch LED on');
|
||||
ws.send(JSON.stringify({ t: 1, v: state }));
|
||||
});
|
||||
|
||||
wsConnect();
|
||||
setInterval(wsConnect, 1000);
|
||||
});
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2016 Cesanta Software Limited
|
||||
* All rights reserved
|
||||
*/
|
||||
|
||||
#include "tmp006.h"
|
||||
|
||||
#include "mongoose.h"
|
||||
|
||||
#include "i2c_if.h"
|
||||
|
||||
#define TMP006_REG_SENSOR_VOLTAGE 0x00
|
||||
#define TMP006_REG_DIE_TEMP 0x01
|
||||
#define TMP006_REG_CONFIG 0x02
|
||||
|
||||
bool tmp006_init(uint8_t addr, enum tmp006_conversion_rate conv_rate,
|
||||
bool drdy_en) {
|
||||
unsigned char val[3] = {TMP006_REG_CONFIG, 0x80, 0};
|
||||
/* Reset first */
|
||||
if (I2C_IF_Write(addr, val, 3, 1) != 0) return false;
|
||||
val[1] = 0x70 | (conv_rate << 1) | drdy_en;
|
||||
return (I2C_IF_Write(addr, val, 3, 1) == 0);
|
||||
}
|
||||
|
||||
double tmp006_read_sensor_voltage(uint8_t addr) {
|
||||
unsigned char reg = TMP006_REG_SENSOR_VOLTAGE;
|
||||
unsigned char val[2] = {0, 0};
|
||||
int status = I2C_IF_ReadFrom(addr, ®, 1, val, 2);
|
||||
if (status < 0) return -1000;
|
||||
int voltage = (val[0] << 8) | val[1];
|
||||
if (val[0] & 0x80) voltage = -((1 << 16) - voltage);
|
||||
return voltage * 0.00015625;
|
||||
}
|
||||
|
||||
double tmp006_read_die_temp(uint8_t addr) {
|
||||
unsigned char reg = TMP006_REG_DIE_TEMP;
|
||||
unsigned char val[2] = {0, 0};
|
||||
int status = I2C_IF_ReadFrom(addr, ®, 1, val, 2);
|
||||
if (status < 0) return -1000;
|
||||
int temp = (val[0] << 6) | (val[1] >> 2);
|
||||
if (val[0] & 0x80) temp = -((1 << 14) - temp);
|
||||
return temp / 32.0;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2016 Cesanta Software Limited
|
||||
* All rights reserved
|
||||
*/
|
||||
|
||||
#ifndef CS_MONGOOSE_EXAMPLES_CC3200_TMP006_H_
|
||||
#define CS_MONGOOSE_EXAMPLES_CC3200_TMP006_H_
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
enum tmp006_conversion_rate {
|
||||
TMP006_CONV_4 = 0,
|
||||
TMP006_CONV_2,
|
||||
TMP006_CONV_1,
|
||||
TMP006_CONV_1_2,
|
||||
TMP006_CONV_1_4,
|
||||
};
|
||||
|
||||
bool tmp006_init(uint8_t addr, enum tmp006_conversion_rate conv_rate,
|
||||
bool drdy_en);
|
||||
double tmp006_read_sensor_voltage(uint8_t addr);
|
||||
double tmp006_read_die_temp(uint8_t addr);
|
||||
|
||||
#define TMP006_INVALID_READING (-1000.0)
|
||||
|
||||
#endif /* CS_MONGOOSE_EXAMPLES_CC3200_TMP006_H_ */
|
||||
@@ -0,0 +1,166 @@
|
||||
#include "wifi.h"
|
||||
|
||||
#include "mongoose.h"
|
||||
|
||||
#include <simplelink/cc_pal.h>
|
||||
#include <simplelink/include/wlan.h>
|
||||
|
||||
#include <inc/hw_types.h>
|
||||
|
||||
#include <driverlib/gpio.h>
|
||||
#include <driverlib/utils.h>
|
||||
|
||||
#include <example/common/gpio_if.h>
|
||||
#include "cs_dbg.h"
|
||||
|
||||
void SimpleLinkWlanEventHandler(SlWlanEvent_t *e) {
|
||||
switch (e->Event) {
|
||||
case SL_WLAN_CONNECT_EVENT:
|
||||
LOG(LL_INFO, ("WiFi: connected, getting IP"));
|
||||
break;
|
||||
case SL_WLAN_STA_CONNECTED_EVENT:
|
||||
LOG(LL_INFO, ("WiFi: station connected"));
|
||||
break;
|
||||
case SL_WLAN_STA_DISCONNECTED_EVENT:
|
||||
LOG(LL_INFO, ("WiFi: station disconnected"));
|
||||
break;
|
||||
default:
|
||||
LOG(LL_INFO, ("WiFi: event %d", e->Event));
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleLinkNetAppEventHandler(SlNetAppEvent_t *e) {
|
||||
if (e->Event == SL_NETAPP_IPV4_IPACQUIRED_EVENT) {
|
||||
SlIpV4AcquiredAsync_t *ed = &e->EventData.ipAcquiredV4;
|
||||
LOG(LL_INFO, ("IP acquired: %lu.%lu.%lu.%lu", SL_IPV4_BYTE(ed->ip, 3),
|
||||
SL_IPV4_BYTE(ed->ip, 2), SL_IPV4_BYTE(ed->ip, 1),
|
||||
SL_IPV4_BYTE(ed->ip, 0)));
|
||||
GPIO_IF_LedToggle(MCU_RED_LED_GPIO);
|
||||
} else if (e->Event == SL_NETAPP_IP_LEASED_EVENT) {
|
||||
LOG(LL_INFO, ("IP leased"));
|
||||
} else {
|
||||
LOG(LL_INFO, ("NetApp event %d", e->Event));
|
||||
}
|
||||
}
|
||||
|
||||
bool wifi_setup_ap(const char *ssid, const char *pass, int channel) {
|
||||
uint8_t v;
|
||||
if (sl_WlanSetMode(ROLE_AP) != 0) {
|
||||
return false;
|
||||
}
|
||||
if (sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_SSID, strlen(ssid),
|
||||
(const uint8_t *) ssid) != 0) {
|
||||
return false;
|
||||
}
|
||||
v = strlen(pass) > 0 ? SL_SEC_TYPE_WPA : SL_SEC_TYPE_OPEN;
|
||||
if (sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_SECURITY_TYPE, 1, &v) != 0) {
|
||||
return false;
|
||||
}
|
||||
if (v == SL_SEC_TYPE_WPA &&
|
||||
sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_PASSWORD, strlen(pass),
|
||||
(const uint8_t *) pass) != 0) {
|
||||
return false;
|
||||
}
|
||||
v = channel;
|
||||
if (sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_CHANNEL, 1, &v) != 0) {
|
||||
return false;
|
||||
}
|
||||
sl_NetAppStop(SL_NET_APP_DHCP_SERVER_ID);
|
||||
{
|
||||
SlNetCfgIpV4Args_t ipcfg;
|
||||
memset(&ipcfg, 0, sizeof(ipcfg));
|
||||
if (!inet_pton(AF_INET, "192.168.4.1", &ipcfg.ipV4) ||
|
||||
!inet_pton(AF_INET, "255.255.255.0", &ipcfg.ipV4Mask) ||
|
||||
/* This means "disable". 0.0.0.0 won't do. */
|
||||
!inet_pton(AF_INET, "255.255.255.255", &ipcfg.ipV4DnsServer) ||
|
||||
/* We'd like to disable gateway too, but DHCP server refuses to start.
|
||||
*/
|
||||
!inet_pton(AF_INET, "192.168.4.1", &ipcfg.ipV4Gateway) ||
|
||||
sl_NetCfgSet(SL_IPV4_AP_P2P_GO_STATIC_ENABLE, IPCONFIG_MODE_ENABLE_IPV4,
|
||||
sizeof(ipcfg), (uint8_t *) &ipcfg) != 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
{
|
||||
SlNetAppDhcpServerBasicOpt_t dhcpcfg;
|
||||
memset(&dhcpcfg, 0, sizeof(dhcpcfg));
|
||||
dhcpcfg.lease_time = 900;
|
||||
if (!inet_pton(AF_INET, "192.168.4.20", &dhcpcfg.ipv4_addr_start) ||
|
||||
!inet_pton(AF_INET, "192.168.4.200", &dhcpcfg.ipv4_addr_last) ||
|
||||
sl_NetAppSet(SL_NET_APP_DHCP_SERVER_ID, NETAPP_SET_DHCP_SRV_BASIC_OPT,
|
||||
sizeof(dhcpcfg), (uint8_t *) &dhcpcfg) != 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
sl_Stop(0);
|
||||
sl_Start(NULL, NULL, NULL);
|
||||
if (sl_NetAppStart(SL_NET_APP_DHCP_SERVER_ID) != 0) {
|
||||
LOG(LL_ERROR, ("DHCP server failed to start"));
|
||||
return false;
|
||||
}
|
||||
LOG(LL_INFO, ("WiFi: AP %s configured, IP 192.168.4.1", ssid));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wifi_setup_sta(const char *ssid, const char *pass) {
|
||||
SlSecParams_t sp;
|
||||
LOG(LL_INFO, ("WiFi: connecting to %s", ssid));
|
||||
if (sl_WlanSetMode(ROLE_STA) != 0) return false;
|
||||
sl_Stop(0);
|
||||
sl_Start(NULL, NULL, NULL);
|
||||
sl_WlanDisconnect();
|
||||
sp.Key = (_i8 *) pass;
|
||||
sp.KeyLen = strlen(pass);
|
||||
sp.Type = sp.KeyLen ? SL_SEC_TYPE_WPA : SL_SEC_TYPE_OPEN;
|
||||
if (sl_WlanConnect((const _i8 *) ssid, strlen(ssid), 0, &sp, 0) != 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* In SDK 1.2.0 TI decided to stop resetting NWP before sl_Start, which in
|
||||
* practice means that sl_start will hang on subsequent runs after the first.
|
||||
*
|
||||
* See this post for details and suggested solution:
|
||||
* https://e2e.ti.com/support/wireless_connectivity/simplelink_wifi_cc31xx_cc32xx/f/968/p/499123/1806610#1806610
|
||||
*
|
||||
* However, since they don't provide OS_debug variant of simplelink.a and
|
||||
* adding another project dependency will complicate our demo even more,
|
||||
* we just take the required bit of code.
|
||||
*
|
||||
* This is a copy-paste of NwpPowerOnPreamble from cc_pal.c.
|
||||
*/
|
||||
void stop_nwp(void) {
|
||||
#define MAX_RETRY_COUNT 1000
|
||||
unsigned int sl_stop_ind, apps_int_sts_raw, nwp_lpds_wake_cfg;
|
||||
unsigned int retry_count;
|
||||
/* Perform the sl_stop equivalent to ensure network services
|
||||
are turned off if active */
|
||||
HWREG(0x400F70B8) = 1; /* APPs to NWP interrupt */
|
||||
UtilsDelay(800000 / 5);
|
||||
|
||||
retry_count = 0;
|
||||
nwp_lpds_wake_cfg = HWREG(0x4402D404);
|
||||
sl_stop_ind = HWREG(0x4402E16C);
|
||||
|
||||
if ((nwp_lpds_wake_cfg != 0x20) && /* Check for NWP POR condition */
|
||||
!(sl_stop_ind & 0x2)) /* Check if sl_stop was executed */
|
||||
{
|
||||
/* Loop until APPs->NWP interrupt is cleared or timeout */
|
||||
while (retry_count < MAX_RETRY_COUNT) {
|
||||
apps_int_sts_raw = HWREG(0x400F70C0);
|
||||
if (apps_int_sts_raw & 0x1) {
|
||||
UtilsDelay(800000 / 5);
|
||||
retry_count++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
HWREG(0x400F70B0) = 1; /* Clear APPs to NWP interrupt */
|
||||
UtilsDelay(800000 / 5);
|
||||
|
||||
/* Stop the networking services */
|
||||
NwpPowerOff();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2016 Cesanta Software Limited
|
||||
* All rights reserved
|
||||
*/
|
||||
|
||||
#ifndef CS_MONGOOSE_EXAMPLES_CC3200_WIFI_H_
|
||||
#define CS_MONGOOSE_EXAMPLES_CC3200_WIFI_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
bool wifi_setup_ap(const char *ssid, const char *pass, int channel);
|
||||
bool wifi_setup_sta(const char *ssid, const char *pass);
|
||||
void stop_nwp(void);
|
||||
|
||||
#endif /* CS_MONGOOSE_EXAMPLES_CC3200_WIFI_H_ */
|
||||
Reference in new issue
Block a user