From 17544b607ac4608f94f5168393509d422d63368b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=85=89-k?= <36470587+kxgx@users.noreply.github.com> Date: Sun, 19 Jan 2025 06:41:04 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20main.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/main.py b/bin/main.py index cc8e083..bd77e10 100644 --- a/bin/main.py +++ b/bin/main.py @@ -284,6 +284,7 @@ while True: except (OSError, Exception) as e: # 捕获你提到的异常 logging.error("发生了错误: %s", e) time.sleep(retry_interval) # 等待一段时间后重试 + continue except KeyboardInterrupt: logging.info("检测到键盘中断,正在清理并退出") epd.init() @@ -291,10 +292,11 @@ while True: epd.sleep() # 使屏幕进入休眠状态 epd2in13_V4.epdconfig.module_exit() # 清理资源 exit() +time.sleep(retry_interval) # 脚本正常结束后的清理操作 epd.init() epd.Clear(0xFF) # 清除屏幕内容 epd.sleep() # 使屏幕进入休眠状态 epd2in13_V4.epdconfig.module_exit() # 清理资源 -exit() +exit() \ No newline at end of file