diff --git a/code/espurna/config/sensors.h b/code/espurna/config/sensors.h index e0ac7e76..af481da2 100644 --- a/code/espurna/config/sensors.h +++ b/code/espurna/config/sensors.h @@ -856,6 +856,22 @@ #define VL53L1X_INTER_MEASUREMENT_PERIOD 50 // Period, in milliseconds, determining how #endif // often the sensor takes a measurement. +//------------------------------------------------------------------------------ +// MAX6675 +// Enable support by passing MAX6675_SUPPORT=1 build flag +//------------------------------------------------------------------------------ +#ifndef MAX6675_CS_PIN +#define MAX6675_CS_PIN 13 +#endif + +#ifndef MAX6675_SO_PIN +#define MAX6675_SO_PIN 12 +#endif + +#ifndef MAX6675_SCK_PIN +#define MAX6675_SCK_PIN 14 +#endif + //------------------------------------------------------------------------------ // EZOPH pH meter // Enable support by passing EZOPH_SUPPORT=1 build flag @@ -916,6 +932,7 @@ V9261F_SUPPORT || \ VEML6075_SUPPORT || \ VL53L1X_SUPPORT || \ + MAX6675_SUPPORT || \ EZOPH_SUPPORT \ ) #endif diff --git a/code/espurna/libs/SyncClientWrap.h b/code/espurna/libs/SyncClientWrap.h index c22d27f9..b252eaf5 100644 --- a/code/espurna/libs/SyncClientWrap.h +++ b/code/espurna/libs/SyncClientWrap.h @@ -9,13 +9,29 @@ Temporary wrap to fix https://github.com/me-no-dev/ESPAsyncTCP/issues/109 #include +// ref Core 2.5.0: cores/esp8266/IPAddress.h +#ifndef CONST +#include + +#if LWIP_VERSION_MAJOR == 1 +#define CONST +#else +#define CONST const +#endif + +#endif + class SyncClientWrap: public SyncClient { public: + SyncClientWrap() {} + ~SyncClientWrap() {} + + // int connect(const char*, uint16_t); + using SyncClient::connect; - int connect(const char *host, uint16_t port); - int connect(CONST IPAddress& ip, uint16_t port) { return connect(ip, port); } - bool flush(unsigned int maxWaitMs = 0) { flush(); return true; } - bool stop(unsigned int maxWaitMs = 0) { stop(); return true; } + int connect(CONST IPAddress& ip, uint16_t port) { IPAddress _ip(ip); return SyncClient::connect(_ip, port); } + bool flush(unsigned int maxWaitMs = 0) { SyncClient::flush(); return true; } + bool stop(unsigned int maxWaitMs = 0) { SyncClient::stop(); return true; } }; diff --git a/code/espurna/ntp.ino b/code/espurna/ntp.ino index 153df10e..de9353e0 100644 --- a/code/espurna/ntp.ino +++ b/code/espurna/ntp.ino @@ -12,7 +12,7 @@ Copyright (C) 2016-2019 by Xose PĂ©rez #include #include -#include +#include "libs/NtpClientWrap.h" Ticker _ntp_defer;