From e9b8e0fc8c38da5564b1554a8fcefb83007f442c Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sat, 21 Nov 2020 17:48:26 +0100 Subject: [PATCH] Fix compilation error with CC2530 --- tasmota/xdrv_23_zigbee_4a_nano_fs.ino | 2 ++ tasmota/xdrv_23_zigbee_4b_eeprom.ino | 9 ++++++--- tasmota/xdrv_23_zigbee_8_parsers.ino | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tasmota/xdrv_23_zigbee_4a_nano_fs.ino b/tasmota/xdrv_23_zigbee_4a_nano_fs.ino index 47abcc6fa..edddbb510 100644 --- a/tasmota/xdrv_23_zigbee_4a_nano_fs.ino +++ b/tasmota/xdrv_23_zigbee_4a_nano_fs.ino @@ -18,6 +18,7 @@ */ #ifdef USE_ZIGBEE +#ifdef USE_ZIGBEE_EZSP #include #define Z_EEPROM_DEBUG @@ -453,4 +454,5 @@ int32_t ZFS_Write_File::close(void) { return length; } +#endif // USE_ZIGBEE_EZSP #endif // USE_ZIGBEE diff --git a/tasmota/xdrv_23_zigbee_4b_eeprom.ino b/tasmota/xdrv_23_zigbee_4b_eeprom.ino index 6ebdd8214..28354ddda 100644 --- a/tasmota/xdrv_23_zigbee_4b_eeprom.ino +++ b/tasmota/xdrv_23_zigbee_4b_eeprom.ino @@ -114,8 +114,8 @@ int32_t hydrateSingleDevice(const class SBuffer & buf, size_t start, size_t len) // Parse the entire blob // return true if ok bool hydrateDevicesDataFromEEPROM(void) { +#ifdef USE_ZIGBEE_EZSP if (!zigbee.eeprom_ready) { return false; } - int32_t file_length = ZFS::getLength(ZIGB_DATA2); if (file_length > 0) { AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_ZIGBEE "Zigbee device data in EEPROM (%d bytes)"), file_length); @@ -148,8 +148,10 @@ bool hydrateDevicesDataFromEEPROM(void) { read_more = false; } } - return true; +#else // USE_ZIGBEE_EZSP + return false; +#endif // USE_ZIGBEE_EZSP } class SBuffer hibernateDeviceData(const struct Z_Device & device, bool mqtt = false) { @@ -203,7 +205,7 @@ class SBuffer hibernateDeviceData(const struct Z_Device & device, bool mqtt = fa * \*********************************************************************************************/ void hibernateAllData(void) { - +#ifdef USE_ZIGBEE_EZSP if (!zigbee.eeprom_ready) { return; } ZFS_Write_File write_data(ZIGB_DATA2); @@ -221,6 +223,7 @@ void hibernateAllData(void) { #ifdef Z_EEPROM_DEBUG AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_ZIGBEE "ZbData - %d bytes written to EEPROM"), ret); #endif +#endif // USE_ZIGBEE_EZSP } #endif // USE_ZIGBEE diff --git a/tasmota/xdrv_23_zigbee_8_parsers.ino b/tasmota/xdrv_23_zigbee_8_parsers.ino index dbe675186..620bb1ed6 100644 --- a/tasmota/xdrv_23_zigbee_8_parsers.ino +++ b/tasmota/xdrv_23_zigbee_8_parsers.ino @@ -1853,10 +1853,12 @@ int32_t ZNP_Recv_Default(int32_t res, const class SBuffer &buf) { // // Callback for loading preparing EEPROM, called by the state machine // +#ifdef USE_ZIGBEE_EZSP int32_t Z_Prepare_EEPROM(uint8_t value) { ZFS::initOrFormat(); return 0; // continue } +#endif // USE_ZIGBEE_EZSP // // Callback for loading Zigbee configuration from Flash, called by the state machine