Fix compilation error with CC2530

This commit is contained in:
Stephan Hadinger 2020-11-21 17:48:26 +01:00
parent 846c24fb5a
commit e9b8e0fc8c
3 changed files with 10 additions and 3 deletions

View File

@ -18,6 +18,7 @@
*/
#ifdef USE_ZIGBEE
#ifdef USE_ZIGBEE_EZSP
#include <memory>
#define Z_EEPROM_DEBUG
@ -453,4 +454,5 @@ int32_t ZFS_Write_File::close(void) {
return length;
}
#endif // USE_ZIGBEE_EZSP
#endif // USE_ZIGBEE

View File

@ -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

View File

@ -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