From 16d61082929f1d4efedb26b91bd20a0d3d140d86 Mon Sep 17 00:00:00 2001 From: spdis Date: Sun, 19 Oct 2025 18:07:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D4=E5=8F=B7=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E9=87=8D=E5=A4=8D=E6=89=A7=E8=A1=8C=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo_entry_cmsis.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/demo_entry_cmsis.c b/demo_entry_cmsis.c index cdbc809..ed20e6b 100644 --- a/demo_entry_cmsis.c +++ b/demo_entry_cmsis.c @@ -335,6 +335,8 @@ static void controlTask(void *arg) printf("Displaying text: %s\r\n", g_current_command.text); DisplayMixedString(0, 0, g_current_command.text); } + + display_timer = 2; // 设置2秒计时器 } // 兼容旧命令的处理逻辑(只有在非JSON命令时才执行) else if(control_flag == 0 && g_current_command.cmd == 0) // 兼容旧命令:关闭 @@ -388,6 +390,20 @@ static void controlTask(void *arg) } } + // 处理命令4的2秒计时器 + if(control_flag == CMD_DISPLAY_ONLY && display_timer > 0) + { + display_timer--; + if(display_timer == 0) + { + printf("2 seconds elapsed, clearing screen for command 4\r\n"); + // 清屏 + OledClearScreen(); + // 重置控制标志,使其能够响应下一个命令4 + control_flag = 0; + } + } + // 兼容旧的计时逻辑 if(control_flag == 2 && g_current_command.cmd == 0) {