Browse Source

Fix no relay control bug for Sonoff Dual devices

fastled 1.8.1
Xose Pérez 7 years ago
parent
commit
20681bcd04
5 changed files with 13 additions and 4 deletions
  1. +4
    -0
      CHANGELOG.md
  2. +1
    -1
      README.md
  3. +1
    -1
      code/espurna/config/version.h
  4. +3
    -0
      code/espurna/espurna.ino
  5. +4
    -2
      code/espurna/relay.ino

+ 4
- 0
CHANGELOG.md View File

@ -3,6 +3,10 @@
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [1.8.1] 2017-05-22
### Fix
- Issue #140. Fix no relay control bug in Sonoff Dual
## [1.8.0] 2017-05-21
### Added
- Added gamma correction to RGB strips. Thanks to Chris Ward.


+ 1
- 1
README.md View File

@ -4,7 +4,7 @@ ESPurna ("spark" in Catalan) is a custom firmware for ESP8266 based smart switch
It was originally developed with the **[IteadStudio Sonoff](https://www.itead.cc/sonoff-wifi-wireless-switch.html)** in mind but now it supports a growing number of ESP8266-based boards.
It uses the Arduino Core for ESP8266 framework and a number of 3rd party libraries.
**Current Release Version is 1.8.0**, read the [changelog](https://bitbucket.org/xoseperez/espurna/src/master/CHANGELOG.md).
**Current Release Version is 1.8.1**, read the [changelog](https://bitbucket.org/xoseperez/espurna/src/master/CHANGELOG.md).
## Features


+ 1
- 1
code/espurna/config/version.h View File

@ -1,4 +1,4 @@
#define APP_NAME "ESPurna"
#define APP_VERSION "1.8.0"
#define APP_VERSION "1.8.1"
#define APP_AUTHOR "xose.perez@gmail.com"
#define APP_WEBSITE "http://tinkerman.cat"

+ 3
- 0
code/espurna/espurna.ino View File

@ -102,6 +102,9 @@ void hardwareSetup() {
#ifdef DEBUG_PORT
DEBUG_PORT.begin(SERIAL_BAUDRATE);
#endif
#if SONOFF_DUAL
Serial.begin(SERIAL_BAUDRATE);
#endif
#if not EMBEDDED_WEB
SPIFFS.begin();
#endif


+ 4
- 2
code/espurna/relay.ino View File

@ -36,6 +36,8 @@ unsigned char _dual_status = 0;
void relayProviderStatus(unsigned char id, bool status) {
if (id >= _relays.size()) return;
#if RELAY_PROVIDER == RELAY_PROVIDER_DUAL
_dual_status ^= (1 << id);
Serial.flush();
@ -58,8 +60,9 @@ void relayProviderStatus(unsigned char id, bool status) {
bool relayProviderStatus(unsigned char id) {
if (id >= _relays.size()) return false;
#if RELAY_PROVIDER == RELAY_PROVIDER_DUAL
if (id >= 2) return false;
return ((_dual_status & (1 << id)) > 0);
#endif
@ -68,7 +71,6 @@ bool relayProviderStatus(unsigned char id) {
#endif
#if RELAY_PROVIDER == RELAY_PROVIDER_RELAY
if (id >= _relays.size()) return false;
bool status = (digitalRead(_relays[id].pin) == HIGH);
return _relays[id].reverse ? !status : status;
#endif


Loading…
Cancel
Save