From 44ed1d260447036cf0f8808aa75cbc6c47fb8532 Mon Sep 17 00:00:00 2001 From: nhkefus Date: Tue, 18 Mar 2025 13:27:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TC1/http_server/web/index.html | 1 + TC1/mqtt_server/user_mqtt_client.c | 2 +- TC1/user_gpio.c | 12 ++++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/TC1/http_server/web/index.html b/TC1/http_server/web/index.html index 122c363..ba3eb83 100644 --- a/TC1/http_server/web/index.html +++ b/TC1/http_server/web/index.html @@ -519,6 +519,7 @@
+ 提示:长按电源按钮5s可开启热点重新配网,10s恢复出厂设置
diff --git a/TC1/mqtt_server/user_mqtt_client.c b/TC1/mqtt_server/user_mqtt_client.c index df56ae2..f886937 100644 --- a/TC1/mqtt_server/user_mqtt_client.c +++ b/TC1/mqtt_server/user_mqtt_client.c @@ -519,7 +519,7 @@ void UserMqttHassAuto(char socket_id) { "\"name\":\"TC1_%s\"," "\"model\":\"TC1\"," "\"manufacturer\":\"PHICOMM\"}}", - user_config->socket_names[socket_id], str_mac, socket_id, str_mac, socket_id, + user_config->socket_names[(int)socket_id], str_mac, socket_id, str_mac, socket_id, str_mac, socket_id, str_mac, socket_id, str_mac, str_mac); UserMqttSendTopic(topic_buf, send_buf, 1); diff --git a/TC1/user_gpio.c b/TC1/user_gpio.c index 0e88ee3..8894533 100644 --- a/TC1/user_gpio.c +++ b/TC1/user_gpio.c @@ -103,11 +103,11 @@ void UserRelaySetAll(char y) UserRelaySet(i, y); } -static void KeyLongPress(void) +static void KeyLong5sPress(void) { -// key_log("KeyLongPress"); -// UserLedSet(1); -// UserMqttSend("mqtt test"); + key_log("WARNGIN: wifi ap started!"); + sys_config->micoSystemConfig.ssid[0] = 0; + mico_system_context_update(mico_system_context_get()); } static void KeyLong10sPress(void) @@ -156,9 +156,9 @@ static void KeyTimeoutHandler(void* arg) { key_log("button long pressed:%d",key_time); - if (key_time == 30) + if (key_time == 50) { - KeyLongPress(); + KeyLong5sPress(); } else if (key_time == 100) {