From 022317d470ae6625c1c6a518d201cf5a1730f4c7 Mon Sep 17 00:00:00 2001 From: Liz Date: Mon, 11 Mar 2024 15:56:57 -0400 Subject: [PATCH 1/2] Fix color swapping during shift() This fixes the color swapping during shift() as noted in https://github.com/adafruit/Adafruit_CircuitPython_HT16K33/issues/102 --- adafruit_ht16k33/matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_ht16k33/matrix.py b/adafruit_ht16k33/matrix.py index 55a7152..37e47be 100644 --- a/adafruit_ht16k33/matrix.py +++ b/adafruit_ht16k33/matrix.py @@ -245,7 +245,7 @@ def pixel(self, x: int, y: int, color: Optional[int] = None) -> Optional[int]: super()._pixel(y, x, (color >> 1) & 0x01) super()._pixel(y + 8, x, (color & 0x01)) else: - return super()._pixel(y, x) | super()._pixel(y + 8, x) << 1 + return super()._pixel(y, x) << 1 | super()._pixel(y + 8, x) return None def fill(self, color: int) -> None: From feb08ef35e2f883a1f98ab1db713a08f0a430e87 Mon Sep 17 00:00:00 2001 From: Liz Date: Mon, 11 Mar 2024 16:00:24 -0400 Subject: [PATCH 2/2] black and lint --- adafruit_ht16k33/matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_ht16k33/matrix.py b/adafruit_ht16k33/matrix.py index 37e47be..39e2eb1 100644 --- a/adafruit_ht16k33/matrix.py +++ b/adafruit_ht16k33/matrix.py @@ -245,7 +245,7 @@ def pixel(self, x: int, y: int, color: Optional[int] = None) -> Optional[int]: super()._pixel(y, x, (color >> 1) & 0x01) super()._pixel(y + 8, x, (color & 0x01)) else: - return super()._pixel(y, x) << 1 | super()._pixel(y + 8, x) + return super()._pixel(y, x) << 1 | super()._pixel(y + 8, x) return None def fill(self, color: int) -> None: