Skip to content

Commit

Permalink
Limit SPI speed for rp2040 and HyperSPI
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev authored Dec 12, 2023
1 parent f0577f1 commit b13a8aa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sources/leddevice/dev_spi/ProviderSpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ bool ProviderSpi::init(const QJsonObject& deviceConfig)
_baudRate_Hz = deviceConfig["rate"].toInt(_baudRate_Hz);
_spiMode = deviceConfig["spimode"].toInt(_spiMode);
_spiDataInvert = deviceConfig["invert"].toBool(_spiDataInvert);


if (_spiType == "rp2040" && _baudRate_Hz > 20833333)
{
_baudRate_Hz = 20833333;
}

Debug(_log, "_baudRate_Hz [%d], _spiType: %s", _baudRate_Hz, QSTRING_CSTR(_spiType));
Debug(_log, "_spiDataInvert [%d], _spiMode [%d]", _spiDataInvert, _spiMode);

Expand Down

0 comments on commit b13a8aa

Please sign in to comment.