diff --git a/src/platform/ESP32/ConfigurationManagerImpl.cpp b/src/platform/ESP32/ConfigurationManagerImpl.cpp index 9a69cf8c697809..e03ec70ce8192b 100644 --- a/src/platform/ESP32/ConfigurationManagerImpl.cpp +++ b/src/platform/ESP32/ConfigurationManagerImpl.cpp @@ -412,12 +412,14 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) ChipLogError(DeviceLayer, "Failed to unregister IP event handler"); } +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI err = ESP32Utils::MapError(esp_event_handler_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, PlatformManagerImpl::HandleESPSystemEvent)); if (err != CHIP_NO_ERROR) { ChipLogError(DeviceLayer, "Failed to unregister wifi event handler"); } +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI ChipLogProgress(DeviceLayer, "Performing factory reset");