Merge branch 'dev' into audioreactive-prototype

This commit is contained in:
Blaz Kristan 2022-08-21 20:50:40 +02:00
commit d56d41a8c2
3 changed files with 19 additions and 28 deletions

View File

@ -19,7 +19,6 @@ struct NodeStruct
{ {
String nodeName; String nodeName;
IPAddress ip; IPAddress ip;
uint8_t unit;
uint8_t age; uint8_t age;
uint8_t nodeType; uint8_t nodeType;
uint32_t build; uint32_t build;

View File

@ -134,7 +134,12 @@ struct ColorOrderMap {
//parent class of BusDigital, BusPwm, and BusNetwork //parent class of BusDigital, BusPwm, and BusNetwork
class Bus { class Bus {
public: public:
Bus(uint8_t type, uint16_t start, uint8_t aw) { Bus(uint8_t type, uint16_t start, uint8_t aw)
: _bri(255)
, _len(1)
, _valid(false)
, _needsRefresh(false)
{
_type = type; _type = type;
_start = start; _start = start;
_autoWhiteMode = Bus::isRgbw(_type) ? aw : RGBW_MODE_MANUAL_ONLY; _autoWhiteMode = Bus::isRgbw(_type) ? aw : RGBW_MODE_MANUAL_ONLY;
@ -142,13 +147,13 @@ class Bus {
virtual ~Bus() {} //throw the bus under the bus virtual ~Bus() {} //throw the bus under the bus
virtual void show() {} virtual void show() = 0;
virtual bool canShow() { return true; } virtual bool canShow() { return true; }
virtual void setStatusPixel(uint32_t c) {} virtual void setStatusPixel(uint32_t c) {}
virtual void setPixelColor(uint16_t pix, uint32_t c) {} virtual void setPixelColor(uint16_t pix, uint32_t c) = 0;
virtual uint32_t getPixelColor(uint16_t pix) { return 0; } virtual uint32_t getPixelColor(uint16_t pix) { return 0; }
virtual void setBrightness(uint8_t b) {} virtual void setBrightness(uint8_t b) { _bri = b; };
virtual void cleanup() {} virtual void cleanup() = 0;
virtual uint8_t getPins(uint8_t* pinArray) { return 0; } virtual uint8_t getPins(uint8_t* pinArray) { return 0; }
virtual uint16_t getLength() { return _len; } virtual uint16_t getLength() { return _len; }
virtual void setColorOrder() {} virtual void setColorOrder() {}
@ -195,12 +200,12 @@ class Bus {
bool reversed = false; bool reversed = false;
protected: protected:
uint8_t _type = TYPE_NONE; uint8_t _type;
uint8_t _bri = 255; uint8_t _bri;
uint16_t _start = 0; uint16_t _start;
uint16_t _len = 1; uint16_t _len;
bool _valid = false; bool _valid;
bool _needsRefresh = false; bool _needsRefresh;
uint8_t _autoWhiteMode; uint8_t _autoWhiteMode;
static uint8_t _gAWM; // definition in FX_fcn.cpp static uint8_t _gAWM; // definition in FX_fcn.cpp
static int16_t _cct; // definition in FX_fcn.cpp static int16_t _cct; // definition in FX_fcn.cpp
@ -262,7 +267,7 @@ class BusDigital : public Bus {
if (_pins[0] == LED_BUILTIN || _pins[1] == LED_BUILTIN) PolyBus::begin(_busPtr, _iType, _pins); if (_pins[0] == LED_BUILTIN || _pins[1] == LED_BUILTIN) PolyBus::begin(_busPtr, _iType, _pins);
} }
#endif #endif
_bri = b; Bus::setBrightness(b);
PolyBus::setBrightness(_busPtr, _iType, b); PolyBus::setBrightness(_busPtr, _iType, b);
} }
@ -448,10 +453,6 @@ class BusPwm : public Bus {
} }
} }
inline void setBrightness(uint8_t b) {
_bri = b;
}
uint8_t getPins(uint8_t* pinArray) { uint8_t getPins(uint8_t* pinArray) {
if (!_valid) return 0; if (!_valid) return 0;
uint8_t numPins = NUM_PWM_PINS(_type); uint8_t numPins = NUM_PWM_PINS(_type);
@ -531,10 +532,6 @@ class BusOnOff : public Bus {
digitalWrite(_pin, reversed ? !(bool)_data : (bool)_data); digitalWrite(_pin, reversed ? !(bool)_data : (bool)_data);
} }
inline void setBrightness(uint8_t b) {
_bri = b;
}
uint8_t getPins(uint8_t* pinArray) { uint8_t getPins(uint8_t* pinArray) {
if (!_valid) return 0; if (!_valid) return 0;
pinArray[0] = _pin; pinArray[0] = _pin;
@ -623,10 +620,6 @@ class BusNetwork : public Bus {
return !_broadcastLock; return !_broadcastLock;
} }
inline void setBrightness(uint8_t b) {
_bri = b;
}
uint8_t getPins(uint8_t* pinArray) { uint8_t getPins(uint8_t* pinArray) {
for (uint8_t i = 0; i < 4; i++) { for (uint8_t i = 0; i < 4; i++) {
pinArray[i] = _client[i]; pinArray[i] = _client[i];
@ -655,7 +648,6 @@ class BusNetwork : public Bus {
private: private:
IPAddress _client; IPAddress _client;
uint8_t _bri = 255;
uint8_t _UDPtype; uint8_t _UDPtype;
uint8_t _UDPchannels; uint8_t _UDPchannels;
bool _rgbw; bool _rgbw;

View File

@ -8,7 +8,7 @@
*/ */
// version code in format yymmddb (b = daily build) // version code in format yymmddb (b = daily build)
#define VERSION 2208191 #define VERSION 2208211
//uncomment this if you have a "my_config.h" file you'd like to use //uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG //#define WLED_USE_MY_CONFIG
@ -27,7 +27,7 @@
//#define WLED_DISABLE_ALEXA // saves 11kb //#define WLED_DISABLE_ALEXA // saves 11kb
//#define WLED_DISABLE_BLYNK // saves 6kb //#define WLED_DISABLE_BLYNK // saves 6kb
//#define WLED_DISABLE_HUESYNC // saves 4kb //#define WLED_DISABLE_HUESYNC // saves 4kb
//#define WLED_DISABLE_INFRARED // there is no pin left for this on ESP8266-01, saves 12kb //#define WLED_DISABLE_INFRARED // saves 12kb
#ifndef WLED_DISABLE_MQTT #ifndef WLED_DISABLE_MQTT
#define WLED_ENABLE_MQTT // saves 12kb #define WLED_ENABLE_MQTT // saves 12kb
#endif #endif