diff --git a/EServer.cpp b/EServer.cpp index abb225c..2e2fe1c 100644 --- a/EServer.cpp +++ b/EServer.cpp @@ -24,7 +24,7 @@ bool EmlaServer::Connect2WiFi(const char *ssid, const char *password, int timeou Serial.print("Attempting to connect to SSID: "); Serial.println(ssid); #ifdef ESP8266 - WiFi.setInsecure(); +// WiFi.setInsecure(); #endif WiFi.begin(ssid, password); diff --git a/HTTPSP.cpp b/HTTPSP.cpp index 4a17a4b..dac0eaf 100644 --- a/HTTPSP.cpp +++ b/HTTPSP.cpp @@ -26,7 +26,9 @@ */ #include +#ifdef ESP32 #include +#endif #ifdef HTTPCLIENT_1_1_COMPATIBLE #include @@ -73,9 +75,11 @@ class TLSTraits : public TransportTraits bool verify(WiFiClient& client, const char* host) override { WiFiClientSecure& wcs = static_cast(client); +#ifdef ESP32 wcs.setCACert(_cacert); wcs.setCertificate(_clicert); wcs.setPrivateKey(_clikey); +#endif return true; } diff --git a/Main.cpp b/Main.cpp index ab8818d..fd471c7 100644 --- a/Main.cpp +++ b/Main.cpp @@ -1,4 +1,6 @@ +#ifdef ESP32 #include "esp32-hal-ledc.h" +#endif #include "Oled.h" #include "Defs.h" #include "TimeF.h" @@ -44,11 +46,13 @@ void setup() // OLED oledDisplay.Init(); - // servo + // servo only supported for ESP32 +#ifdef ESP32 // channel 1, 50 Hz, 16 bit width ledcSetup(1, 50, 16); // GPIO 2 attached to channel 1 ledcAttachPin(SERVO_PIN, 1); +#endif // -------------------------------------------------------------------------- // WiFi connection diff --git a/Session.cpp b/Session.cpp index 97b2d72..29466ed 100644 --- a/Session.cpp +++ b/Session.cpp @@ -90,6 +90,8 @@ void Session::Lock() // ------------------------------------------------------------------------ void Session::ForcedUnlock() { + // servo only supported for ESP32 +#ifdef ESP32 oledDisplay.PrintDisplay("Unlock GRANTED!"); ledcAttachPin(SERVO_PIN, 1); delay(50); @@ -100,6 +102,7 @@ void Session::ForcedUnlock() ledcWrite(1, 999); delay(500); ledcDetachPin(SERVO_PIN); +#endif }