Skip to content

Commit 1f41e53

Browse files
committed
Follow-up changes based on PR #892
1 parent 2a3effc commit 1f41e53

4 files changed

Lines changed: 11 additions & 5 deletions

File tree

library/lcd/lcd_comm_turing_usb.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
from library.lcd.lcd_comm import Orientation, LcdComm
3838

3939
VENDOR_ID = 0x1cbe
40-
PRODUCT_ID = 0x0088
40+
PRODUCT_ID = [0x0088, 0x0092] # 8.8", 9.2"
4141

4242

4343
MAX_CHUNK_BYTES = 1024*1024 # Data sent to screen cannot exceed 1024MB or there will be a timeout
@@ -71,9 +71,11 @@ def encrypt_command_packet(data: bytearray) -> bytearray:
7171

7272

7373
def find_usb_device():
74-
dev = usb.core.find(idVendor=VENDOR_ID, idProduct=PRODUCT_ID)
74+
for pid in PRODUCT_ID:
75+
dev = usb.core.find(idVendor=VENDOR_ID, idProduct=pid)
7576
if dev is None:
76-
raise ValueError('USB device not found')
77+
raise ValueError(f'USB device not found')
78+
7779

7880
try:
7981
dev.set_configuration()
1.54 MB
Loading
284 KB
Loading

simple-program.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from library.lcd.lcd_comm_rev_b import LcdCommRevB
3636
from library.lcd.lcd_comm_rev_c import LcdCommRevC
3737
from library.lcd.lcd_comm_rev_d import LcdCommRevD
38+
from library.lcd.lcd_comm_turing_usb import LcdCommTuringUSB
3839
from library.lcd.lcd_comm_weact_a import LcdCommWeActA
3940
from library.lcd.lcd_comm_weact_b import LcdCommWeActB
4041
from library.lcd.lcd_simulated import LcdSimulated
@@ -52,15 +53,15 @@
5253
# - D for Kipye Qiye Smart Display 3.5"
5354
# - SIMU for simulated display (image written in screencap.png)
5455
# To identify your smart screen: https://github.com/mathoudebine/turing-smart-screen-python/wiki/Hardware-revisions
55-
REVISION = "A"
56+
REVISION = "USB_C"
5657

5758
# Display width & height in pixels for portrait orientation
5859
# /!\ Do not switch width/height here for landscape, use lcd_comm.SetOrientation below
5960
# 320x480 for 3.5" models
6061
# 480x480 for 2.1" models
6162
# 480x800 for 5" models
6263
# 480x1920 for 8.8" models
63-
WIDTH, HEIGHT = 320, 480
64+
WIDTH, HEIGHT = 480, 1920
6465

6566
assert WIDTH <= HEIGHT, "Indicate display width/height for PORTRAIT orientation: width <= height"
6667

@@ -101,6 +102,9 @@ def sighandler(signum, frame):
101102
elif REVISION == "WEACT_B":
102103
logger.info("Selected Hardware WeAct Studio Display FS V1 0.96\"")
103104
lcd_comm = LcdCommWeActB(com_port=COM_PORT, display_width=WIDTH, display_height=HEIGHT)
105+
elif REVISION == "USB_C":
106+
logger.info("Selected Hardware Revision USB C (Turing Smart Screen 8.8\" or 9.2\")")
107+
lcd_comm = LcdCommTuringUSB(com_port=COM_PORT, display_width=WIDTH, display_height=HEIGHT)
104108
elif REVISION == "SIMU":
105109
logger.info("Selected Simulated LCD")
106110
lcd_comm = LcdSimulated(display_width=WIDTH, display_height=HEIGHT)

0 commit comments

Comments
 (0)