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

Port of CCLoader as a utility driver #9970

Merged
merged 1 commit into from
Nov 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 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