mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Leddevice refactoring the next part (#253)
* add general switchOff * refactoring of leddevices regarding ledcount and switchoff * remove obsolete includes
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
#include <iostream>
|
||||
#include <exception>
|
||||
|
||||
#include "LedDeviceWS281x.h"
|
||||
@@ -86,23 +85,6 @@ int LedDeviceWS281x::write(const std::vector<ColorRgb> &ledValues)
|
||||
return ws2811_render(&_led_string) ? -1 : 0;
|
||||
}
|
||||
|
||||
// Turn off the LEDs by sending 000000's
|
||||
// TODO Allow optional power switch out another gpio, if this code handles it can
|
||||
// make it more likely we don't accidentally drive data into an off strip
|
||||
int LedDeviceWS281x::switchOff()
|
||||
{
|
||||
if (!_initialized)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int idx = 0;
|
||||
while (idx < _led_string.channel[_channel].count)
|
||||
_led_string.channel[_channel].leds[idx++] = 0;
|
||||
|
||||
return ws2811_render(&_led_string) ? -1 : 0;
|
||||
}
|
||||
|
||||
// Destructor
|
||||
LedDeviceWS281x::~LedDeviceWS281x()
|
||||
{
|
||||
|
Reference in New Issue
Block a user