Skip to content

Commit

Permalink
remove ft232h stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
caternuson committed Sep 26, 2019
1 parent 87bf59c commit a6ee5a9
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions adafruit_rgb_display/rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,13 @@

# This is the size of the buffer to be used for fill operations, in 16-bit
# units.
_BUFFER_SIZE = 256
try:
# If we're on CPython, try to set as large as possible
import platform
if "CPython" in platform.python_implementation():
# check for FT232H special case
try:
import os
if os.environ['BLINKA_FT232H']:
# we are limited by pyftdi's max SPI payload
from pyftdi.spi import SpiController
_BUFFER_SIZE = SpiController.PAYLOAD_MAX_LENGTH // 2 # max bytes / bytes per pixel
except KeyError:
# otherwise set it to blit the whole thing
_BUFFER_SIZE = 320 * 240
else:
# in case CircuitPython ever implements platform
_BUFFER_SIZE = 256
_BUFFER_SIZE = 320 * 240 # blit the whole thing
except ImportError:
# Otherwise set smaller MCU friendly size
_BUFFER_SIZE = 256
pass

def color565(r, g=0, b=0):
"""Convert red, green and blue values (0-255) into a 16-bit 565 encoding. As
Expand Down

0 comments on commit a6ee5a9

Please sign in to comment.