diff --git a/tasmota/xdrv_23_zigbee_4_persistence.ino b/tasmota/xdrv_23_zigbee_4_persistence.ino index 854fd21c0..5dc817358 100644 --- a/tasmota/xdrv_23_zigbee_4_persistence.ino +++ b/tasmota/xdrv_23_zigbee_4_persistence.ino @@ -391,6 +391,9 @@ void saveZigbeeDevices(void) { // Erase the flash area containing the ZigbeeData void eraseZigbeeDevices(void) { zigbee_devices.clean(); // avoid writing data to flash after erase +#ifdef USE_ZIGBEE_EZSP + ZFS_Erase(); +#endif // USE_ZIGBEE_EZSP #ifdef ESP8266 // first copy SPI buffer into ram uint8_t *spi_buffer = (uint8_t*) malloc(z_spi_len); @@ -410,7 +413,7 @@ void eraseZigbeeDevices(void) { } free(spi_buffer); - AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_ZIGBEE "Zigbee Devices Data erased (0x%08X - %d bytes)"), z_dev_start, z_block_len); + AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_ZIGBEE "Zigbee Devices Data erased in %s"), PSTR("Flash")); #else // ESP32 ZigbeeErase(); AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_ZIGBEE "Zigbee Devices Data erased (%d bytes)"), z_block_len); diff --git a/tasmota/xdrv_23_zigbee_4b_eeprom.ino b/tasmota/xdrv_23_zigbee_4b_eeprom.ino index 4659fbf9f..360efb59d 100644 --- a/tasmota/xdrv_23_zigbee_4b_eeprom.ino +++ b/tasmota/xdrv_23_zigbee_4b_eeprom.ino @@ -314,6 +314,14 @@ bool loadZigbeeDevicesFromEEPROM(void) { zigbee_devices.clean(); // don't write back to Flash what we just loaded return true; } + +void ZFS_Erase(void) { + if (zigbee.eeprom_present) { + ZFS::erase(); + AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_ZIGBEE "Zigbee Devices Data erased in %s"), PSTR("EEPROM")); + } +} + #endif // USE_ZIGBEE_EZSP #endif // USE_ZIGBEE diff --git a/tasmota/xdrv_23_zigbee_A_impl.ino b/tasmota/xdrv_23_zigbee_A_impl.ino index 8b3faaa6e..cdb7b892e 100644 --- a/tasmota/xdrv_23_zigbee_A_impl.ino +++ b/tasmota/xdrv_23_zigbee_A_impl.ino @@ -136,6 +136,7 @@ void CmndZbReset(void) { ZigbeeZNPSend(ZIGBEE_FACTORY_RESET, sizeof(ZIGBEE_FACTORY_RESET)); #endif // USE_ZIGBEE_ZNP eraseZigbeeDevices(); + // no break - this is intended case 2: // fall through Settings.zb_txradio_dbm = - abs(Settings.zb_txradio_dbm); TasmotaGlobal.restart_flag = 2;