From fa152b456048d6c4fc2c77ce126a5c119fb8803d Mon Sep 17 00:00:00 2001 From: penfold42 Date: Wed, 31 Aug 2016 17:34:52 +1000 Subject: [PATCH 1/2] Added debug logging to ProviderSpi.cpp on writes. If you have more leds configured than the SPI buffer can support you now get this: [HYPERIOND LedDevice] SPI failed to write. errno: 90, Message too long --- libsrc/leddevice/ProviderSpi.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libsrc/leddevice/ProviderSpi.cpp b/libsrc/leddevice/ProviderSpi.cpp index 754f7b0a..989566b3 100644 --- a/libsrc/leddevice/ProviderSpi.cpp +++ b/libsrc/leddevice/ProviderSpi.cpp @@ -89,6 +89,7 @@ int ProviderSpi::writeBytes(const unsigned size, const uint8_t * data) } int retVal = ioctl(_fid, SPI_IOC_MESSAGE(1), &_spi); + DebugIf((retVal < 0), _log, "SPI failed to write. errno: %d, %s", errno, strerror(errno) ); if (retVal == 0 && _latchTime_ns > 0) { From 44579f85eb8ba031a6c9996789bae93f1d66b70d Mon Sep 17 00:00:00 2001 From: penfold42 Date: Wed, 31 Aug 2016 17:51:50 +1000 Subject: [PATCH 2/2] changed debug to error --- libsrc/leddevice/ProviderSpi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsrc/leddevice/ProviderSpi.cpp b/libsrc/leddevice/ProviderSpi.cpp index 989566b3..9d8da653 100644 --- a/libsrc/leddevice/ProviderSpi.cpp +++ b/libsrc/leddevice/ProviderSpi.cpp @@ -89,7 +89,7 @@ int ProviderSpi::writeBytes(const unsigned size, const uint8_t * data) } int retVal = ioctl(_fid, SPI_IOC_MESSAGE(1), &_spi); - DebugIf((retVal < 0), _log, "SPI failed to write. errno: %d, %s", errno, strerror(errno) ); + ErrorIf((retVal < 0), _log, "SPI failed to write. errno: %d, %s", errno, strerror(errno) ); if (retVal == 0 && _latchTime_ns > 0) {