mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Added "invert" and "spimode" options to ws2801, ws2812spi and sk6812spi devices (#172)
* Added "invert" and "spimode" options to ws2801, ws2812spi and sk6812spi devices * fixed test/TestSpi.cpp * some coding style wish
This commit is contained in:
@@ -116,14 +116,18 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig)
|
||||
device = new LedDeviceWs2801(
|
||||
deviceConfig["output"].asString(),
|
||||
deviceConfig["rate"].asInt(),
|
||||
deviceConfig.get("latchtime",500000).asInt()
|
||||
deviceConfig.get("latchtime",500000).asInt(),
|
||||
deviceConfig.get("spimode",0).asInt(),
|
||||
deviceConfig.get("invert",false).asBool()
|
||||
);
|
||||
}
|
||||
else if (type == "ws2812spi")
|
||||
{
|
||||
device = new LedDeviceWs2812SPI(
|
||||
deviceConfig["output"].asString(),
|
||||
deviceConfig.get("rate",2857143).asInt()
|
||||
deviceConfig.get("rate",2857143).asInt(),
|
||||
deviceConfig.get("spimode",0).asInt(),
|
||||
deviceConfig.get("invert",false).asBool()
|
||||
);
|
||||
}
|
||||
else if (type == "sk6812rgbw-spi")
|
||||
@@ -131,7 +135,9 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig)
|
||||
device = new LedDeviceSk6812SPI(
|
||||
deviceConfig["output"].asString(),
|
||||
deviceConfig.get("rate",2857143).asInt(),
|
||||
deviceConfig.get("white_algorithm","").asString()
|
||||
deviceConfig.get("white_algorithm","").asString(),
|
||||
deviceConfig.get("spimode",0).asInt(),
|
||||
deviceConfig.get("invert",false).asBool()
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user