Add support for Sugar Valley NeoPool Controller

Add support for Sugar Valley NeoPool Controller by Norbert Richter (#10637)
This commit is contained in:
Theo Arends 2021-01-20 17:03:53 +01:00
parent 8744ab0f19
commit 5561de02fa
5 changed files with 33 additions and 42 deletions

View File

@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file.
- Compile time option ``USE_MQTT_TLS_DROP_OLD_FINGERPRINT`` to drop old (less secure) TLS fingerprint - Compile time option ``USE_MQTT_TLS_DROP_OLD_FINGERPRINT`` to drop old (less secure) TLS fingerprint
- Command ``SetOption40 0..250`` to disable button functionality if activated for over 0.1 second re-introduced - Command ``SetOption40 0..250`` to disable button functionality if activated for over 0.1 second re-introduced
- Support for SM2135 current selection using GPIO ``SM2135 DAT`` index (#10634) - Support for SM2135 current selection using GPIO ``SM2135 DAT`` index (#10634)
- Support for Sugar Valley NeoPool Controller by Norbert Richter (#10637)
### Breaking Changed ### Breaking Changed
- ESP32 switch from default SPIFFS to default LittleFS file system loosing current (zigbee) files - ESP32 switch from default SPIFFS to default LittleFS file system loosing current (zigbee) files

View File

@ -81,6 +81,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota
- Support for time proportioned (``#define USE_TIMEPROP``) and optional PID (``#define USE_PID``) relay control [#10412](https://github.com/arendst/Tasmota/issues/10412) - Support for time proportioned (``#define USE_TIMEPROP``) and optional PID (``#define USE_PID``) relay control [#10412](https://github.com/arendst/Tasmota/issues/10412)
- Support for 24/26/32/34 bit RFID Wiegand interface (D0/D1) by Sigurd Leuther [#3647](https://github.com/arendst/Tasmota/issues/3647) - Support for 24/26/32/34 bit RFID Wiegand interface (D0/D1) by Sigurd Leuther [#3647](https://github.com/arendst/Tasmota/issues/3647)
- Support for SM2135 current selection using GPIO ``SM2135 DAT`` index [#10634](https://github.com/arendst/Tasmota/issues/10634) - Support for SM2135 current selection using GPIO ``SM2135 DAT`` index [#10634](https://github.com/arendst/Tasmota/issues/10634)
- Support for Sugar Valley NeoPool Controller by Norbert Richter [#10637](https://github.com/arendst/Tasmota/issues/10637)
- Support rotary encoder on Shelly Dimmer [#10407](https://github.com/arendst/Tasmota/issues/10407#issuecomment-756240920) - Support rotary encoder on Shelly Dimmer [#10407](https://github.com/arendst/Tasmota/issues/10407#issuecomment-756240920)
- Support character `#` to be replaced by `space`-character in command ``Publish`` topic [#10258](https://github.com/arendst/Tasmota/issues/10258) - Support character `#` to be replaced by `space`-character in command ``Publish`` topic [#10258](https://github.com/arendst/Tasmota/issues/10258)
- Basic support for ESP32 Odroid Go 16MB binary tasmota32-odroidgo.bin [#8630](https://github.com/arendst/Tasmota/issues/8630) - Basic support for ESP32 Odroid Go 16MB binary tasmota32-odroidgo.bin [#8630](https://github.com/arendst/Tasmota/issues/8630)

View File

@ -67,7 +67,7 @@
#include <Wire.h> // I2C support library #include <Wire.h> // I2C support library
//#endif // USE_I2C //#endif // USE_I2C
#ifdef USE_SPI #ifdef USE_SPI
#include <SPI.h> // SPI support, TFT #include <SPI.h> // SPI support, TFT, SDcard
#endif // USE_SPI #endif // USE_SPI
#ifdef USE_UFILESYS #ifdef USE_UFILESYS
@ -79,9 +79,7 @@
#include <SDFAT.h> #include <SDFAT.h>
#endif // USE_SDCARD #endif // USE_SDCARD
#endif // ESP8266 #endif // ESP8266
#ifdef ESP32 #ifdef ESP32
#define FFS_2
#include <LITTLEFS.h> #include <LITTLEFS.h>
#ifdef USE_SDCARD #ifdef USE_SDCARD
#include <SD.h> #include <SD.h>

View File

@ -60,9 +60,7 @@ ufsfree free size in kB
#include <SDFAT.h> #include <SDFAT.h>
#endif // USE_SDCARD #endif // USE_SDCARD
#endif // ESP8266 #endif // ESP8266
#ifdef ESP32 #ifdef ESP32
#define FFS_2
#include <LITTLEFS.h> #include <LITTLEFS.h>
#ifdef USE_SDCARD #ifdef USE_SDCARD
#include <SD.h> #include <SD.h>

View File

@ -656,9 +656,8 @@ void NeoPool250ms(void) // Every 250 mSec
/*********************************************************************************************/ /*********************************************************************************************/
void NeoPoolInit(void) void NeoPoolInit(void) {
{ neopool_active = false;
if (NeoPoolInitData()) {
if (PinUsed(GPIO_NEOPOOL_RX) && PinUsed(GPIO_NEOPOOL_TX)) { if (PinUsed(GPIO_NEOPOOL_RX) && PinUsed(GPIO_NEOPOOL_TX)) {
NeoPoolModbus = new TasmotaModbus(Pin(GPIO_NEOPOOL_RX), Pin(GPIO_NEOPOOL_TX)); NeoPoolModbus = new TasmotaModbus(Pin(GPIO_NEOPOOL_RX), Pin(GPIO_NEOPOOL_TX));
uint8_t result = NeoPoolModbus->Begin(NEOPOOL_MODBUS_SPEED); uint8_t result = NeoPoolModbus->Begin(NEOPOOL_MODBUS_SPEED);
@ -669,11 +668,9 @@ void NeoPoolInit(void)
#ifdef NEOPOOL_OPTIMIZE_READINGS #ifdef NEOPOOL_OPTIMIZE_READINGS
neopool_first_read = true; neopool_first_read = true;
#endif // NEOPOOL_OPTIMIZE_READINGS #endif // NEOPOOL_OPTIMIZE_READINGS
if (NeoPoolInitData()) { // Claims heap space
neopool_active = true; neopool_active = true;
} }
else {
neopool_active = false;
}
} }
} }
} }
@ -1314,14 +1311,13 @@ bool Xsns83(uint8_t function)
{ {
bool result = false; bool result = false;
switch (function) { if (FUNC_INIT == function) {
case FUNC_INIT:
NeoPoolInit(); NeoPoolInit();
break;
case FUNC_EVERY_250_MSECOND:
if (neopool_active) {
NeoPool250ms();
} }
else if (neopool_active) {
switch (function) {
case FUNC_EVERY_250_MSECOND:
NeoPool250ms();
break; break;
case FUNC_COMMAND_SENSOR: case FUNC_COMMAND_SENSOR:
if (XSNS_83 == XdrvMailbox.index) { if (XSNS_83 == XdrvMailbox.index) {
@ -1329,18 +1325,15 @@ bool Xsns83(uint8_t function)
} }
break; break;
case FUNC_JSON_APPEND: case FUNC_JSON_APPEND:
if (neopool_active) {
NeoPoolShow(1); NeoPoolShow(1);
}
break; break;
#ifdef USE_WEBSERVER #ifdef USE_WEBSERVER
case FUNC_WEB_SENSOR: case FUNC_WEB_SENSOR:
if (neopool_active) {
NeoPoolShow(0); NeoPoolShow(0);
}
break; break;
#endif // USE_WEBSERVER #endif // USE_WEBSERVER
} }
}
return result; return result;
} }