Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@
SIZE_3_5_INCH = "3.5\""
SIZE_5_INCH = "5\""
SIZE_8_8_INCH = "8.8\""
SIZE_8_8_INCH_USB = "8.8\" (V1.1)"
SIZE_2_1_INCH = "2.1\"" # Only for retro compatibility
SIZE_2_x_INCH = "2.1\" / 2.8\""
SIZE_0_96_INCH = "0.96\""

size_list = (SIZE_0_96_INCH, SIZE_2_x_INCH, SIZE_3_5_INCH, SIZE_5_INCH, SIZE_8_8_INCH)
size_list = (SIZE_0_96_INCH, SIZE_2_x_INCH, SIZE_3_5_INCH, SIZE_5_INCH, SIZE_8_8_INCH, SIZE_8_8_INCH_USB)

# Maps between config.yaml values and GUI description
revision_and_size_to_model_map = {
Expand All @@ -80,6 +81,7 @@
('C', SIZE_2_x_INCH): TURING_MODEL,
('C', SIZE_5_INCH): TURING_MODEL,
('C', SIZE_8_8_INCH): TURING_MODEL,
('C_USB', SIZE_8_8_INCH_USB): TURING_MODEL,
('D', SIZE_3_5_INCH): KIPYE_MODEL,
('WEACT_A', SIZE_3_5_INCH): WEACT_MODEL,
('WEACT_B', SIZE_0_96_INCH): WEACT_MODEL,
Expand All @@ -97,6 +99,7 @@
(TURING_MODEL, SIZE_2_x_INCH): 'C',
(TURING_MODEL, SIZE_5_INCH): 'C',
(TURING_MODEL, SIZE_8_8_INCH): 'C',
(TURING_MODEL, SIZE_8_8_INCH_USB): 'C_USB',
(KIPYE_MODEL, SIZE_3_5_INCH): 'D',
(WEACT_MODEL, SIZE_3_5_INCH): 'WEACT_A',
(WEACT_MODEL, SIZE_0_96_INCH): 'WEACT_B',
Expand Down Expand Up @@ -383,6 +386,8 @@ def load_config_values(self):
size = get_theme_size(self.config['config']['THEME'])
size = size.replace(SIZE_2_1_INCH, SIZE_2_x_INCH) # If a theme is for 2.1" then it also is for 2.8"
try:
if size == SIZE_8_8_INCH and self.config['display']['REVISION'] == 'C_USB':
size = SIZE_8_8_INCH_USB
self.size_cb.set(size)
except:
self.size_cb.current(0)
Expand Down
4 changes: 4 additions & 0 deletions library/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from library.lcd.lcd_comm_rev_a import LcdCommRevA
from library.lcd.lcd_comm_rev_b import LcdCommRevB
from library.lcd.lcd_comm_rev_c import LcdCommRevC
from library.lcd.lcd_comm_rev_c_usb import LcdCommRevCUSB
from library.lcd.lcd_comm_rev_d import LcdCommRevD
from library.lcd.lcd_comm_weact_a import LcdCommWeActA
from library.lcd.lcd_comm_weact_b import LcdCommWeActB
Expand Down Expand Up @@ -85,6 +86,9 @@ def __init__(self):
# Because of issue with Turing rev. C size auto-detection, manually configure screen width/height from theme
self.lcd = LcdCommRevC(com_port=config.CONFIG_DATA['config']['COM_PORT'],
update_queue=config.update_queue, display_width=width, display_height=height)
elif config.CONFIG_DATA["display"]["REVISION"] == "C_USB":
# Because of issue with Turing rev. C size auto-detection, manually configure screen width/height from theme
self.lcd = LcdCommRevCUSB(display_width=width, display_height=height)
elif config.CONFIG_DATA["display"]["REVISION"] == "D":
self.lcd = LcdCommRevD(com_port=config.CONFIG_DATA['config']['COM_PORT'],
update_queue=config.update_queue)
Expand Down
Loading
Loading