Skip to content

Commit a3a375d

Browse files
authored
Merge pull request #995 from OctaNebula/add-2.8-round-usb-support
Add support for 2.8" round TURZX USB display (PID 0x0028)
2 parents 45d484d + 9a58ccb commit a3a375d

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

configure.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@
7777
SIZE_8_8_INCH = "8.8\""
7878
SIZE_8_8_INCH_NEWREV = "8.8\" / 9.2\" (V1.X new HW rev.)"
7979
SIZE_12_3_INCH = "12.3\""
80+
SIZE_2_8_INCH_NEWREV = "2.8\" round (V1.X new HW rev.)"
8081

8182
# List of sizes that can be selected
8283
size_list = (
8384
SIZE_0_96_INCH,
8485
SIZE_2_x_INCH,
86+
SIZE_2_8_ROUND_USB,
8587
SIZE_3_5_INCH,
8688
SIZE_4_6_INCH,
8789
SIZE_5_INCH,
@@ -108,6 +110,7 @@
108110
('TUR_USB', SIZE_8_8_INCH): TURING_MODEL,
109111
('TUR_USB', SIZE_8_8_INCH_NEWREV): TURING_MODEL,
110112
('TUR_USB', SIZE_12_3_INCH): TURING_MODEL,
113+
('TUR_USB', SIZE_2_8_ROUND_USB): TURING_MODEL,
111114
('WEACT_A', SIZE_3_5_INCH): WEACT_MODEL,
112115
('WEACT_B', SIZE_0_96_INCH): WEACT_MODEL,
113116

@@ -132,6 +135,7 @@
132135
(TURING_MODEL, SIZE_8_8_INCH): 'C',
133136
(TURING_MODEL, SIZE_8_8_INCH_NEWREV): 'TUR_USB',
134137
(TURING_MODEL, SIZE_12_3_INCH): 'TUR_USB',
138+
(TURING_MODEL, SIZE_2_8_ROUND_USB): 'TUR_USB',
135139
(USBPCMONITOR_MODEL, SIZE_3_5_INCH): 'A',
136140
(USBPCMONITOR_MODEL, SIZE_5_INCH): 'A',
137141
(WEACT_MODEL, SIZE_0_96_INCH): 'WEACT_B',
@@ -462,13 +466,15 @@ def load_config_values(self):
462466

463467
# Guess display size from theme in the configuration
464468
size = get_theme_size(self.config['config']['THEME'])
465-
size = size.replace(_SIZE_2_1_INCH, SIZE_2_x_INCH) # If a theme is for 2.1" then it is for all 2.x"
466-
size = size.replace(_SIZE_2_8_INCH, SIZE_2_x_INCH) # If a theme is for 2.8" then it is for all 2.x"
467-
size = size.replace(_SIZE_9_2_INCH,
468-
SIZE_8_8_INCH_NEWREV) # If a theme is for 9.2" then it is for 8.8"/9.2" (new rev)
469+
if size == _SIZE_2_1_INCH or size == _SIZE_2_8_INCH:
470+
size = SIZE_2_x_INCH # If a theme is for 2.1" or 2.8" then it is for all 2.x"
471+
elif size == _SIZE_9_2_INCH:
472+
size = SIZE_8_8_INCH_NEWREV # If a theme is for 9.2" then it is for 8.8"/9.2" (new rev)
469473
try:
470474
if size == SIZE_8_8_INCH and self.config['display']['REVISION'] == 'TUR_USB':
471475
size = SIZE_8_8_INCH_NEWREV
476+
if size == SIZE_2_x_INCH and self.config['display']['REVISION'] == 'TUR_USB':
477+
size = SIZE_2_8_ROUND_USB
472478
self.size_cb.set(size)
473479
except:
474480
self.size_cb.current(0)
@@ -616,7 +622,7 @@ def on_size_change(self, e=None):
616622
size = self.size_cb.get()
617623

618624
# For '2.1" / 2.8"' size, search for themes of both sizes
619-
if size == SIZE_2_x_INCH:
625+
if size == SIZE_2_x_INCH or size == SIZE_2_8_ROUND_USB:
620626
themes = get_themes(_SIZE_2_1_INCH)
621627
themes += get_themes(_SIZE_2_8_INCH)
622628
# For 8.8" & 9.2" sizes, search for themes of both sizes

library/lcd/lcd_comm_turing_usb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
VENDOR_ID = 0x1cbe
4242

4343
# Map of display supported product IDs and their respective resolution in portrait mode
44-
PRODUCT_ID = {0x0046: (320, 960), # Turing 4.6"
44+
PRODUCT_ID = {0x0028: (480, 480), # Turing 2.8" round (USB)
45+
0x0046: (320, 960), # Turing 4.6"
4546
0x0050: (720, 1280), # Turing 5.2"
4647
0x0080: (800, 1280), # Turing 8.0"
4748
0x0088: (480, 1920), # Turing 8.8"

0 commit comments

Comments
 (0)