From b2bd368b2dbb167259008319ae8c6b2187937e32 Mon Sep 17 00:00:00 2001 From: nhkefus Date: Fri, 21 Mar 2025 16:24:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8C=89=E9=94=AE=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E7=9B=B8=E5=85=B3=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TC1/http_server/app_httpd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/TC1/http_server/app_httpd.c b/TC1/http_server/app_httpd.c index 3828924..e9d6437 100644 --- a/TC1/http_server/app_httpd.c +++ b/TC1/http_server/app_httpd.c @@ -226,11 +226,11 @@ static int HttpSetButtonEvent(httpd_request_t *req) { int index; int func; int longPress; - sscanf(buf, "%d %d %d", &index, &func &longPress); - if(longPress){ - set_key_map(index, get_short_func(index), func==-1?NO_FUNCTION:func); - }else{ - set_key_map(index,func==-1?NO_FUNCTION:func, get_long_func(index)); + sscanf(buf, "%d %d %d", &index, &func, &longPress); + if (longPress) { + set_key_map(index, get_short_func(index), func == -1 ? NO_FUNCTION : func); + } else { + set_key_map(index, func == -1 ? NO_FUNCTION : func, get_long_func(index)); } mico_system_context_update(sys_config); @@ -630,7 +630,7 @@ const struct httpd_wsgi_call g_app_handlers[] = { {"/socketNames", HTTPD_HDR_DEFORT, 0, NULL, HttpSetSocketName, NULL, NULL}, {"/childLock", HTTPD_HDR_DEFORT, 0, NULL, HttpSetChildLock, NULL, NULL}, {"/deviceName", HTTPD_HDR_DEFORT, 0, NULL, HttpSetDeviceName, NULL, NULL}, - {"/buttonEvents", HTTPD_HDR_DEFORT, 0, HttpGetButtonEvents, HttpSetButtonEvent, NULL, NULL}, + {"/buttonEvents", HTTPD_HDR_DEFORT, 0, HttpGetButtonEvents, HttpSetButtonEvent, NULL, NULL}, }; static int g_app_handlers_no = sizeof(g_app_handlers) / sizeof(struct httpd_wsgi_call);