mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-28 20:58:31 +00:00
Merge branch 'master' of github.com:cesanta/mongoose
This commit is contained in:
commit
6a5c523948
3 files changed
+24
-6
No files matched your search
@@ -113,7 +113,7 @@ static void mqtt_fn(struct mg_connection *c, int ev, void *ev_data, void *fnd) {
|
|||||||
static void timer_mqtt_fn(void *param) {
|
static void timer_mqtt_fn(void *param) {
|
||||||
struct mg_mgr *mgr = (struct mg_mgr *) param;
|
struct mg_mgr *mgr = (struct mg_mgr *) param;
|
||||||
if (s_mqtt == NULL) {
|
if (s_mqtt == NULL) {
|
||||||
struct mg_mqtt_opts opts = {};
|
struct mg_mqtt_opts opts = { 0 };
|
||||||
s_mqtt = mg_mqtt_connect(mgr, s_config.url, &opts, mqtt_fn, NULL);
|
s_mqtt = mg_mqtt_connect(mgr, s_config.url, &opts, mqtt_fn, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,19 +2,37 @@ THISDIR = $(realpath $(CURDIR))
|
|||||||
ROOTDIR = $(realpath $(CURDIR)/../../..)
|
ROOTDIR = $(realpath $(CURDIR)/../../..)
|
||||||
DOCKER ?= docker run --rm $(DA) -v $(ROOTDIR):$(ROOTDIR) -w $(THISDIR) espressif/idf
|
DOCKER ?= docker run --rm $(DA) -v $(ROOTDIR):$(ROOTDIR) -w $(THISDIR) espressif/idf
|
||||||
CMD ?= idf.py build
|
CMD ?= idf.py build
|
||||||
|
PORT ?= /dev/ttyUSB0
|
||||||
|
|
||||||
all: example
|
all: example
|
||||||
|
|
||||||
example:
|
example:
|
||||||
true
|
true
|
||||||
|
|
||||||
build: main/main.c Makefile
|
build: Makefile $(wildcard main/*)
|
||||||
$(DOCKER) $(CMD)
|
$(DOCKER) $(CMD)
|
||||||
|
|
||||||
COMPORT ?= /dev/cu.SLAB_USBtoUART
|
|
||||||
ESPTOOL ?= esptool.py
|
|
||||||
flash:
|
flash:
|
||||||
cd build && $(ESPTOOL) --chip esp32 -p $(COMPORT) -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x100000 mongoose-esp32-example.bin
|
flash: CMD = idf.py flash
|
||||||
|
flash: DA = --device $(PORT)
|
||||||
|
flash: build
|
||||||
|
|
||||||
|
.PHONY: build
|
||||||
|
|
||||||
|
dashboard.hex: build
|
||||||
|
esputil mkhex \
|
||||||
|
0x8000 build/partition_table/partition-table.bin \
|
||||||
|
0x1000 build/bootloader/bootloader.bin \
|
||||||
|
0x100000 build/mongoose-esp32-example.bin > $@
|
||||||
|
|
||||||
|
flash2: dashboard.hex
|
||||||
|
esputil -p $(PORT) -b 921600 -fp 0x220 flash dashboard.hex
|
||||||
|
esputil -p $(PORT) monitor
|
||||||
|
|
||||||
|
ESPTOOL ?= esptool.py
|
||||||
|
|
||||||
|
flash3:
|
||||||
|
cd build && $(ESPTOOL) --chip esp32 -p $(PORT) -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x100000 mongoose-esp32-example.bin
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(DOCKER) rm -rf build sdkconfig
|
$(DOCKER) rm -rf build sdkconfig
|
||||||
@@ -1 +1 @@
|
|||||||
See detailed tutorial at https://mongoose.ws/tutorials/esp32/
|
See detailed tutorial at https://mongoose.ws/tutorials/esp32/device-dashboard
|
||||||
Reference in new issue
Block a user