Skip to content

Commit 871e98d

Browse files
committed
Add error message when COM port auto-discovery fails, remove redundant
log
1 parent e8897c1 commit 871e98d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

library/lcd_comm.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import os
12
import queue
3+
import sys
24
import threading
35
from abc import ABC, abstractmethod
46
from enum import IntEnum
@@ -55,8 +57,14 @@ def get_height(self) -> int:
5557
def openSerial(self):
5658
if self.com_port == 'AUTO':
5759
lcd_com_port = self.auto_detect_com_port()
58-
self.lcd_serial = serial.Serial(lcd_com_port, 115200, timeout=1, rtscts=1)
60+
if not lcd_com_port:
61+
logger.error("Cannot find COM port automatically, please set it manually in config.yaml")
62+
try:
63+
sys.exit(0)
64+
except:
65+
os._exit(0)
5966
logger.debug(f"Auto detected COM port: {lcd_com_port}")
67+
self.lcd_serial = serial.Serial(lcd_com_port, 115200, timeout=1, rtscts=1)
6068
else:
6169
lcd_com_port = self.com_port
6270
logger.debug(f"Static COM port: {lcd_com_port}")

library/stats.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@ def is_available():
350350
if pyamdgpuinfo and pyamdgpuinfo.detect_gpus() > 0:
351351
return True
352352
elif pyadl and len(pyadl.ADLManager.getInstance().getDevices()) > 0:
353-
logger.warning("Your GPU memory size/usage stats are not supported yet")
354353
return True
355354
else:
356355
return False

0 commit comments

Comments
 (0)