mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Ws2812spi and sk6812rgbw have wrong default rate (#221)
* Changed default baud rate in schema for ws2812spi and sk6812spi * now sets the default baud_rate speed to 2800000 if omitted. Previously it used the ProviderSPI default which was 1000000 and guaranteed not to work * Added warnings if the SPI baud rate is likely out of range Added some debug statements to ProviderSpi
This commit is contained in:
@@ -33,6 +33,13 @@ LedDevice* LedDeviceSk6812SPI::construct(const Json::Value &deviceConfig)
|
||||
bool LedDeviceSk6812SPI::setConfig(const Json::Value &deviceConfig)
|
||||
{
|
||||
ProviderSpi::setConfig(deviceConfig);
|
||||
|
||||
_baudRate_Hz = deviceConfig.get("rate",3000000).asInt();
|
||||
if ( (_baudRate_Hz < 2050000) || (_baudRate_Hz > 4000000) )
|
||||
{
|
||||
Warning(_log, "SPI rate %d outside recommended range (2050000 -> 4000000)", _baudRate_Hz);
|
||||
}
|
||||
|
||||
_whiteAlgorithm = deviceConfig.get("white_algorithm","").asString();
|
||||
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user