Skip to content

Commit 4905381

Browse files
committed
Resolve merge conflict on docs/index.md
2 parents 1159295 + 3f5ae99 commit 4905381

File tree

545 files changed

+43195
-54483
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

545 files changed

+43195
-54483
lines changed

.gdbinit

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#
2-
# This is very much a work in progress to show how we can use macros to make the
3-
# GDB interface a lot more useable. For example the next / step commands only
4-
# work if the stepper doesn't leave the current scope. Beyond that you have a
5-
# single hardware breakpoint which can be used as an hb or a wa. You have to
6-
# remember to delete the previous one, so the br macro does this for you.
2+
# This is very much a work in progress to show how we can use macros to make the
3+
# GDB interface a lot more useable. For example the next / step commands only
4+
# work if the stepper doesn't leave the current scope. Beyond that you have a
5+
# single hardware breakpoint which can be used as an hb or a wa. You have to
6+
# remember to delete the previous one, so the br macro does this for you.
77
#
88
file app/.output/eagle/debug/image/eagle.app.v6.out
99
#set remotedebug 1
@@ -16,12 +16,12 @@ target remote /dev/ttyUSB0
1616

1717
set confirm off
1818
set print null-stop
19-
define br
19+
define br
2020
d
2121
hb $arg0
2222
end
2323

24-
define upto
24+
define upto
2525
d
2626
hb $arg0
2727
c

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Provide a [Minimal, Complete, and Verifiable example](http://stackoverflow.com/h
1515
Which branch are you on? If you know the Git revision then add it here as well.
1616

1717
### Hardware
18-
Describe which ESP8266 device you use and document any special hardware setup
18+
Describe which ESP8266 device you use and document any special hardware setup
1919
required to reproduce the problem.
2020

2121
8<------------------------ END BUG REPORT -------------------------------------

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ Make sure all boxes are checked (add x inside the brackets) when you submit your
55
- [ ] This PR is for the `dev` branch rather than for `master`.
66
- [ ] This PR is compliant with the [other contributing guidelines](https://github.com/nodemcu/nodemcu-firmware/blob/dev/CONTRIBUTING.md) as well (if not, please describe why).
77
- [ ] I have thoroughly tested my contribution.
8-
- [ ] The code changes are reflected in the documentation at `docs/en/*`.
8+
- [ ] The code changes are reflected in the documentation at `docs/*`.
99

1010
\<Description of and rationale behind this PR\>

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Avoid intermediate merge commits. [Rebase](https://www.atlassian.com/git/tutoria
6565

6666
This is just one way of doing things. If you're proficient in Git matters you're free to choose your own. If you want to read more then the [GitHub chapter in the Git book](http://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project#The-GitHub-Flow) is a way to start. [GitHub's own documentation](https://help.github.com/categories/collaborating-with-issues-and-pull-requests/) contains a wealth of information as well.
6767

68-
As a Windows or Mac user you could also resort to [GitHub Desktop](https://desktop.github.com/). It's a mature GUI application that supports most of the tasks outlined above.
68+
As a Windows or Mac user you could also resort to [GitHub Desktop](https://desktop.github.com/). It's a mature GUI application that supports most of the tasks outlined above.
6969

7070
### Keeping your fork in sync
7171
You need to sync your fork with the NodeMCU upstream repository from time to time, latest before you rebase (see flow above).

Makefile

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,25 @@ else
3333
CCFLAGS += -O2
3434
endif
3535

36+
#Handling of V=1/VERBOSE=1 flag
37+
#
38+
# if V=1, $(summary) does nothing
39+
# if V is unset or not 1, $(summary) echoes a summary
40+
VERBOSE ?=
41+
V ?= $(VERBOSE)
42+
ifeq ("$(V)","1")
43+
export summary := @true
44+
else
45+
export summary := @echo
46+
47+
# disable echoing of commands, directory names
48+
MAKEFLAGS += --silent -w
49+
endif # $(V)==1
50+
51+
ifndef BAUDRATE
52+
BAUDRATE=115200
53+
endif
54+
3655
#############################################################
3756
# Select compile
3857
#
@@ -186,6 +205,7 @@ $$(LIBODIR)/$(1).a: $$(OBJS) $$(DEP_OBJS_$(1)) $$(DEP_LIBS_$(1)) $$(DEPENDS_$(1)
186205
@mkdir -p $$(LIBODIR)
187206
$$(if $$(filter %.a,$$?),mkdir -p $$(EXTRACT_DIR)_$(1))
188207
$$(if $$(filter %.a,$$?),cd $$(EXTRACT_DIR)_$(1); $$(foreach lib,$$(filter %.a,$$?),$$(AR) xo $$(UP_EXTRACT_DIR)/$$(lib);))
208+
$(summary) AR $(patsubst $(TOP_DIR)/%,%,$(CURDIR))/$<
189209
$$(AR) ru $$@ $$(filter %.o,$$?) $$(if $$(filter %.a,$$?),$$(EXTRACT_DIR)_$(1)/*.o)
190210
$$(if $$(filter %.a,$$?),$$(RM) -r $$(EXTRACT_DIR)_$(1))
191211
endef
@@ -195,12 +215,15 @@ DEP_LIBS_$(1) = $$(foreach lib,$$(filter %.a,$$(COMPONENTS_$(1))),$$(dir $$(lib)
195215
DEP_OBJS_$(1) = $$(foreach obj,$$(filter %.o,$$(COMPONENTS_$(1))),$$(dir $$(obj))$$(OBJODIR)/$$(notdir $$(obj)))
196216
$$(IMAGEODIR)/$(1).out: $$(OBJS) $$(DEP_OBJS_$(1)) $$(DEP_LIBS_$(1)) $$(DEPENDS_$(1))
197217
@mkdir -p $$(IMAGEODIR)
218+
$(summary) LD $(patsubst $(TOP_DIR)/%,%,$(CURDIR))/$$@
198219
$$(CC) $$(LDFLAGS) $$(if $$(LINKFLAGS_$(1)),$$(LINKFLAGS_$(1)),$$(LINKFLAGS_DEFAULT) $$(OBJS) $$(DEP_OBJS_$(1)) $$(DEP_LIBS_$(1))) -o $$@
199220
endef
200221

201222
$(BINODIR)/%.bin: $(IMAGEODIR)/%.out
202223
@mkdir -p $(BINODIR)
224+
$(summary) NM $(patsubst $(TOP_DIR)/%,%,$(CURDIR))/$@
203225
@$(NM) $< | grep -w U && { echo "Firmware has undefined (but unused) symbols!"; exit 1; } || true
226+
$(summary) ESPTOOL $(patsubst $(TOP_DIR)/%,%,$(CURDIR))/$< $(FIRMWAREDIR)
204227
$(ESPTOOL) elf2image --flash_mode dio --flash_freq 40m $< -o $(FIRMWAREDIR)
205228

206229
#############################################################
@@ -226,38 +249,45 @@ toolchain: $(TOP_DIR)/tools/toolchains/esp8266-$(PLATFORM)-$(TOOLCHAIN_VERSION)/
226249

227250
$(TOP_DIR)/tools/toolchains/esp8266-$(PLATFORM)-$(TOOLCHAIN_VERSION)/bin/xtensa-lx106-elf-gcc: $(TOP_DIR)/cache/toolchain-esp8266-$(PLATFORM)-$(TOOLCHAIN_VERSION).tar.xz
228251
mkdir -p $(TOP_DIR)/tools/toolchains/
252+
$(summary) EXTRACT $(patsubst $(TOP_DIR)/%,%,$<)
229253
tar -xJf $< -C $(TOP_DIR)/tools/toolchains/
230254
touch $@
231255

232256
$(TOP_DIR)/cache/toolchain-esp8266-$(PLATFORM)-$(TOOLCHAIN_VERSION).tar.xz:
233257
mkdir -p $(TOP_DIR)/cache
258+
$(summary) WGET $(patsubst $(TOP_DIR)/%,%,$@)
234259
wget --tries=10 --timeout=15 --waitretry=30 --read-timeout=20 --retry-connrefused https://github.com/jmattsson/esp-toolchains/releases/download/$(PLATFORM)-$(TOOLCHAIN_VERSION)/toolchain-esp8266-$(PLATFORM)-$(TOOLCHAIN_VERSION).tar.xz -O $@ || { rm -f "$@"; exit 1; }
235260
endif
236261

237262
$(TOP_DIR)/sdk/.extracted-$(SDK_BASE_VER): $(TOP_DIR)/cache/v$(SDK_FILE_VER).zip
238263
mkdir -p "$(dir $@)"
264+
$(summary) UNZIP $(patsubst $(TOP_DIR)/%,%,$<)
239265
(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)
240266
mv $(dir $@)/ESP8266_NONOS_SDK-$(SDK_BASE_VER) $(dir $@)/esp_iot_sdk_v$(SDK_BASE_VER)
241267
touch $@
242268

243269
$(TOP_DIR)/sdk/.patched-$(SDK_VER): $(TOP_DIR)/cache/$(SDK_PATCH_VER).patch
244270
mv $(dir $@)/esp_iot_sdk_v$(SDK_BASE_VER) $(dir $@)/esp_iot_sdk_v$(SDK_VER)
271+
$(summary) APPLY $(patsubst $(TOP_DIR)/%,%,$<)
245272
git apply --verbose -p1 --exclude='*VERSION' --exclude='*bin/at*' --directory=$(SDK_REL_DIR) $<
246273
touch $@
247274

248275
$(TOP_DIR)/sdk/.pruned-$(SDK_VER):
249276
rm -f $(SDK_DIR)/lib/liblwip.a $(SDK_DIR)/lib/libssl.a $(SDK_DIR)/lib/libmbedtls.a
277+
$(summary) PRUNE libmain.a libc.a
250278
$(AR) d $(SDK_DIR)/lib/libmain.a time.o
251279
$(AR) d $(SDK_DIR)/lib/libc.a lib_a-time.o
252280
touch $@
253281

254282
$(TOP_DIR)/cache/v$(SDK_FILE_VER).zip:
255283
mkdir -p "$(dir $@)"
284+
$(summary) WGET $(patsubst $(TOP_DIR)/%,%,$@)
256285
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; }
257286
(echo "$(SDK_FILE_SHA1) $@" | sha1sum -c -) || { rm -f "$@"; exit 1; }
258287

259288
$(TOP_DIR)/cache/$(SDK_PATCH_VER).patch:
260289
mkdir -p "$(dir $@)"
290+
$(summary) WGET $(SDK_PATCH_VER).patch
261291
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; }
262292
(echo "$(SDK_PATCH_SHA1) $@" | sha1sum -c -) || { rm -f "$@"; exit 1; }
263293

@@ -272,20 +302,25 @@ clobber: $(SPECIAL_CLOBBER)
272302

273303
flash:
274304
@echo "use one of the following targets to flash the firmware"
275-
@echo " make flash512k - for ESP with 512kB flash size"
276-
@echo " make flash4m - for ESP with 4MB flash size"
305+
@echo " make flash512k - for ESP with 512kB flash size"
306+
@echo " make flash1m-dout - for ESP with 1MB flash size and flash mode = dout (Sonoff, ESP8285)"
307+
@echo " make flash4m - for ESP with 4MB flash size"
277308

278309
flash512k:
279310
$(MAKE) -e FLASHOPTIONS="-fm qio -fs 4m -ff 40m" flashinternal
280311

281312
flash4m:
282313
$(MAKE) -e FLASHOPTIONS="-fm dio -fs 32m -ff 40m" flashinternal
283314

315+
flash1m-dout:
316+
$(MAKE) -e FLASHOPTIONS="-fm dout -fs 8m -ff 40m" flashinternal
317+
318+
284319
flashinternal:
285320
ifndef PDIR
286321
$(MAKE) -C ./app flashinternal
287322
else
288-
$(ESPTOOL) --port $(ESPPORT) write_flash $(FLASHOPTIONS) 0x00000 $(FIRMWAREDIR)0x00000.bin 0x10000 $(FIRMWAREDIR)0x10000.bin
323+
$(ESPTOOL) --port $(ESPPORT) --baud $(BAUDRATE) write_flash $(FLASHOPTIONS) 0x00000 $(FIRMWAREDIR)0x00000.bin 0x10000 $(FIRMWAREDIR)0x10000.bin
289324
endif
290325

291326
.subdirs:
@@ -318,6 +353,7 @@ ifneq ($(wildcard $(TOP_DIR)/server-ca.crt),)
318353
pre_build: $(TOP_DIR)/app/modules/server-ca.crt.h
319354

320355
$(TOP_DIR)/app/modules/server-ca.crt.h: $(TOP_DIR)/server-ca.crt
356+
$(summary) MKCERT $(patsubst $(TOP_DIR)/%,%,$<)
321357
python $(TOP_DIR)/tools/make_server_cert.py $(TOP_DIR)/server-ca.crt > $(TOP_DIR)/app/modules/server-ca.crt.h
322358

323359
DEFINES += -DHAVE_SSL_SERVER_CRT=\"server-ca.crt.h\"
@@ -326,32 +362,34 @@ pre_build:
326362
@-rm -f $(TOP_DIR)/app/modules/server-ca.crt.h
327363
endif
328364

329-
330365
$(OBJODIR)/%.o: %.c
331366
@mkdir -p $(dir $@);
367+
$(summary) CC $(patsubst $(TOP_DIR)/%,%,$(CURDIR))/$<
332368
$(CC) $(if $(findstring $<,$(DSRCS)),$(DFLAGS),$(CFLAGS)) $(COPTS_$(*F)) -o $@ -c $<
333369

334370
$(OBJODIR)/%.d: %.c
335371
@mkdir -p $(dir $@);
336-
@echo DEPEND: $(CC) -M $(CFLAGS) $<
372+
$(summary) DEPEND: CC $(patsubst $(TOP_DIR)/%,%,$(CURDIR))/$<
337373
@set -e; rm -f $@; \
338374
$(CC) -M $(CFLAGS) $< > $@.$$$$; \
339375
sed 's,\($*\.o\)[ :]*,$(OBJODIR)/\1 $@ : ,g' < $@.$$$$ > $@; \
340376
rm -f $@.$$$$
341377

342378
$(OBJODIR)/%.o: %.cpp
343379
@mkdir -p $(OBJODIR);
380+
$(summary) CXX $(patsubst $(TOP_DIR)/%,%,$(CURDIR))/$<
344381
$(CXX) $(if $(findstring $<,$(DSRCS)),$(DFLAGS),$(CFLAGS)) $(COPTS_$(*F)) -o $@ -c $<
345382

346383
$(OBJODIR)/%.d: %.cpp
347384
@mkdir -p $(OBJODIR);
348-
@echo DEPEND: $(CXX) -M $(CFLAGS) $<
385+
$(summary) DEPEND: CXX $(patsubst $(TOP_DIR)/%,%,$(CURDIR))/$<
349386
@set -e; rm -f $@; \
350387
sed 's,\($*\.o\)[ :]*,$(OBJODIR)/\1 $@ : ,g' < $@.$$$$ > $@; \
351388
rm -f $@.$$$$
352389

353390
$(OBJODIR)/%.o: %.s
354391
@mkdir -p $(dir $@);
392+
$(summary) CC $(patsubst $(TOP_DIR)/%,%,$(CURDIR))/$<
355393
$(CC) $(CFLAGS) -o $@ -c $<
356394

357395
$(OBJODIR)/%.d: %.s
@@ -363,6 +401,7 @@ $(OBJODIR)/%.d: %.s
363401

364402
$(OBJODIR)/%.o: %.S
365403
@mkdir -p $(dir $@);
404+
$(summary) CC $(patsubst $(TOP_DIR)/%,%,$(CURDIR))/$<
366405
$(CC) $(CFLAGS) -D__ASSEMBLER__ -o $@ -c $<
367406

368407
$(OBJODIR)/%.d: %.S

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ wifi.sta.config{ssid="SSID", pwd="password"}
4646

4747
# Documentation
4848

49-
The entire [NodeMCU documentation](https://nodemcu.readthedocs.io) is maintained right in this repository at [/docs](docs). The fact that the API documentation is maintained in the same repository as the code that *provides* the API ensures consistency between the two. With every commit the documentation is rebuilt by Read the Docs and thus transformed from terse Markdown into a nicely browsable HTML site at [https://nodemcu.readthedocs.io](https://nodemcu.readthedocs.io).
49+
The entire [NodeMCU documentation](https://nodemcu.readthedocs.io) is maintained right in this repository at [/docs](docs). The fact that the API documentation is maintained in the same repository as the code that *provides* the API ensures consistency between the two. With every commit the documentation is rebuilt by Read the Docs and thus transformed from terse Markdown into a nicely browsable HTML site at [https://nodemcu.readthedocs.io](https://nodemcu.readthedocs.io).
5050

5151
- How to [build the firmware](https://nodemcu.readthedocs.io/en/master/en/build/)
5252
- How to [flash the firmware](https://nodemcu.readthedocs.io/en/master/en/flash/)

app/coap/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ endif
2222
# makefile at its root level - these are then overridden
2323
# for a subtree within the makefile rooted therein
2424
#
25-
#DEFINES +=
25+
#DEFINES +=
2626

2727
#############################################################
2828
# Recursion Magic - Don't touch this!!

app/coap/coap.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ typedef struct
2424
uint8_t ver; /* CoAP version number */
2525
uint8_t t; /* CoAP Message Type */
2626
uint8_t tkl; /* Token length: indicates length of the Token field */
27-
uint8_t code; /* CoAP status code. Can be request (0.xx), success reponse (2.xx),
28-
* client error response (4.xx), or rever error response (5.xx)
27+
uint8_t code; /* CoAP status code. Can be request (0.xx), success reponse (2.xx),
28+
* client error response (4.xx), or rever error response (5.xx)
2929
* For possible values, see http://tools.ietf.org/html/rfc7252#section-12.1 */
3030
uint8_t id[2];
3131
} coap_header_t;
@@ -164,14 +164,14 @@ struct coap_luser_entry{
164164

165165
struct coap_endpoint_t{
166166
coap_method_t method; /* (i.e. POST, PUT or GET) */
167-
coap_endpoint_func handler; /* callback function which handles this
168-
* type of endpoint (and calls
167+
coap_endpoint_func handler; /* callback function which handles this
168+
* type of endpoint (and calls
169169
* coap_make_response() at some point) */
170-
const coap_endpoint_path_t *path; /* path towards a resource (i.e. foo/bar/) */
170+
const coap_endpoint_path_t *path; /* path towards a resource (i.e. foo/bar/) */
171171
const char *core_attr; /* the 'ct' attribute, as defined in RFC7252, section 7.2.1.:
172-
* "The Content-Format code "ct" attribute
173-
* provides a hint about the
174-
* Content-Formats this resource returns."
172+
* "The Content-Format code "ct" attribute
173+
* provides a hint about the
174+
* Content-Formats this resource returns."
175175
* (Section 12.3. lists possible ct values.) */
176176
coap_luser_entry *user_entry;
177177
};

app/coap/coap_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ coap_tid_t coap_send_confirmed(struct espconn *pesp_conn, coap_pdu_t *pdu) {
6464
*/
6565
coap_timer_stop();
6666
coap_timer_update(&gQueue);
67-
node->t = node->timeout;
67+
node->t = node->timeout;
6868
coap_insert_node(&gQueue, node);
6969
coap_timer_start(&gQueue);
7070
return node->id;

app/coap/coap_io.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ extern "C" {
1010
#include "espconn.h"
1111
#include "pdu.h"
1212
#include "hash.h"
13-
13+
1414
coap_tid_t coap_send(struct espconn *pesp_conn, coap_pdu_t *pdu);
1515

1616
coap_tid_t coap_send_confirmed(struct espconn *pesp_conn, coap_pdu_t *pdu);

0 commit comments

Comments
 (0)