Skip to content

Commit

Permalink
Arduino ESP32: updated to support ESP32 boards v2.0 onwards.
Browse files Browse the repository at this point in the history
This will break compilation on older ESP32 boards. Please update to
latest stable version.
Latest ESP32 board for Arduino is available from repository:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
  • Loading branch information
klew committed Feb 16, 2022
1 parent 25e7b82 commit c533e73
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/supla-common/lck.h
Expand Up @@ -19,7 +19,7 @@
#ifndef LCK_H_
#define LCK_H_

#if defined(ESP8266) || defined(ESP32)
#if defined(ESP8266)
#include <mem.h>
#define LCK_ICACHE_FLASH ICACHE_FLASH_ATTR
#endif
Expand Down
12 changes: 6 additions & 6 deletions src/supla-common/log.c
Expand Up @@ -122,6 +122,12 @@ void supla_vlog(int __pri, const char *message) {
OutputDebugStringW(wstr);
OutputDebugStringW(L"\n");
}
#elif defined(ARDUINO)
// supla-device variant for Arduino IDE
void supla_vlog(int __pri, const char *message) {
(void)(__pri);
serialPrintLn(message);
}
#elif defined(ESP_PLATFORM)
// variant for ESP8266 RTOS and ESP-IDF
void supla_vlog(int __pri, const char *message) {
Expand All @@ -146,12 +152,6 @@ void supla_vlog(int __pri, const char *message) {
ESP_LOGE(SUPLA_TAG, "%s", message);
};
}
#elif defined(ARDUINO)
// supla-device variant for Arduino IDE
void supla_vlog(int __pri, const char *message) {
(void)(__pri);
serialPrintLn(message);
}
#elif defined(SUPLA_DEVICE)
void supla_vlog(int __pri, const char *message) {
(void)(__pri);
Expand Down
2 changes: 1 addition & 1 deletion src/supla-common/log.h
Expand Up @@ -19,7 +19,7 @@
#ifndef suplalog_H_
#define suplalog_H_

#if defined(ESP8266) || defined(ESP32)
#if defined(ESP8266)
#include <mem.h>
#define LOG_ICACHE_FLASH ICACHE_FLASH_ATTR
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/supla-common/srpc.c
Expand Up @@ -27,8 +27,8 @@

#if defined(ESP8266) || defined(ESP32)

#include <mem.h>
#if !defined(ESP32)
#include <mem.h>
#include <osapi.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/supla-common/srpc.h
Expand Up @@ -41,8 +41,8 @@
#define SRPC_EXCLUDE_CLIENT
#define SRPC_ICACHE_FLASH ICACHE_FLASH_ATTR

#include <mem.h>
#if !defined(ESP32)
#include <mem.h>
#include <os_type.h>
#endif
#else
Expand Down
4 changes: 2 additions & 2 deletions src/supla/network/esp_wifi.h
Expand Up @@ -182,14 +182,14 @@ class ESPWifi : public Supla::Network {
Serial.print(rssi);
Serial.println(F(" dBm"));
},
WiFiEvent_t::SYSTEM_EVENT_STA_GOT_IP);
WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_GOT_IP);
(void)(event_gotIP);

WiFiEventId_t event_disconnected = WiFi.onEvent(
[](WiFiEvent_t event, WiFiEventInfo_t info) {
Serial.println(F("wifi Station disconnected"));
},
WiFiEvent_t::SYSTEM_EVENT_STA_DISCONNECTED);
WiFiEvent_t::ARDUINO_EVENT_WIFI_AP_STADISCONNECTED);
(void)(event_disconnected);
#endif
Serial.print(F("WiFi: establishing connection with SSID: \""));
Expand Down

0 comments on commit c533e73

Please sign in to comment.