Skip to content

Commit

Permalink
+ WDT Watch Dog class
Browse files Browse the repository at this point in the history
* COM_PORT renamed to same style
  • Loading branch information
anakod committed Apr 6, 2015
1 parent 8c98f5d commit 368daff
Show file tree
Hide file tree
Showing 23 changed files with 229 additions and 153 deletions.
16 changes: 8 additions & 8 deletions Basic_Blink/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SDK_BASE ?= c:/Espressif/ESP8266_SDK
# esptool path and port
SDK_TOOLS ?= c:/Espressif/utils
ESPTOOL ?= $(SDK_TOOLS)/esptool.exe
ESPPORT ?= COM4
COM_PORT ?= COM3
COM_SPEED ?= 230400

# name for the target project
Expand Down Expand Up @@ -287,16 +287,16 @@ flashonefile: all
$(vecho) "No boot needed."
$(vecho) "Generate eagle.app.flash.bin successully in folder $(FW_BASE)."
$(vecho) "eagle.app.flash.bin-------->0x00000"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.app.flash.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.app.flash.bin

flashboot: all flashinit
ifeq ($(boot), new)
$(vecho) "Flash boot_v1.2 and +"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.2.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.2.bin
endif
ifeq ($(boot), old)
$(vecho) "Flash boot_v1.1 and +"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.1.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.1.bin
endif
ifeq ($(boot), none)
$(vecho) "No boot needed."
Expand All @@ -305,18 +305,18 @@ endif
flash: all
ifeq ($(app), 0)
$(shell taskkill /f /im termite.exe)
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
else
ifeq ($(boot), none)
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
else
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash $(addr) $(FW_BASE)/upgrade/$(BIN_NAME).bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash $(addr) $(FW_BASE)/upgrade/$(BIN_NAME).bin
endif
endif

flashinit:
$(vecho) "Flash init data default and blank data."
$(ESPTOOL) -p $(ESPPORT) write_flash 0x7c000 $(SDK_BASE)/bin/esp_init_data_default.bin 0x7e000 $(SDK_BASE)/bin/blank.bin
$(ESPTOOL) -p $(COM_PORT) write_flash 0x7c000 $(SDK_BASE)/bin/esp_init_data_default.bin 0x7e000 $(SDK_BASE)/bin/blank.bin

rebuild: clean all

Expand Down
16 changes: 8 additions & 8 deletions Basic_ScannerI2C/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SDK_BASE ?= c:/Espressif/ESP8266_SDK
# esptool path and port
SDK_TOOLS ?= c:/Espressif/utils
ESPTOOL ?= $(SDK_TOOLS)/esptool.exe
ESPPORT ?= COM4
COM_PORT ?= COM3
COM_SPEED ?= 230400

# name for the target project
Expand Down Expand Up @@ -287,16 +287,16 @@ flashonefile: all
$(vecho) "No boot needed."
$(vecho) "Generate eagle.app.flash.bin successully in folder $(FW_BASE)."
$(vecho) "eagle.app.flash.bin-------->0x00000"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.app.flash.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.app.flash.bin

flashboot: all flashinit
ifeq ($(boot), new)
$(vecho) "Flash boot_v1.2 and +"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.2.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.2.bin
endif
ifeq ($(boot), old)
$(vecho) "Flash boot_v1.1 and +"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.1.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.1.bin
endif
ifeq ($(boot), none)
$(vecho) "No boot needed."
Expand All @@ -305,18 +305,18 @@ endif
flash: all
ifeq ($(app), 0)
$(shell taskkill /f /im termite.exe)
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
else
ifeq ($(boot), none)
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
else
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash $(addr) $(FW_BASE)/upgrade/$(BIN_NAME).bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash $(addr) $(FW_BASE)/upgrade/$(BIN_NAME).bin
endif
endif

flashinit:
$(vecho) "Flash init data default and blank data."
$(ESPTOOL) -p $(ESPPORT) write_flash 0x7c000 $(SDK_BASE)/bin/esp_init_data_default.bin 0x7e000 $(SDK_BASE)/bin/blank.bin
$(ESPTOOL) -p $(COM_PORT) write_flash 0x7c000 $(SDK_BASE)/bin/esp_init_data_default.bin 0x7e000 $(SDK_BASE)/bin/blank.bin

rebuild: clean all

Expand Down
5 changes: 4 additions & 1 deletion Basic_ScannerI2C/app/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ void scanBus()
Wire.beginTransmission(address);
error = Wire.endTransmission();

WDT.alive(); // Second option: notify Watch Dog what you are alive (feed it)

if (error == 0)
{
Serial.print("I2C device found at address 0x");
Expand Down Expand Up @@ -76,7 +78,8 @@ void init()
{
Serial.begin(SERIAL_BAUD_RATE); // 115200 by default
Serial.systemDebugOutput(false); // Disable debug output
System.onReady(ets_wdt_disable); // Just example how you can disable watch dog timer

WDT.enable(false); // First (but not the best) option: fully disable watch dog timer

Wire.begin();
procTimer.initializeMs(3000, scanBus).start();
Expand Down
16 changes: 8 additions & 8 deletions Basic_Serial/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SDK_BASE ?= c:/Espressif/ESP8266_SDK
# esptool path and port
SDK_TOOLS ?= c:/Espressif/utils
ESPTOOL ?= $(SDK_TOOLS)/esptool.exe
ESPPORT ?= COM4
COM_PORT ?= COM3
COM_SPEED ?= 230400

# name for the target project
Expand Down Expand Up @@ -287,16 +287,16 @@ flashonefile: all
$(vecho) "No boot needed."
$(vecho) "Generate eagle.app.flash.bin successully in folder $(FW_BASE)."
$(vecho) "eagle.app.flash.bin-------->0x00000"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.app.flash.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.app.flash.bin

flashboot: all flashinit
ifeq ($(boot), new)
$(vecho) "Flash boot_v1.2 and +"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.2.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.2.bin
endif
ifeq ($(boot), old)
$(vecho) "Flash boot_v1.1 and +"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.1.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.1.bin
endif
ifeq ($(boot), none)
$(vecho) "No boot needed."
Expand All @@ -305,18 +305,18 @@ endif
flash: all
ifeq ($(app), 0)
$(shell taskkill /f /im termite.exe)
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
else
ifeq ($(boot), none)
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
else
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash $(addr) $(FW_BASE)/upgrade/$(BIN_NAME).bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash $(addr) $(FW_BASE)/upgrade/$(BIN_NAME).bin
endif
endif

flashinit:
$(vecho) "Flash init data default and blank data."
$(ESPTOOL) -p $(ESPPORT) write_flash 0x7c000 $(SDK_BASE)/bin/esp_init_data_default.bin 0x7e000 $(SDK_BASE)/bin/blank.bin
$(ESPTOOL) -p $(COM_PORT) write_flash 0x7c000 $(SDK_BASE)/bin/esp_init_data_default.bin 0x7e000 $(SDK_BASE)/bin/blank.bin

rebuild: clean all

Expand Down
16 changes: 8 additions & 8 deletions Basic_WiFi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SDK_BASE ?= c:/Espressif/ESP8266_SDK
# esptool path and port
SDK_TOOLS ?= c:/Espressif/utils
ESPTOOL ?= $(SDK_TOOLS)/esptool.exe
ESPPORT ?= COM4
COM_PORT ?= COM3
COM_SPEED ?= 230400

# name for the target project
Expand Down Expand Up @@ -287,16 +287,16 @@ flashonefile: all
$(vecho) "No boot needed."
$(vecho) "Generate eagle.app.flash.bin successully in folder $(FW_BASE)."
$(vecho) "eagle.app.flash.bin-------->0x00000"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.app.flash.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.app.flash.bin

flashboot: all flashinit
ifeq ($(boot), new)
$(vecho) "Flash boot_v1.2 and +"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.2.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.2.bin
endif
ifeq ($(boot), old)
$(vecho) "Flash boot_v1.1 and +"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.1.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.1.bin
endif
ifeq ($(boot), none)
$(vecho) "No boot needed."
Expand All @@ -305,18 +305,18 @@ endif
flash: all
ifeq ($(app), 0)
$(shell taskkill /f /im termite.exe)
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
else
ifeq ($(boot), none)
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
else
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash $(addr) $(FW_BASE)/upgrade/$(BIN_NAME).bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash $(addr) $(FW_BASE)/upgrade/$(BIN_NAME).bin
endif
endif

flashinit:
$(vecho) "Flash init data default and blank data."
$(ESPTOOL) -p $(ESPPORT) write_flash 0x7c000 $(SDK_BASE)/bin/esp_init_data_default.bin 0x7e000 $(SDK_BASE)/bin/blank.bin
$(ESPTOOL) -p $(COM_PORT) write_flash 0x7c000 $(SDK_BASE)/bin/esp_init_data_default.bin 0x7e000 $(SDK_BASE)/bin/blank.bin

rebuild: clean all

Expand Down
16 changes: 8 additions & 8 deletions Compass_HMC5883L/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SDK_BASE ?= c:/Espressif/ESP8266_SDK
# esptool path and port
SDK_TOOLS ?= c:/Espressif/utils
ESPTOOL ?= $(SDK_TOOLS)/esptool.exe
ESPPORT ?= COM4
COM_PORT ?= COM3
COM_SPEED ?= 230400

# name for the target project
Expand Down Expand Up @@ -287,16 +287,16 @@ flashonefile: all
$(vecho) "No boot needed."
$(vecho) "Generate eagle.app.flash.bin successully in folder $(FW_BASE)."
$(vecho) "eagle.app.flash.bin-------->0x00000"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.app.flash.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.app.flash.bin

flashboot: all flashinit
ifeq ($(boot), new)
$(vecho) "Flash boot_v1.2 and +"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.2.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.2.bin
endif
ifeq ($(boot), old)
$(vecho) "Flash boot_v1.1 and +"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.1.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.1.bin
endif
ifeq ($(boot), none)
$(vecho) "No boot needed."
Expand All @@ -305,18 +305,18 @@ endif
flash: all
ifeq ($(app), 0)
$(shell taskkill /f /im termite.exe)
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
else
ifeq ($(boot), none)
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
else
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash $(addr) $(FW_BASE)/upgrade/$(BIN_NAME).bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash $(addr) $(FW_BASE)/upgrade/$(BIN_NAME).bin
endif
endif

flashinit:
$(vecho) "Flash init data default and blank data."
$(ESPTOOL) -p $(ESPPORT) write_flash 0x7c000 $(SDK_BASE)/bin/esp_init_data_default.bin 0x7e000 $(SDK_BASE)/bin/blank.bin
$(ESPTOOL) -p $(COM_PORT) write_flash 0x7c000 $(SDK_BASE)/bin/esp_init_data_default.bin 0x7e000 $(SDK_BASE)/bin/blank.bin

rebuild: clean all

Expand Down
16 changes: 8 additions & 8 deletions FtpServer_Files/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SDK_BASE ?= c:/Espressif/ESP8266_SDK
# esptool path and port
SDK_TOOLS ?= c:/Espressif/utils
ESPTOOL ?= $(SDK_TOOLS)/esptool.exe
ESPPORT ?= COM4
COM_PORT ?= COM3
COM_SPEED ?= 230400

# name for the target project
Expand Down Expand Up @@ -287,16 +287,16 @@ flashonefile: all
$(vecho) "No boot needed."
$(vecho) "Generate eagle.app.flash.bin successully in folder $(FW_BASE)."
$(vecho) "eagle.app.flash.bin-------->0x00000"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.app.flash.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.app.flash.bin

flashboot: all flashinit
ifeq ($(boot), new)
$(vecho) "Flash boot_v1.2 and +"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.2.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.2.bin
endif
ifeq ($(boot), old)
$(vecho) "Flash boot_v1.1 and +"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.1.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.1.bin
endif
ifeq ($(boot), none)
$(vecho) "No boot needed."
Expand All @@ -305,18 +305,18 @@ endif
flash: all
ifeq ($(app), 0)
$(shell taskkill /f /im termite.exe)
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
else
ifeq ($(boot), none)
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
else
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash $(addr) $(FW_BASE)/upgrade/$(BIN_NAME).bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash $(addr) $(FW_BASE)/upgrade/$(BIN_NAME).bin
endif
endif

flashinit:
$(vecho) "Flash init data default and blank data."
$(ESPTOOL) -p $(ESPPORT) write_flash 0x7c000 $(SDK_BASE)/bin/esp_init_data_default.bin 0x7e000 $(SDK_BASE)/bin/blank.bin
$(ESPTOOL) -p $(COM_PORT) write_flash 0x7c000 $(SDK_BASE)/bin/esp_init_data_default.bin 0x7e000 $(SDK_BASE)/bin/blank.bin

rebuild: clean all

Expand Down
16 changes: 8 additions & 8 deletions HttpClient_ThingSpeak/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SDK_BASE ?= c:/Espressif/ESP8266_SDK
# esptool path and port
SDK_TOOLS ?= c:/Espressif/utils
ESPTOOL ?= $(SDK_TOOLS)/esptool.exe
ESPPORT ?= COM4
COM_PORT ?= COM3
COM_SPEED ?= 230400

# name for the target project
Expand Down Expand Up @@ -287,16 +287,16 @@ flashonefile: all
$(vecho) "No boot needed."
$(vecho) "Generate eagle.app.flash.bin successully in folder $(FW_BASE)."
$(vecho) "eagle.app.flash.bin-------->0x00000"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.app.flash.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.app.flash.bin

flashboot: all flashinit
ifeq ($(boot), new)
$(vecho) "Flash boot_v1.2 and +"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.2.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.2.bin
endif
ifeq ($(boot), old)
$(vecho) "Flash boot_v1.1 and +"
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.1.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(SDK_BASE)/bin/boot_v1.1.bin
endif
ifeq ($(boot), none)
$(vecho) "No boot needed."
Expand All @@ -305,18 +305,18 @@ endif
flash: all
ifeq ($(app), 0)
$(shell taskkill /f /im termite.exe)
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
else
ifeq ($(boot), none)
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash 0x00000 $(FW_BASE)/eagle.flash.bin 0x10000 $(FW_BASE)/eagle.irom0text.bin
else
$(ESPTOOL) -p $(ESPPORT) -b $(COM_SPEED) write_flash $(addr) $(FW_BASE)/upgrade/$(BIN_NAME).bin
$(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED) write_flash $(addr) $(FW_BASE)/upgrade/$(BIN_NAME).bin
endif
endif

flashinit:
$(vecho) "Flash init data default and blank data."
$(ESPTOOL) -p $(ESPPORT) write_flash 0x7c000 $(SDK_BASE)/bin/esp_init_data_default.bin 0x7e000 $(SDK_BASE)/bin/blank.bin
$(ESPTOOL) -p $(COM_PORT) write_flash 0x7c000 $(SDK_BASE)/bin/esp_init_data_default.bin 0x7e000 $(SDK_BASE)/bin/blank.bin

rebuild: clean all

Expand Down
Loading

0 comments on commit 368daff

Please sign in to comment.