mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
5aac2be702
* switch rs232 provider to completly async transfer * start of implementing a seperate init function for leddevices * rename setconfig to init * more fixes * implement missing code * fix code style * remove debug code * remove debug stuff * set loglevel to original state
22 lines
534 B
C++
22 lines
534 B
C++
#include "LedDeviceWs2801.h"
|
|
|
|
LedDeviceWs2801::LedDeviceWs2801(const Json::Value &deviceConfig)
|
|
: ProviderSpi()
|
|
{
|
|
_deviceReady = ProviderSpi::init(deviceConfig);
|
|
}
|
|
|
|
LedDevice* LedDeviceWs2801::construct(const Json::Value &deviceConfig)
|
|
{
|
|
return new LedDeviceWs2801(deviceConfig);
|
|
}
|
|
|
|
int LedDeviceWs2801::write(const std::vector<ColorRgb> &ledValues)
|
|
{
|
|
const unsigned dataLen = _ledCount * sizeof(ColorRgb);
|
|
const uint8_t * dataPtr = reinterpret_cast<const uint8_t *>(ledValues.data());
|
|
|
|
return writeBytes(dataLen, dataPtr);
|
|
}
|
|
|