mirror of
https://github.com/wled/WLED.git
synced 2025-07-12 13:26:33 +00:00
Idle current bugfix (#4402)
This commit is contained in:
parent
d4976ac47a
commit
b4aa8376de
@ -155,16 +155,6 @@ BusDigital::BusDigital(BusConfig &bc, uint8_t nr, const ColorOrderMap &com)
|
|||||||
DEBUG_PRINTF_P(PSTR("%successfully inited strip %u (len %u) with type %u and pins %u,%u (itype %u). mA=%d/%d\n"), _valid?"S":"Uns", nr, bc.count, bc.type, _pins[0], is2Pin(bc.type)?_pins[1]:255, _iType, _milliAmpsPerLed, _milliAmpsMax);
|
DEBUG_PRINTF_P(PSTR("%successfully inited strip %u (len %u) with type %u and pins %u,%u (itype %u). mA=%d/%d\n"), _valid?"S":"Uns", nr, bc.count, bc.type, _pins[0], is2Pin(bc.type)?_pins[1]:255, _iType, _milliAmpsPerLed, _milliAmpsMax);
|
||||||
}
|
}
|
||||||
|
|
||||||
//fine tune power estimation constants for your setup
|
|
||||||
//you can set it to 0 if the ESP is powered by USB and the LEDs by external
|
|
||||||
#ifndef MA_FOR_ESP
|
|
||||||
#ifdef ESP8266
|
|
||||||
#define MA_FOR_ESP 80 //how much mA does the ESP use (Wemos D1 about 80mA)
|
|
||||||
#else
|
|
||||||
#define MA_FOR_ESP 120 //how much mA does the ESP use (ESP32 about 120mA)
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//DISCLAIMER
|
//DISCLAIMER
|
||||||
//The following function attemps to calculate the current LED power usage,
|
//The following function attemps to calculate the current LED power usage,
|
||||||
//and will limit the brightness to stay below a set amperage threshold.
|
//and will limit the brightness to stay below a set amperage threshold.
|
||||||
@ -943,7 +933,6 @@ void BusManager::show() {
|
|||||||
busses[i]->show();
|
busses[i]->show();
|
||||||
_milliAmpsUsed += busses[i]->getUsedCurrent();
|
_milliAmpsUsed += busses[i]->getUsedCurrent();
|
||||||
}
|
}
|
||||||
if (_milliAmpsUsed) _milliAmpsUsed += MA_FOR_ESP;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BusManager::setStatusPixel(uint32_t c) {
|
void BusManager::setStatusPixel(uint32_t c) {
|
||||||
|
@ -363,6 +363,16 @@ struct BusConfig {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//fine tune power estimation constants for your setup
|
||||||
|
//you can set it to 0 if the ESP is powered by USB and the LEDs by external
|
||||||
|
#ifndef MA_FOR_ESP
|
||||||
|
#ifdef ESP8266
|
||||||
|
#define MA_FOR_ESP 80 //how much mA does the ESP use (Wemos D1 about 80mA)
|
||||||
|
#else
|
||||||
|
#define MA_FOR_ESP 120 //how much mA does the ESP use (ESP32 about 120mA)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
class BusManager {
|
class BusManager {
|
||||||
public:
|
public:
|
||||||
BusManager() {};
|
BusManager() {};
|
||||||
@ -370,7 +380,7 @@ class BusManager {
|
|||||||
//utility to get the approx. memory usage of a given BusConfig
|
//utility to get the approx. memory usage of a given BusConfig
|
||||||
static uint32_t memUsage(BusConfig &bc);
|
static uint32_t memUsage(BusConfig &bc);
|
||||||
static uint32_t memUsage(unsigned channels, unsigned count, unsigned buses = 1);
|
static uint32_t memUsage(unsigned channels, unsigned count, unsigned buses = 1);
|
||||||
static uint16_t currentMilliamps() { return _milliAmpsUsed; }
|
static uint16_t currentMilliamps() { return _milliAmpsUsed + MA_FOR_ESP; }
|
||||||
static uint16_t ablMilliampsMax() { return _milliAmpsMax; }
|
static uint16_t ablMilliampsMax() { return _milliAmpsMax; }
|
||||||
|
|
||||||
static int add(BusConfig &bc);
|
static int add(BusConfig &bc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user