Skip to content

Commit c052914

Browse files
committed
tweak for sphinx
1 parent 4d861e6 commit c052914

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

adafruit_rgb_display/rgb.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"""
3030

3131
import time
32-
from micropython import const
3332
try:
3433
import struct
3534
except ImportError:
@@ -47,13 +46,14 @@
4746
import platform
4847
if "CPython" in platform.python_implementation():
4948
# check for FT232H special case
50-
import os
51-
if os.environ['BLINKA_FT232H']:
52-
# we are limited by pyftdi's max SPI payload
53-
from pyftdi.spi import SpiController
54-
_BUFFER_SIZE = SpiController.PAYLOAD_MAX_LENGTH // 2 # max bytes / bytes per pixel
55-
else:
56-
# set it to blit the whole thing
49+
try:
50+
import os
51+
if os.environ['BLINKA_FT232H']:
52+
# we are limited by pyftdi's max SPI payload
53+
from pyftdi.spi import SpiController
54+
_BUFFER_SIZE = SpiController.PAYLOAD_MAX_LENGTH // 2 # max bytes / bytes per pixel
55+
except KeyError:
56+
# otherwise set it to blit the whole thing
5757
_BUFFER_SIZE = 320 * 240
5858
else:
5959
# in case CircuitPython ever implements platform
@@ -211,7 +211,6 @@ def fill_rectangle(self, x, y, width, height, color):
211211
pixel = self._encode_pixel(color)
212212
if chunks:
213213
data = pixel * _BUFFER_SIZE
214-
print(pixel, len(data))
215214
for _ in range(chunks):
216215
self.write(None, data)
217216
self.write(None, pixel * rest)

0 commit comments

Comments
 (0)