Skip to content

Commit 2a56919

Browse files
authored
Merge pull request #1138 from vortigont/verguards
add arduino version guards
2 parents 5bc3797 + 3f0094b commit 2a56919

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Audio.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,21 @@
1717
#include <libb64/cencode.h>
1818
#include <esp32-hal-log.h>
1919
#include <WiFi.h>
20-
#include <WiFiClient.h>
21-
#include <WiFiClientSecure.h>
2220
#include <SD.h>
2321
#include <SD_MMC.h>
24-
#include <SPIFFS.h>
2522
#include <FS.h>
2623
#include <FFat.h>
2724
#include <atomic>
2825
#include <codecvt>
2926
#include <locale>
3027
#include <memory>
28+
#if ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(3, 0, 0)
29+
#include <WiFiClient.h>
30+
#include <WiFiClientSecure.h>
31+
#else
3132
#include <NetworkClient.h>
3233
#include <NetworkClientSecure.h>
34+
#endif // ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(3, 0, 0)
3335
#include <driver/i2s_std.h>
3436
#include "psram_unique_ptr.hpp"
3537

@@ -845,15 +847,15 @@ class Audio{
845847
} pid_array;
846848

847849
File m_audiofile;
848-
#ifndef ETHERNET_IF
850+
#if ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(3, 0, 0)
849851
WiFiClient client;
850852
WiFiClientSecure clientsecure;
851853
WiFiClient* m_client = nullptr;
852854
#else
853855
NetworkClient client;
854856
NetworkClientSecure clientsecure;
855857
NetworkClient* m_client = nullptr;
856-
#endif
858+
#endif // ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(3, 0, 0)
857859
SemaphoreHandle_t mutex_playAudioData;
858860
SemaphoreHandle_t mutex_audioTask;
859861
TaskHandle_t m_audioTaskHandle = nullptr;

0 commit comments

Comments
 (0)