Skip to content

Commit 1466589

Browse files
authored
Merge pull request #14 from tobozo/patch-1
Update flashz.hpp
2 parents 7279352 + f3c294f commit 1466589

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

src/flashz.hpp

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,30 @@
2929

3030

3131
#pragma once
32-
#include <rom/miniz.h>
32+
33+
// arduino-esp32 core 2.x => 3.x migration
34+
#if __has_include("miniz.h")
35+
#include "miniz.h"
36+
#else
37+
#include <rom/miniz.h>
38+
#endif
39+
3340
#include <Update.h>
3441
#include <functional>
3542

43+
// arduino-esp32 core 2.x => 3.x migration
44+
#if !defined SPI_FLASH_SEC_SIZE
45+
#include "spi_flash_mmap.h"
46+
#endif
47+
48+
// arduino-esp32 core 2.x => 3.x migration
49+
#if __has_include(<NetworkClient.h>)
50+
#include <NetworkClient.h>
51+
#define WiFiClient NetworkClient
52+
#else
53+
#include <WiFiClient.h>
54+
#endif
55+
3656
#ifndef ESP_IMAGE_HEADER_MAGIC
3757
#define ESP_IMAGE_HEADER_MAGIC 0xE9
3858
#endif
@@ -223,4 +243,4 @@ class FlashZ : public UpdateClass {
223243
* @param stat stat structure to update with data
224244
*/
225245
void getstat(deco_stat_t &stat){ deco.getstat(stat); };
226-
};
246+
};

0 commit comments

Comments
 (0)