mirror of https://github.com/arendst/Tasmota.git
v5.5.1a
5.5.1a * Extent max number of WS2812 pixels from 256 to 512 (#667)
This commit is contained in:
parent
934d6e3f15
commit
24520bfcfa
|
@ -1,7 +1,7 @@
|
||||||
## Sonoff-Tasmota
|
## Sonoff-Tasmota
|
||||||
Provide ESP8266 based Sonoff by [iTead Studio](https://www.itead.cc/) and ElectroDragon IoT Relay with Serial, Web and MQTT control allowing 'Over the Air' or OTA firmware updates using Arduino IDE.
|
Provide ESP8266 based Sonoff by [iTead Studio](https://www.itead.cc/) and ElectroDragon IoT Relay with Serial, Web and MQTT control allowing 'Over the Air' or OTA firmware updates using Arduino IDE.
|
||||||
|
|
||||||
Current version is **5.5.1** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/master/sonoff/_releasenotes.ino) for change information.
|
Current version is **5.5.1a** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/master/sonoff/_releasenotes.ino) for change information.
|
||||||
|
|
||||||
### ATTENTION All versions
|
### ATTENTION All versions
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
/* 5.5.1 20170805
|
/* 5.5.1a
|
||||||
|
* Extent max number of WS2812 pixels from 256 to 512 (#667)
|
||||||
|
*
|
||||||
|
* 5.5.1 20170805
|
||||||
* Fix Sonoff Rf Bridge issues
|
* Fix Sonoff Rf Bridge issues
|
||||||
* Add Sonoff RF Bridge MQTT messages on received and learned RF signal
|
* Add Sonoff RF Bridge MQTT messages on received and learned RF signal
|
||||||
* Add command VoltRes 0|1 to select voltage resolution to 0.1 V (#654)
|
* Add command VoltRes 0|1 to select voltage resolution to 0.1 V (#654)
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
- Select IDE Tools - Flash Size: "1M (no SPIFFS)"
|
- Select IDE Tools - Flash Size: "1M (no SPIFFS)"
|
||||||
====================================================*/
|
====================================================*/
|
||||||
|
|
||||||
#define VERSION 0x05050100 // 5.5.1
|
#define VERSION 0x05050101 // 5.5.1a
|
||||||
|
|
||||||
enum log_t {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE, LOG_LEVEL_ALL};
|
enum log_t {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE, LOG_LEVEL_ALL};
|
||||||
enum week_t {Last, First, Second, Third, Fourth};
|
enum week_t {Last, First, Second, Third, Fourth};
|
||||||
|
@ -119,7 +119,7 @@ enum emul_t {EMUL_NONE, EMUL_WEMO, EMUL_HUE, EMUL_MAX};
|
||||||
#define APP_POWER 0 // Default saved power state Off
|
#define APP_POWER 0 // Default saved power state Off
|
||||||
#define MAX_COUNTERS 4 // Max number of counter sensors
|
#define MAX_COUNTERS 4 // Max number of counter sensors
|
||||||
#define MAX_PULSETIMERS 4 // Max number of supported pulse timers
|
#define MAX_PULSETIMERS 4 // Max number of supported pulse timers
|
||||||
#define WS2812_MAX_LEDS 256 // Max number of LEDs
|
#define WS2812_MAX_LEDS 512 // Max number of LEDs
|
||||||
|
|
||||||
#define PWM_RANGE 1023 // 255..1023 needs to be devisible by 256
|
#define PWM_RANGE 1023 // 255..1023 needs to be devisible by 256
|
||||||
//#define PWM_FREQ 1000 // 100..1000 Hz led refresh
|
//#define PWM_FREQ 1000 // 100..1000 Hz led refresh
|
||||||
|
|
|
@ -259,18 +259,18 @@ void ws2812_clock()
|
||||||
ws2812_stripShow();
|
ws2812_stripShow();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ws2812_gradientColor(struct wsColor* mColor, uint8_t range, uint8_t gradRange, uint8_t i)
|
void ws2812_gradientColor(struct wsColor* mColor, uint16_t range, uint16_t gradRange, uint16_t i)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Compute the color of a pixel at position i using a gradient of the color scheme.
|
* Compute the color of a pixel at position i using a gradient of the color scheme.
|
||||||
* This function is used internally by the gradient function.
|
* This function is used internally by the gradient function.
|
||||||
*/
|
*/
|
||||||
ColorScheme scheme = schemes[sysCfg.ws_scheme -3];
|
ColorScheme scheme = schemes[sysCfg.ws_scheme -3];
|
||||||
uint8_t curRange = i / range;
|
uint16_t curRange = i / range;
|
||||||
uint8_t rangeIndex = i % range;
|
uint16_t rangeIndex = i % range;
|
||||||
uint8_t colorIndex = rangeIndex / gradRange;
|
uint16_t colorIndex = rangeIndex / gradRange;
|
||||||
uint8_t start = colorIndex;
|
uint16_t start = colorIndex;
|
||||||
uint8_t end = colorIndex +1;
|
uint16_t end = colorIndex +1;
|
||||||
if (curRange % 2 != 0) {
|
if (curRange % 2 != 0) {
|
||||||
start = (scheme.count -1) - start;
|
start = (scheme.count -1) - start;
|
||||||
end = (scheme.count -1) - end;
|
end = (scheme.count -1) - end;
|
||||||
|
@ -299,9 +299,9 @@ void ws2812_gradient()
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t repeat = repeatValues[sysCfg.ws_width]; // number of scheme.count per ledcount
|
uint8_t repeat = repeatValues[sysCfg.ws_width]; // number of scheme.count per ledcount
|
||||||
uint8_t range = (uint8_t)ceil((float)sysCfg.ws_pixels / (float)repeat);
|
uint16_t range = (uint16_t)ceil((float)sysCfg.ws_pixels / (float)repeat);
|
||||||
uint8_t gradRange = (uint8_t)ceil((float)range / (float)(scheme.count - 1));
|
uint16_t gradRange = (uint16_t)ceil((float)range / (float)(scheme.count - 1));
|
||||||
uint8_t offset = speedValues[sysCfg.ws_speed] > 0 ? stripTimerCntr / speedValues[sysCfg.ws_speed] : 0;
|
uint16_t offset = speedValues[sysCfg.ws_speed] > 0 ? stripTimerCntr / speedValues[sysCfg.ws_speed] : 0;
|
||||||
|
|
||||||
wsColor oldColor, currentColor;
|
wsColor oldColor, currentColor;
|
||||||
ws2812_gradientColor(&oldColor, range, gradRange, offset);
|
ws2812_gradientColor(&oldColor, range, gradRange, offset);
|
||||||
|
@ -340,7 +340,7 @@ void ws2812_bars()
|
||||||
|
|
||||||
ColorScheme scheme = schemes[sysCfg.ws_scheme -3];
|
ColorScheme scheme = schemes[sysCfg.ws_scheme -3];
|
||||||
|
|
||||||
uint8_t maxSize = sysCfg.ws_pixels / scheme.count;
|
uint16_t maxSize = sysCfg.ws_pixels / scheme.count;
|
||||||
if (widthValues[sysCfg.ws_width] > maxSize) {
|
if (widthValues[sysCfg.ws_width] > maxSize) {
|
||||||
maxSize = 0;
|
maxSize = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue