mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-28 05:06:32 +00:00
Fix ESP32 CC2530 heap corruption
Fix ESP32 CC2530 heap corruption (#10121)
This commit is contained in:
parent
a5134729ed
commit
0bf82f51dd
@ -304,7 +304,7 @@ void loadZigbeeDevices(bool dump_only = false) {
|
|||||||
AddLog_P(LOG_LEVEL_ERROR, PSTR(D_LOG_ZIGBEE "Cannot allocate 4KB buffer"));
|
AddLog_P(LOG_LEVEL_ERROR, PSTR(D_LOG_ZIGBEE "Cannot allocate 4KB buffer"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ZigbeeRead(&spi_buffer, z_spi_len);
|
ZigbeeRead(spi_buffer, z_spi_len);
|
||||||
z_dev_start = spi_buffer;
|
z_dev_start = spi_buffer;
|
||||||
#endif // ESP32
|
#endif // ESP32
|
||||||
Z_Flashentry flashdata;
|
Z_Flashentry flashdata;
|
||||||
@ -367,7 +367,7 @@ void saveZigbeeDevices(void) {
|
|||||||
ESP.flashRead(z_spi_start_sector * SPI_FLASH_SEC_SIZE, (uint32_t*) spi_buffer, SPI_FLASH_SEC_SIZE);
|
ESP.flashRead(z_spi_start_sector * SPI_FLASH_SEC_SIZE, (uint32_t*) spi_buffer, SPI_FLASH_SEC_SIZE);
|
||||||
#endif // ESP8266
|
#endif // ESP8266
|
||||||
#ifdef ESP32
|
#ifdef ESP32
|
||||||
ZigbeeRead(&spi_buffer, z_spi_len);
|
ZigbeeRead(spi_buffer, z_spi_len);
|
||||||
#endif // ESP32
|
#endif // ESP32
|
||||||
|
|
||||||
Z_Flashentry *flashdata = (Z_Flashentry*)(spi_buffer + z_block_offset);
|
Z_Flashentry *flashdata = (Z_Flashentry*)(spi_buffer + z_block_offset);
|
||||||
@ -385,7 +385,7 @@ void saveZigbeeDevices(void) {
|
|||||||
AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_ZIGBEE "Zigbee Devices Data store in Flash (0x%08X - %d bytes)"), z_dev_start, buf_len);
|
AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_ZIGBEE "Zigbee Devices Data store in Flash (0x%08X - %d bytes)"), z_dev_start, buf_len);
|
||||||
#endif // ESP8266
|
#endif // ESP8266
|
||||||
#ifdef ESP32
|
#ifdef ESP32
|
||||||
ZigbeeWrite(&spi_buffer, z_spi_len);
|
ZigbeeWrite(spi_buffer, z_spi_len);
|
||||||
AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_ZIGBEE "Zigbee Devices Data saved in %s (%d bytes)"), PSTR("Flash"), buf_len);
|
AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_ZIGBEE "Zigbee Devices Data saved in %s (%d bytes)"), PSTR("Flash"), buf_len);
|
||||||
#endif // ESP32
|
#endif // ESP32
|
||||||
free(spi_buffer);
|
free(spi_buffer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user