Skip to content

Commit

Permalink
Merge pull request #9970 from Staars/ccloader
Browse files Browse the repository at this point in the history
Port of CCLoader as a utility driver
  • Loading branch information
arendst authored Nov 24, 2020
2 parents 422e0b6 + b772ab4 commit e79b1dd
Show file tree
Hide file tree
Showing 3 changed files with 701 additions and 2 deletions.
1 change: 1 addition & 0 deletions tasmota/my_user_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@
// #define USE_WEBSEND_RESPONSE // Enable command WebSend response message (+1k code)
#define USE_EMULATION_HUE // Enable Hue Bridge emulation for Alexa (+14k code, +2k mem common)
#define USE_EMULATION_WEMO // Enable Belkin WeMo emulation for Alexa (+6k code, +2k mem common)
// #define USE_CCLOADER // Enable CCLoader FW upgrade tool (for CC25xx devices)

// -- mDNS ----------------------------------------
#define USE_DISCOVERY // Enable mDNS for the following services (+8k code or +23.5k code with core 2_5_x, +0.3k mem)
Expand Down
14 changes: 12 additions & 2 deletions tasmota/xdrv_01_webserver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const uint16_t HTTP_OTA_RESTART_RECONNECT_TIME = 24000; // milliseconds - Allow
#include <ESP8266WebServer.h>
#include <DNSServer.h>

enum UploadTypes { UPL_TASMOTA, UPL_SETTINGS, UPL_EFM8BB1, UPL_TASMOTACLIENT, UPL_EFR32, UPL_SHD };
enum UploadTypes { UPL_TASMOTA, UPL_SETTINGS, UPL_EFM8BB1, UPL_TASMOTACLIENT, UPL_EFR32, UPL_SHD, UPL_CCL };

#ifdef USE_UNISHOX_COMPRESSION
#ifdef USE_JAVASCRIPT_ES6
Expand Down Expand Up @@ -2561,7 +2561,7 @@ void HandleInformation(void)

/*-------------------------------------------------------------------------------------------*/

#if defined(USE_ZIGBEE_EZSP) || defined(USE_TASMOTA_CLIENT) || defined(SHELLY_FW_UPGRADE) || defined(USE_RF_FLASH)
#if defined(USE_ZIGBEE_EZSP) || defined(USE_TASMOTA_CLIENT) || defined(SHELLY_FW_UPGRADE) || defined(USE_RF_FLASH) || defined(USE_CCLOADER)
#define USE_WEB_FW_UPGRADE
#endif

Expand Down Expand Up @@ -2772,6 +2772,11 @@ void HandleUploadLoop(void)
BUploadInit(UPL_SHD);
}
#endif // SHELLY_FW_UPGRADE
#ifdef USE_CCLOADER
else if (CCLChipFound() && 0x02 == upload.buf[0]) { // the 0x02 is only an assumption!!
BUploadInit(UPL_CCL);
}
#endif // USE_CCLOADER
#ifdef USE_ZIGBEE_EZSP
#ifdef ESP8266
else if ((SONOFF_ZB_BRIDGE == TasmotaGlobal.module_type) && (0xEB == upload.buf[0])) { // Check if this is a Zigbee bridge FW file
Expand Down Expand Up @@ -2908,6 +2913,11 @@ void HandleUploadLoop(void)
error = ShdFlash(data, BUpload.spi_hex_size);
}
#endif // SHELLY_FW_UPGRADE
#ifdef USE_CCLOADER
if (UPL_CCL == Web.upload_file_type) {
error = CLLFlashFirmware(data, BUpload.spi_hex_size);
}
#endif // SHELLY_FW_UPGRADE
#ifdef USE_ZIGBEE_EZSP
if (UPL_EFR32 == Web.upload_file_type) {
BUpload.ready = true; // So we know on upload success page if it needs to flash hex or do a normal restart
Expand Down
Loading

0 comments on commit e79b1dd

Please sign in to comment.