Fix ESP32 Zigbee compilation

This commit is contained in:
Theo Arends 2020-07-31 11:35:26 +02:00
parent 753d161a57
commit 6aee706f01
2 changed files with 10 additions and 2 deletions

View File

@ -2711,7 +2711,11 @@ void HandleUploadLoop(void)
}
else {
#if defined(USE_ZIGBEE) && defined(USE_ZIGBEE_EZSP)
#ifdef ESP8266
if ((SONOFF_ZB_BRIDGE == my_module_type) && (upload.buf[0] == 0xEB)) { // Check if this is a Zigbee bridge FW file
#else // ESP32
if (PinUsed(GPIO_ZIGBEE_RX) && PinUsed(GPIO_ZIGBEE_TX) && (upload.buf[0] == 0xEB)) { // Check if this is a Zigbee bridge FW file
#endif // ESP8266 or ESP32
Update.end(); // End esp8266 update session
Web.upload_file_type = UPL_EFR32;

View File

@ -62,8 +62,12 @@ void ZigbeeInit(void)
AddLog_P2(LOG_LEVEL_INFO, PSTR(D_LOG_ZIGBEE "Randomizing Zigbee parameters, please check with 'ZbConfig'"));
uint64_t mac64 = 0; // stuff mac address into 64 bits
WiFi.macAddress((uint8_t*) &mac64);
uint32_t esp_id = ESP.getChipId();
uint32_t flash_id = ESP.getFlashChipId();
uint32_t esp_id = ESP_getChipId();
#ifdef ESP8266
uint32_t flash_id = ESP.getFlashChipIdd();
#else // ESP32
uint32_t flash_id = 0;
#endif // ESP8266 or ESP32
uint16_t pan_id = (mac64 & 0x3FFF);
if (0x0000 == pan_id) { pan_id = 0x0001; } // avoid extreme values