Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2021-10-26 13:56:17 +0300
committerDavid Crocker <dcrocker@eschertech.com>2021-10-26 13:56:17 +0300
commit54fb8c8c6142d55122b76c82837aa0715fbb7d6a (patch)
treec6e262497d41066d6d5c00ffc98d07211c66a3a0
parentdd9a2a1f57f9c563d7307ed2249887786a2ed516 (diff)
Fix MB6HC DotStar bug
-rw-r--r--src/Fans/LedStripDriver.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Fans/LedStripDriver.cpp b/src/Fans/LedStripDriver.cpp
index 4ebc7306..f098e6eb 100644
--- a/src/Fans/LedStripDriver.cpp
+++ b/src/Fans/LedStripDriver.cpp
@@ -641,9 +641,9 @@ GCodeResult LedStripDriver::SetColours(GCodeBuffer& gb, const StringRef& reply)
# if USE_16BIT_SPI
// Swap bytes for 16-bit SPI
- const uint32_t data = ((brightness << 5) | (0xE0 << 8)) | ((blue & 255)) | ((green & 255) << 24) | ((red & 255) << 16);
+ const uint32_t data = ((brightness & 0xF8) << 5) | (0xE0 << 8) | ((blue & 255)) | ((green & 255) << 24) | ((red & 255) << 16);
# else
- const uint32_t data = ((brightness >> 3) | 0xE0) | ((blue & 255) << 8) | ((green & 255) << 16) | ((red & 255) << 24);
+ const uint32_t data = (brightness >> 3) | 0xE0 | ((blue & 255) << 8) | ((green & 255) << 16) | ((red & 255) << 24);
# endif
return SendDotStarData(data, numLeds, following);
}