Skip to content

Commit 52c2d4c

Browse files
committed
Support Turing Smart Display 8.8" V1.1
1 parent 455af08 commit 52c2d4c

File tree

3 files changed

+355
-1
lines changed

3 files changed

+355
-1
lines changed

configure.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@
6666
SIZE_3_5_INCH = "3.5\""
6767
SIZE_5_INCH = "5\""
6868
SIZE_8_8_INCH = "8.8\""
69+
SIZE_8_8_INCH_USB = "8.8\" (V1.1)"
6970
SIZE_2_1_INCH = "2.1\""
7071

71-
size_list = (SIZE_2_1_INCH, SIZE_3_5_INCH, SIZE_5_INCH, SIZE_8_8_INCH)
72+
size_list = (SIZE_2_1_INCH, SIZE_3_5_INCH, SIZE_5_INCH, SIZE_8_8_INCH, SIZE_8_8_INCH_USB)
7273

7374
# Maps between config.yaml values and GUI description
7475
revision_and_size_to_model_map = {
@@ -78,6 +79,7 @@
7879
('C', SIZE_2_1_INCH): TURING_MODEL,
7980
('C', SIZE_5_INCH): TURING_MODEL,
8081
('C', SIZE_8_8_INCH): TURING_MODEL,
82+
('C_USB', SIZE_8_8_INCH_USB): TURING_MODEL,
8183
('D', SIZE_3_5_INCH): KIPYE_MODEL,
8284
('SIMU', SIZE_2_1_INCH): SIMULATED_MODEL,
8385
('SIMU', SIZE_3_5_INCH): SIMULATED_MODEL,
@@ -92,6 +94,7 @@
9294
(TURING_MODEL, SIZE_2_1_INCH): 'C',
9395
(TURING_MODEL, SIZE_5_INCH): 'C',
9496
(TURING_MODEL, SIZE_8_8_INCH): 'C',
97+
(TURING_MODEL, SIZE_8_8_INCH_USB): 'C_USB',
9598
(KIPYE_MODEL, SIZE_3_5_INCH): 'D',
9699
(SIMULATED_MODEL, SIZE_2_1_INCH): 'SIMU',
97100
(SIMULATED_MODEL, SIZE_3_5_INCH): 'SIMU',
@@ -133,6 +136,7 @@ def get_theme_data(name: str):
133136

134137

135138
def get_themes(size: str):
139+
size = size.split('"')[0] + '"'
136140
themes = []
137141
for filename in os.listdir(THEMES_DIR):
138142
theme_data = get_theme_data(filename)
@@ -374,6 +378,8 @@ def load_config_values(self):
374378
# Guess display size from theme in the configuration
375379
size = get_theme_size(self.config['config']['THEME'])
376380
try:
381+
if size == SIZE_8_8_INCH and self.config['display']['REVISION'] == 'C_USB':
382+
size = SIZE_8_8_INCH_USB
377383
self.size_cb.set(size)
378384
except:
379385
self.size_cb.current(0)

library/display.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from library.lcd.lcd_comm_rev_a import LcdCommRevA
2222
from library.lcd.lcd_comm_rev_b import LcdCommRevB
2323
from library.lcd.lcd_comm_rev_c import LcdCommRevC
24+
from library.lcd.lcd_comm_rev_c_usb import LcdCommRevCUSB
2425
from library.lcd.lcd_comm_rev_d import LcdCommRevD
2526
from library.lcd.lcd_simulated import LcdSimulated
2627
from library.log import logger
@@ -79,6 +80,9 @@ def __init__(self):
7980
# Because of issue with Turing rev. C size auto-detection, manually configure screen width/height from theme
8081
self.lcd = LcdCommRevC(com_port=config.CONFIG_DATA['config']['COM_PORT'],
8182
update_queue=config.update_queue, display_width=width, display_height=height)
83+
elif config.CONFIG_DATA["display"]["REVISION"] == "C_USB":
84+
# Because of issue with Turing rev. C size auto-detection, manually configure screen width/height from theme
85+
self.lcd = LcdCommRevCUSB(display_width=width, display_height=height)
8286
elif config.CONFIG_DATA["display"]["REVISION"] == "D":
8387
self.lcd = LcdCommRevD(com_port=config.CONFIG_DATA['config']['COM_PORT'],
8488
update_queue=config.update_queue)

0 commit comments

Comments
 (0)