Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.2 master snap #2340

Merged
merged 87 commits into from
Apr 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
082015e
Add doc link for bootreason EXCCAUSE
marcelstoer Aug 27, 2017
9f022e9
Manually applying changes from #2093
marcelstoer Aug 31, 2017
ee3d72f
Fix markdown syntax
marcelstoer Aug 31, 2017
ce1712d
Add additional note wrt rtctime
marcelstoer Aug 31, 2017
4324ea0
Correct typo
marcelstoer Sep 14, 2017
e4d010e
Handle doublequotes in strings. (#2104)
pjsg Sep 15, 2017
7946dea
Added boolean return value for wifi.sta.sethostname (#2079)
dnc40085 Sep 15, 2017
119835b
Update WiFi code sample
marcelstoer Sep 28, 2017
3e60fa8
Fix data loss in TCP streams. (#2097)
Sep 28, 2017
ec6ed6f
Better documentation for mqtt:lwt() (#2128)
dbaumgarten Oct 5, 2017
aebfd1a
Swap reading y and z values (#2137)
Suraj151 Oct 16, 2017
ded599f
Add missing admonitions (#2107)
marcelstoer Oct 19, 2017
5c8619e
ws2812 mix: add all, then divide (#2032)
nwf Oct 22, 2017
1a6e83d
Fixes problems with time not preserved through dsleep (#2148)
pjsg Oct 28, 2017
26540cf
LuaOTA provisioning system (#2060)
TerryE Oct 28, 2017
4a91464
Fixed broken wifi.sta.{dis,}connect() with event mon enabled. (#2098)
Oct 28, 2017
f17b5eb
Make it build without INTERRUPT_ENABLE
pjsg Oct 29, 2017
ffc914d
Merge pull request #2152 from pjsg/fix-no-int
TerryE Oct 29, 2017
0f77162
Make the CRON module work reliably (#2153)
pjsg Oct 30, 2017
5ece2fd
Another dsleep fix (or rather a not-deep-sleep case) (#2155)
pjsg Nov 3, 2017
b2ce0e8
fix example which is not intended to write to flash, but actually was…
mdeneen Nov 18, 2017
4af68d8
WiFi method to adjust maximum TX power (#2171)
mdeneen Nov 19, 2017
a037e84
Enhance setmaxtxpower description
marcelstoer Nov 19, 2017
87a6a9b
Add BME680 module (#2151)
vsky279 Nov 19, 2017
ef91580
Addition of a Bloom Filter object (#2176)
pjsg Dec 3, 2017
11c47fa
New version of spiffs (#2172)
pjsg Dec 3, 2017
368c25d
Add WiFi mode documentation (#2191)
marcelstoer Dec 17, 2017
9aebc84
Add support of counting of interrupts (#2149)
pjsg Dec 17, 2017
3747d7c
Minor update flashing docs
marcelstoer Dec 18, 2017
442e3e2
Update file.c
bastos1505 Dec 19, 2017
bee404c
Merge pull request #2201 from bastos1505/patch-1
pjsg Dec 20, 2017
e0f811d
Fix the use of the term "Lua"
marcelstoer Dec 25, 2017
05b0a01
host field in HTTP header is no longer limited to 31 charcters (#2210)
paweljasinski Dec 25, 2017
452778e
Fix batch multi-line UART input discarding all but first line (#2217)
Jan 4, 2018
0e491e8
remove guidance to fall back to 1.5.4.1 for 512Kb modules (#2222)
devsaurus Jan 10, 2018
77fe510
Addition of gpio.pulse functions (#2190)
pjsg Jan 10, 2018
ceadd30
Add support for the wifi monitor mode in the SDK (#2204)
pjsg Jan 10, 2018
fc2f325
add missing NULLification of serout.delay_table after luaM_freearray(…
devsaurus Jan 10, 2018
6576af9
Update mbedTLS (#2214)
nwf Jan 10, 2018
9dc574d
Increase irom0_0_seg for PR builds (again), supports #2008
marcelstoer Jan 10, 2018
58d4e06
Increase iram1_0_seg for PR builds, supports #2008
marcelstoer Jan 10, 2018
df930c2
Add sqlite3 module (#2008)
luizfeliperj Jan 10, 2018
d0c5587
initialize task ids only once at module open
devsaurus Jan 14, 2018
73c9700
Merge pull request #2228 from devsaurus/pcm_fix_leak
TerryE Jan 15, 2018
a0ea61f
remove inline declarations
devsaurus Jan 20, 2018
6ef6db9
Merge pull request #2233 from devsaurus/remove_inline
TerryE Jan 21, 2018
316a5fc
With RTD the JS search seems no longer necessary
marcelstoer Jan 21, 2018
ed56d94
ws2812 effects library (#2215)
skycoders Jan 23, 2018
f87d68f
added support for ads1015 (#2231)
paweljasinski Jan 29, 2018
555b557
Add sjson streaming example
marcelstoer Feb 4, 2018
e3807bd
enforce single source for SSL buffer size (#2248)
devsaurus Feb 7, 2018
2a94402
introduced sign into read and startread (#2246)
paweljasinski Feb 7, 2018
ba36cb3
MQTT re-connect issue (#2256)
FrankX0 Feb 9, 2018
5c65f27
Remove custom favicon from docs
marcelstoer Feb 11, 2018
f404627
Mention that PyFlasher now offers .dmg for macOS
marcelstoer Feb 12, 2018
1a39a9f
disable (and clear) unexpected interrupts (#2234)
devsaurus Feb 13, 2018
e9ed1a8
Disable MQTT connect error callback after successful connection (#2262)
FrankX0 Feb 13, 2018
6027d86
Add .ccache
marcelstoer Feb 13, 2018
8d2c523
Fix WS2812 effects documentation
marcelstoer Feb 13, 2018
bc1e34b
Add missing BME680
marcelstoer Feb 13, 2018
f05bbb1
Adjust module count
marcelstoer Feb 13, 2018
0bf035a
Fix gpio.pulse admonition
marcelstoer Feb 15, 2018
1117e9e
Add tiny SQLite example
marcelstoer Feb 15, 2018
97e34ce
Fix a number of issues with the gpio.pulse family of functions (#2260)
pjsg Feb 23, 2018
c8d2937
Fix invalid table item key
marcelstoer Feb 26, 2018
76ae04f
Fix problem with gpio.input (#2281)
pjsg Feb 28, 2018
4a47382
align wifi.sta.config table elements connected_cb and disconnected_cb…
devsaurus Mar 1, 2018
f2d605d
Fix SNTP so that it retries DNS lookups if it needs to (#2283)
pjsg Mar 1, 2018
ba9a938
Removing large number of defines inside makefile, exporting them to a…
Mar 3, 2018
5c8af3c
Update mbedTLS to 2.7.0 (#2267)
nwf Mar 3, 2018
c7673b0
Merge remote-tracking branch 'upstream/dev' into dev
Mar 12, 2018
4367e6e
remove deprecated init functions in adxl345, am2320, bme280, bmp085, …
devsaurus Mar 12, 2018
c972d86
Update to sdk 2.2
nwf Feb 20, 2018
f3ebfa9
user_version.h: use ESP_SDK* constants
nwf Mar 13, 2018
be53d5c
Merge pull request #2297 from luizfeliperj/dev
TerryE Mar 16, 2018
96601b6
Merge pull request #2269 from nwf/for-upstream-sdk22
devsaurus Mar 20, 2018
c7006df
Ignore lookup errors on sync request unless all lookups fail (#2298)
pjsg Mar 21, 2018
f831185
revert os_delay_us() usage to uint32 (#2310)
devsaurus Mar 21, 2018
6218b92
initialize new memebers in station_config and scan_config (#2309)
devsaurus Mar 23, 2018
3db6479
Patch SDK to 2.2.x branch, commit f8f27ce (#2312)
devsaurus Mar 24, 2018
519d6df
update nodemcu version in README.md, build.md, flash.md
devsaurus Mar 24, 2018
d78c54a
Fix Lua stack corruption problem
TerryE Mar 26, 2018
477116f
Merge pull request #2320 from TerryE/devLuaStackFix
TerryE Mar 26, 2018
98d5b12
Fix node.stripdebug level numbers (Lua vs. C)
marcelstoer Mar 28, 2018
9af4f58
Added functions wifi.getcountry() and wifi.setcountry() (#2330)
dnc40085 Mar 31, 2018
b81963a
net socket documentation clarification in FAQ (#2339)
joysfera Apr 2, 2018
18f33f5
Reformat Lua FAQ
marcelstoer Apr 2, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
sdk/
cache/
.ccache/
user_config.h
server-ca.crt

Expand Down
72 changes: 48 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@
#
.NOTPARALLEL:

# SDK version NodeMCU is locked to
SDK_VER:=2.1.0
# SDK base version, as released by Espressif
SDK_BASE_VER:=2.2.0

# no patch: SDK_BASE_VER equals SDK_VER and sdk dir depends on sdk_extracted
SDK_BASE_VER:=$(SDK_VER)
SDK_DIR_DEPENDS:=sdk_extracted
# with patch: SDK_BASE_VER differs from SDK_VER and sdk dir depends on sdk_patched
#SDK_BASE_VER:=1.5.4
#SDK_DIR_DEPENDS:=sdk_patched
# no patch: SDK_VER equals SDK_BASE_VER and sdk dir depends on sdk_extracted
#SDK_VER:=$(SDK_BASE_VER)
#SDK_DIR_DEPENDS:=sdk_extracted

# with patch: SDK_VER differs from SDK_BASE_VER and sdk dir depends on sdk_patched
SDK_PATCH_VER:=f8f27ce
SDK_VER:=$(SDK_BASE_VER)-$(SDK_PATCH_VER)
SDK_DIR_DEPENDS:=sdk_patched

SDK_FILE_VER:=$(SDK_BASE_VER)
SDK_FILE_SHA1:=66a4272894dc1bcec19f5f8bf79fee80f60a021b
#SDK_PATCH_VER:=$(SDK_VER)_patch_20160704
#SDK_PATCH_SHA1:=388d9e91df74e3b49fca126da482cf822cf1ebf1
SDK_FILE_SHA1:=8b63f1066d3560ff77f119e8ba30a9c39e7baaad
SDK_PATCH_SHA1:=0bc21ec77b08488f04d3e1c9d161b711d07201a8
# Ensure we search "our" SDK before the tool-chain's SDK (if any)
TOP_DIR:=$(abspath $(dir $(lastword $(MAKEFILE_LIST))))
SDK_DIR:=$(TOP_DIR)/sdk/esp_iot_sdk_v$(SDK_VER)
CCFLAGS:= -I$(TOP_DIR)/sdk-overrides/include -I$(SDK_DIR)/include
SDK_REL_DIR=sdk/esp_iot_sdk_v$(SDK_VER)
SDK_DIR:=$(TOP_DIR)/$(SDK_REL_DIR)
CCFLAGS:= -I$(TOP_DIR)/sdk-overrides/include -I$(TOP_DIR)/app/include/lwip/app -I$(SDK_DIR)/include
LDFLAGS:= -L$(SDK_DIR)/lib -L$(SDK_DIR)/ld $(LDFLAGS)

ifdef DEBUG
Expand All @@ -39,6 +41,7 @@ ifeq ($(OS),Windows_NT)
# It is xcc
AR = xt-ar
CC = xt-xcc
CXX = xt-xcc
NM = xt-nm
CPP = xt-cpp
OBJCOPY = xt-objcopy
Expand All @@ -50,6 +53,7 @@ ifeq ($(OS),Windows_NT)
CCFLAGS += -ffunction-sections -fno-jump-tables -fdata-sections
AR = xtensa-lx106-elf-ar
CC = xtensa-lx106-elf-gcc
CXX = xtensa-lx106-elf-g++
NM = xtensa-lx106-elf-nm
CPP = xtensa-lx106-elf-cpp
OBJCOPY = xtensa-lx106-elf-objcopy
Expand Down Expand Up @@ -77,6 +81,7 @@ else
CCFLAGS += -ffunction-sections -fno-jump-tables -fdata-sections
AR = xtensa-lx106-elf-ar
CC = $(WRAPCC) xtensa-lx106-elf-gcc
CXX = $(WRAPCC) xtensa-lx106-elf-g++
NM = xtensa-lx106-elf-nm
CPP = $(WRAPCC) xtensa-lx106-elf-gcc -E
OBJCOPY = xtensa-lx106-elf-objcopy
Expand Down Expand Up @@ -104,6 +109,7 @@ ESPTOOL ?= ../tools/esptool.py


CSRCS ?= $(wildcard *.c)
CXXSRCS ?= $(wildcard *.cpp)
ASRCs ?= $(wildcard *.s)
ASRCS ?= $(wildcard *.S)
SUBDIRS ?= $(patsubst %/,%,$(dir $(filter-out tools/Makefile,$(wildcard */Makefile))))
Expand All @@ -112,10 +118,12 @@ ODIR := .output
OBJODIR := $(ODIR)/$(TARGET)/$(FLAVOR)/obj

OBJS := $(CSRCS:%.c=$(OBJODIR)/%.o) \
$(CXXSRCS:%.cpp=$(OBJODIR)/%.o) \
$(ASRCs:%.s=$(OBJODIR)/%.o) \
$(ASRCS:%.S=$(OBJODIR)/%.o)

DEPS := $(CSRCS:%.c=$(OBJODIR)/%.d) \
$(CXXSCRS:%.cpp=$(OBJODIR)/%.d) \
$(ASRCs:%.s=$(OBJODIR)/%.d) \
$(ASRCS:%.S=$(OBJODIR)/%.d)

Expand Down Expand Up @@ -196,36 +204,41 @@ $(BINODIR)/%.bin: $(IMAGEODIR)/%.out
# Should be done in top-level makefile only
#

all: $(SDK_DIR_DEPENDS) pre_build .subdirs $(OBJS) $(OLIBS) $(OIMAGES) $(OBINS) $(SPECIAL_MKTARGETS)
all: sdk_pruned pre_build .subdirs $(OBJS) $(OLIBS) $(OIMAGES) $(OBINS) $(SPECIAL_MKTARGETS)

.PHONY: sdk_extracted
.PHONY: sdk_patched
.PHONY: sdk_pruned

sdk_extracted: $(TOP_DIR)/sdk/.extracted-$(SDK_BASE_VER)
sdk_patched: sdk_extracted $(TOP_DIR)/sdk/.patched-$(SDK_VER)
sdk_pruned: $(SDK_DIR_DEPENDS) $(TOP_DIR)/sdk/.pruned-$(SDK_VER)

$(TOP_DIR)/sdk/.extracted-$(SDK_BASE_VER): $(TOP_DIR)/cache/v$(SDK_FILE_VER).zip
mkdir -p "$(dir $@)"
(cd "$(dir $@)" && rm -fr esp_iot_sdk_v$(SDK_VER) ESP8266_NONOS_SDK-$(SDK_VER) && unzip $(TOP_DIR)/cache/v$(SDK_FILE_VER).zip ESP8266_NONOS_SDK-$(SDK_VER)/lib/* ESP8266_NONOS_SDK-$(SDK_VER)/ld/eagle.rom.addr.v6.ld ESP8266_NONOS_SDK-$(SDK_VER)/include/* ESP8266_NONOS_SDK-$(SDK_VER)/bin/esp_init_data_default.bin)
mv $(dir $@)/ESP8266_NONOS_SDK-$(SDK_VER) $(dir $@)/esp_iot_sdk_v$(SDK_VER)
rm -f $(SDK_DIR)/lib/liblwip.a
(cd "$(dir $@)" && rm -fr esp_iot_sdk_v$(SDK_VER) ESP8266_NONOS_SDK-$(SDK_BASE_VER) && unzip $(TOP_DIR)/cache/v$(SDK_FILE_VER).zip ESP8266_NONOS_SDK-$(SDK_BASE_VER)/lib/* ESP8266_NONOS_SDK-$(SDK_BASE_VER)/ld/eagle.rom.addr.v6.ld ESP8266_NONOS_SDK-$(SDK_BASE_VER)/include/* ESP8266_NONOS_SDK-$(SDK_BASE_VER)/bin/esp_init_data_default_v05.bin)
mv $(dir $@)/ESP8266_NONOS_SDK-$(SDK_BASE_VER) $(dir $@)/esp_iot_sdk_v$(SDK_BASE_VER)
touch $@

$(TOP_DIR)/sdk/.patched-$(SDK_VER): $(TOP_DIR)/cache/$(SDK_PATCH_VER).patch
mv $(dir $@)/esp_iot_sdk_v$(SDK_BASE_VER) $(dir $@)/esp_iot_sdk_v$(SDK_VER)
git apply --verbose -p1 --exclude='*VERSION' --exclude='*bin/at*' --directory=$(SDK_REL_DIR) $<
touch $@

$(TOP_DIR)/sdk/.patched-$(SDK_VER): $(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_PATCH_VER).zip
mkdir -p "$(dir $@)/patch"
(cd "$(dir $@)/patch" && unzip $(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_PATCH_VER)*.zip *.a esp_init_data_default.bin && mv *.a $(SDK_DIR)/lib/ && mv esp_init_data_default.bin $(SDK_DIR)/bin/)
rmdir $(dir $@)/patch
rm -f $(SDK_DIR)/lib/liblwip.a
$(TOP_DIR)/sdk/.pruned-$(SDK_VER):
rm -f $(SDK_DIR)/lib/liblwip.a $(SDK_DIR)/lib/libssl.a $(SDK_DIR)/lib/libmbedtls.a
ar d $(SDK_DIR)/lib/libmain.a time.o
ar d $(SDK_DIR)/lib/libc.a lib_a-time.o
touch $@

$(TOP_DIR)/cache/v$(SDK_FILE_VER).zip:
mkdir -p "$(dir $@)"
wget --tries=10 --timeout=15 --waitretry=30 --read-timeout=20 --retry-connrefused https://github.com/espressif/ESP8266_NONOS_SDK/archive/v$(SDK_FILE_VER).zip -O $@ || { rm -f "$@"; exit 1; }
(echo "$(SDK_FILE_SHA1) $@" | sha1sum -c -) || { rm -f "$@"; exit 1; }

$(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_PATCH_VER).zip:
$(TOP_DIR)/cache/$(SDK_PATCH_VER).patch:
mkdir -p "$(dir $@)"
wget --tries=10 --timeout=15 --waitretry=30 --read-timeout=20 --retry-connrefused http://espressif.com/sites/default/files/sdks/esp8266_nonos_sdk_v$(SDK_PATCH_VER).zip -O $@ || { rm -f "$@"; exit 1; }
wget --tries=10 --timeout=15 --waitretry=30 --read-timeout=20 --retry-connrefused "https://github.com/espressif/ESP8266_NONOS_SDK/compare/v$(SDK_BASE_VER)...$(SDK_PATCH_VER).patch" -O $@ || { rm -f "$@"; exit 1; }
(echo "$(SDK_PATCH_SHA1) $@" | sha1sum -c -) || { rm -f "$@"; exit 1; }

clean:
Expand Down Expand Up @@ -306,6 +319,17 @@ $(OBJODIR)/%.d: %.c
sed 's,\($*\.o\)[ :]*,$(OBJODIR)/\1 $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$

$(OBJODIR)/%.o: %.cpp
@mkdir -p $(OBJODIR);
$(CXX) $(if $(findstring $<,$(DSRCS)),$(DFLAGS),$(CFLAGS)) $(COPTS_$(*F)) -o $@ -c $<

$(OBJODIR)/%.d: %.cpp
@mkdir -p $(OBJODIR);
@echo DEPEND: $(CXX) -M $(CFLAGS) $<
@set -e; rm -f $@; \
sed 's,\($*\.o\)[ :]*,$(OBJODIR)/\1 $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$

$(OBJODIR)/%.o: %.s
@mkdir -p $(OBJODIR);
$(CC) $(CFLAGS) -o $@ -c $<
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# **NodeMCU 2.1.0** #
# **NodeMCU 2.2.0** #

[![Join the chat at https://gitter.im/nodemcu/nodemcu-firmware](https://img.shields.io/gitter/room/badges/shields.svg)](https://gitter.im/nodemcu/nodemcu-firmware?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/nodemcu/nodemcu-firmware.svg)](https://travis-ci.org/nodemcu/nodemcu-firmware)
Expand All @@ -7,7 +7,7 @@

### A Lua based firmware for ESP8266 WiFi SOC

NodeMCU is an [eLua](http://www.eluaproject.net/) based firmware for the [ESP8266 WiFi SOC from Espressif](http://espressif.com/en/products/esp8266/). The firmware is based on the [Espressif NON-OS SDK 2.1.0](https://github.com/espressif/ESP8266_NONOS_SDK/releases/tag/v2.1.0) and uses a file system based on [spiffs](https://github.com/pellepl/spiffs). The code repository consists of 98.1% C-code that glues the thin Lua veneer to the SDK.
NodeMCU is an [eLua](http://www.eluaproject.net/) based firmware for the [ESP8266 WiFi SOC from Espressif](http://espressif.com/en/products/esp8266/). The firmware is based on the [Espressif NON-OS SDK 2.2.0](https://github.com/espressif/ESP8266_NONOS_SDK/releases/tag/v2.2.0) and uses a file system based on [spiffs](https://github.com/pellepl/spiffs). The code repository consists of 98.1% C-code that glues the thin Lua veneer to the SDK.

The NodeMCU *firmware* is a companion project to the popular [NodeMCU dev kits](https://github.com/nodemcu/nodemcu-devkit-v1.0), ready-made open source development boards with ESP8266-12E chips.

Expand All @@ -16,7 +16,7 @@ The NodeMCU *firmware* is a companion project to the popular [NodeMCU dev kits](
- Easy to program wireless node and/or access point
- Based on Lua 5.1.4 (without *debug, os* modules)
- Asynchronous event-driven programming model
- 55+ built-in modules
- more than 65 built-in modules
- Firmware available with or without floating point support (integer-only uses less memory)
- Up-to-date documentation at [https://nodemcu.readthedocs.io](https://nodemcu.readthedocs.io)

Expand All @@ -38,7 +38,7 @@ end)
```lua
-- connect to WiFi access point
wifi.setmode(wifi.STATION)
wifi.sta.config("SSID", "password")
wifi.sta.config{ssid="SSID", pwd="password"}
```

# Documentation
Expand Down
3 changes: 3 additions & 0 deletions app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ SUBDIRS= \
misc \
pm \
sjson \
sqlite3 \


endif # } PDIR
Expand Down Expand Up @@ -104,6 +105,7 @@ COMPONENTS_eagle.app.v6 = \
swTimer/libswtimer.a \
misc/libmisc.a \
sjson/libsjson.a \
sqlite3/libsqlite3.a \


# Inspect the modules library and work out which modules need to be linked.
Expand Down Expand Up @@ -164,6 +166,7 @@ CONFIGURATION_DEFINES = -D__ets__ \
-DLWIP_OPEN_SRC \
-DPBUF_RSV_FOR_WLAN \
-DEBUF_LWIP \
-DUSE_OPTIMIZE_PRINTF \
-DMBEDTLS_USER_CONFIG_FILE=\"user_mbedtls.h\" \

DEFINES += \
Expand Down
2 changes: 1 addition & 1 deletion app/coap/coap.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ void coap_setup(void)
message_id = (unsigned short)os_random(); // calculate only once
}

inline int
int
check_token(coap_packet_t *pkt) {
return pkt->tok.len == the_token.len && c_memcmp(pkt->tok.p, the_token.p, the_token.len) == 0;
}
2 changes: 1 addition & 1 deletion app/driver/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ key_50ms_cb(struct single_key_param *single_key)
LOCAL void
key_intr_handler(void *arg)
{
struct keys_param *keys = arg;
uint8 i;
uint32 gpio_status = GPIO_REG_READ(GPIO_STATUS_ADDRESS);
struct keys_param *keys = arg;

for (i = 0; i < keys->key_num; i++) {
if (gpio_status & BIT(keys->single_key[i]->gpio_id)) {
Expand Down
4 changes: 2 additions & 2 deletions app/fatfs/myfatfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ struct myvfs_dir {
// ---------------------------------------------------------------------------
// exported helper functions for FatFS
//
inline void *ff_memalloc( UINT size )
void *ff_memalloc( UINT size )
{
return c_malloc( size );
}

inline void ff_memfree( void *mblock )
void ff_memfree( void *mblock )
{
c_free( mblock );
}
Expand Down
5 changes: 4 additions & 1 deletion app/http/httpclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,20 +215,23 @@ static void ICACHE_FLASH_ATTR http_connect_callback( void * arg )
ua_len = strlen(ua_header);
}

char host_header[32] = "";
char * host_header = "";
int host_len = 0;
if ( os_strstr( req->headers, "Host:" ) == NULL && os_strstr( req->headers, "host:" ) == NULL)
{
int max_header_len = 9 + strlen(req->hostname); // 9 is fixed size of "Host:[space][cr][lf]\0"
if ((req->port == 80)
#ifdef CLIENT_SSL_ENABLE
|| ((req->port == 443) && ( req->secure ))
#endif
)
{
host_header = alloca(max_header_len);
os_sprintf( host_header, "Host: %s\r\n", req->hostname );
}
else
{
host_header = alloca(max_header_len + 6); // 6 is worst case of ":port" where port is maximum 5 digits
os_sprintf( host_header, "Host: %s:%d\r\n", req->hostname, req->port );
}
host_len = strlen(host_header);
Expand Down
2 changes: 1 addition & 1 deletion app/include/arch/cc.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ typedef uint32_t mem_ptr_t;
#define U32_F "d"
#define X32_F "x"


#define LWIP_ERR_T s32_t

//#define PACK_STRUCT_FIELD(x) x __attribute__((packed))
#define PACK_STRUCT_FIELD(x) x
Expand Down
Loading