Skip to content

Commit f08e364

Browse files
committed
Change the defualt value of Modify the default values of the __init__() parameters to make it compatible with the behavior of old code.
1 parent 3bf6460 commit f08e364

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

adafruit_st7789.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
from busdisplay import BusDisplay
4444

4545
try:
46-
import typing
46+
from typing import Any
4747

4848
from fourwire import FourWire
4949
except ImportError:
@@ -58,22 +58,21 @@
5858
b"\x3a\x81\x55\x0a" # _COLMOD and Delay 10ms
5959
b"\x36\x01\x08" # _MADCTL
6060
b"\x13\x80\x0a" # _NORON and Delay 10ms
61-
b"\x36\x01\xc0" # _MADCTL
6261
b"\x29\x80\xff" # _DISPON and Delay 500ms
6362
)
6463

6564

6665
# pylint: disable=too-few-public-methods
6766
class ST7789(BusDisplay):
6867
"""
69-
ST7789 driver
68+
ST7789 driver
7069
71-
:param FourWire bus: bus that the display is connected to
72-
:param bool bgr: (Optional) An extra init sequence to append (default=False)
73-
:param bool invert: (Optional) Invert the colors (default=False)
74-
"""
70+
:param FourWire bus: bus that the display is connected to
71+
:param bool bgr: (Optional) An extra init sequence to append (default=True)
72+
:param bool invert: (Optional) Invert the colors (default=True)
73+
"""
7574

76-
def __init__(self, bus: FourWire, *, bgr: bool = False, invert: bool = False, **kwargs: Any):
75+
def __init__(self, bus: FourWire, *, bgr: bool = True, invert: bool = True, **kwargs: Any):
7776
init_sequence = _INIT_SEQUENCE
7877
if bgr:
7978
init_sequence += b"\x36\x01\xc0" # _MADCTL Default rotation plus BGR encoding

0 commit comments

Comments
 (0)