mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Minor reformat of code to match hyperion-style. Added ws2812b as option to disable for devices without dma-pwm
Former-commit-id: 579f4426285fb537706a22af446f5280748f2ab7
This commit is contained in:
@@ -31,7 +31,9 @@
|
||||
#include "LedDevicePhilipsHue.h"
|
||||
#include "LedDeviceTpm2.h"
|
||||
|
||||
#include "LedDeviceWS2812b.h"
|
||||
#ifdef ENABLE_WS2812BPWM
|
||||
#include "LedDeviceWS2812b.h"
|
||||
#endif
|
||||
|
||||
LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig)
|
||||
{
|
||||
@@ -180,14 +182,17 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig)
|
||||
const std::string output = deviceConfig["output"].asString();
|
||||
const unsigned rate = deviceConfig["rate"].asInt();
|
||||
|
||||
LedDeviceTpm2* deviceTpm2 = new LedDeviceTpm2(output, rate);
|
||||
LedDeviceTpm2 * deviceTpm2 = new LedDeviceTpm2(output, rate);
|
||||
deviceTpm2->open();
|
||||
device = deviceTpm2;
|
||||
}else if (type == "ws2812b")
|
||||
}
|
||||
#ifdef ENABLE_WS2812BPWM
|
||||
else if (type == "ws2812b")
|
||||
{
|
||||
LedDeviceWS2812b * ledDeviceWS2812b = new LedDeviceWS2812b();
|
||||
device = ledDeviceWS2812b;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
std::cout << "Unable to create device " << type << std::endl;
|
||||
|
Reference in New Issue
Block a user