Skip to content

Commit

Permalink
Update to Arduino 3.x core for ESP32
Browse files Browse the repository at this point in the history
  • Loading branch information
thorrak committed Aug 11, 2024
1 parent 1a04f34 commit d9ba361
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 497 deletions.
4 changes: 3 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ default_envs = esp32_wifi_tft
framework = arduino
; The default platform & platform package only applies to ESP32 derivatives
platform = espressif32
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.14
platform_packages =
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.4
platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-libs.git#idf-release/v5.1
lib_deps =
https://github.com/tzapu/WiFiManager.git#0d84861270c3cd64f72a4eaf34443ee580d2547e ; Anchor to latest commit as of 1/26/24
pstolarz/OneWireNg@^0.13.1
Expand Down
5 changes: 0 additions & 5 deletions src/ESP_BP_WiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@


bool shouldSaveConfig = false;
#ifndef ESP8266
WiFiServerFixed server(23);
WiFiClientFixed serverClient;
#else
WiFiServer server(23);
WiFiClient serverClient;
#endif

extern void handleReset(); // Terrible practice. In brewpi-esp8266.cpp.

Expand Down
7 changes: 0 additions & 7 deletions src/ESP_BP_WiFi.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#pragma once
#include <ArduinoJson.h>
#include "WiFiClientFix.h"
#include "WiFiServerFixed.h"

/**
* \file ESP_BP_WiFi.h
Expand Down Expand Up @@ -58,13 +56,8 @@ void initWifiServer();
*/
void wifi_connection_info(JsonDocument& doc);

#ifndef ESP8266
extern WiFiServerFixed server;
extern WiFiClientFixed serverClient;
#else
extern WiFiServer server;
extern WiFiClient serverClient;
#endif



Expand Down
7 changes: 1 addition & 6 deletions src/PiLink.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,7 @@ template <typename StreamType> class PiLink : public PiStream<StreamType> {
};

#if defined(ESP32S2)
extern PiLink<std::conditional<Config::PiLink::useWifi, WiFiClientFixed, USBCDC>::type> piLink;
extern PiLink<std::conditional<Config::PiLink::useWifi, WiFiClient, USBCDC>::type> piLink;
#else
#ifdef ESP8266
extern PiLink<std::conditional<Config::PiLink::useWifi, WiFiClient, HardwareSerial>::type> piLink;
#else
// ESP32
extern PiLink<std::conditional<Config::PiLink::useWifi, WiFiClientFixed, HardwareSerial>::type> piLink;
#endif
#endif
12 changes: 6 additions & 6 deletions src/PiStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,15 @@ template <typename StreamType> class PiStream {
* \brief Empty init for all other stream types types
*/
template <typename U = StreamType>
typename std::enable_if<!std::is_same<U, HardwareSerial>::value && !std::is_same<U, WiFiClientFixed>::value>::type
typename std::enable_if<!std::is_same<U, HardwareSerial>::value && !std::is_same<U, WiFiClient>::value>::type
init(){};

/**
* \brief Initialize WiFi Stream
*
* \see initWifiServer()
*/
template <typename U = StreamType> typename std::enable_if<std::is_same<U, WiFiClientFixed>::value>::type init() {
template <typename U = StreamType> typename std::enable_if<std::is_same<U, WiFiClient>::value>::type init() {
::initWifiServer();
};

Expand Down Expand Up @@ -323,19 +323,19 @@ template <typename StreamType> class PiStream {
// WriteBufferingClient stream;

/**
* \brief _bool implementation for non WiFiClientFixed Streams
* \brief _bool implementation for non WiFiClient Streams
*/
template <typename U = StreamType> typename std::enable_if<!std::is_same<U, WiFiClientFixed>::value, bool>::type _bool() {
template <typename U = StreamType> typename std::enable_if<!std::is_same<U, WiFiClient>::value, bool>::type _bool() {
return bool(stream);
};

/**
* \brief _bool implementation for WiFiClientFixed Streams
* \brief _bool implementation for WiFiClient Streams
*
* This checks both the bool operator of the underlying Stream and its
* connected() method
*/
template <typename U = StreamType> typename std::enable_if<std::is_same<U, WiFiClientFixed>::value, bool>::type _bool() {
template <typename U = StreamType> typename std::enable_if<std::is_same<U, WiFiClient>::value, bool>::type _bool() {
return bool(stream) && upstream.connected();
};
};
Expand Down
226 changes: 0 additions & 226 deletions src/WiFiClientFix.cpp

This file was deleted.

17 changes: 0 additions & 17 deletions src/WiFiClientFix.h

This file was deleted.

Loading

0 comments on commit d9ba361

Please sign in to comment.