Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #6 from AntonKast/master

Adafruit_WS2801.getPixelColor() suffers overflow
  • Loading branch information...
commit 2fd0b33491087852cd2ed20b38f17e4267e62138 2 parents 2a058b0 + d221943
@ladyada ladyada authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  Adafruit_WS2801.cpp
View
2  Adafruit_WS2801.cpp
@@ -187,7 +187,7 @@ uint32_t Adafruit_WS2801::getPixelColor(uint16_t n) {
// types. For compatibility with existing code, 'packed' RGB
// values passed in or out are always 0xRRGGBB order.
return (rgb_order == WS2801_RGB) ?
- ((uint32_t)pixels[ofs] << 16) | (pixels[ofs + 1] << 8) | pixels[ofs + 2] :
+ ((uint32_t)pixels[ofs] << 16) | ((uint16_t) pixels[ofs + 1] << 8) | pixels[ofs + 2] :
(pixels[ofs] << 8) | ((uint32_t)pixels[ofs + 1] << 16) | pixels[ofs + 2];
}
Please sign in to comment.
Something went wrong with that request. Please try again.