mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
1. changed default number of pwm LEDs to 256
2. Adds support for level shifters that invert the data Config option - "invert" (integer) if omitted, do not invert if == 0, do not invert if !=0, invert Former-commit-id: fd5b2863a85b11ac3a8444d1e02822f852feb556
This commit is contained in:
@@ -324,12 +324,13 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig)
|
||||
else if (type == "ws281x")
|
||||
{
|
||||
const int gpio = deviceConfig.get("gpio", 18).asInt();
|
||||
const int leds = deviceConfig.get("leds", 12).asInt();
|
||||
const int leds = deviceConfig.get("leds", 256).asInt();
|
||||
const uint32_t freq = deviceConfig.get("freq", (Json::UInt)800000ul).asInt();
|
||||
const int dmanum = deviceConfig.get("dmanum", 5).asInt();
|
||||
const int pwmchannel = deviceConfig.get("pwmchannel", 0).asInt();
|
||||
const int invert = deviceConfig.get("invert", 0).asInt();
|
||||
|
||||
LedDeviceWS281x * ledDeviceWS281x = new LedDeviceWS281x(gpio, leds, freq, dmanum, pwmchannel);
|
||||
LedDeviceWS281x * ledDeviceWS281x = new LedDeviceWS281x(gpio, leds, freq, dmanum, pwmchannel, invert);
|
||||
device = ledDeviceWS281x;
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user