mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Add ws281x driver parameter for PWM channel
The RPi 2 and 3 have two PWM channels and 3 PWM pins available to the gpio header. BCM18 and BCM12 run on PWM channel 0. BCM13 runs on PWM channel 1. This change allows BCM13 to be used by allowing the PWM channel to be specified. Former-commit-id: 3693ab438c2b369e6307c262d32bba509409e5b9
This commit is contained in:
@@ -327,8 +327,9 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig)
|
||||
const int leds = deviceConfig.get("leds", 12).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();
|
||||
|
||||
LedDeviceWS281x * ledDeviceWS281x = new LedDeviceWS281x(gpio, leds, freq, dmanum);
|
||||
LedDeviceWS281x * ledDeviceWS281x = new LedDeviceWS281x(gpio, leds, freq, dmanum, pwmchannel);
|
||||
device = ledDeviceWS281x;
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user