From f0c3f24577105928c902fa0a96f867d6aaf01030 Mon Sep 17 00:00:00 2001 From: zogodo <742782908@qq.com> Date: Mon, 17 Feb 2020 18:07:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=98=E4=BB=A5=E4=B8=BA=E8=A7=81=E9=AC=BC?= =?UTF-8?q?=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TC1/main.h | 2 +- TC1/mqtt_server/user_mqtt_client.c | 24 ++++++------------------ 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/TC1/main.h b/TC1/main.h index b3d4582..9b98628 100644 --- a/TC1/main.h +++ b/TC1/main.h @@ -4,7 +4,7 @@ #include "mico.h" #include "micokit_ext.h" -#define VERSION "v1.0.9" +#define VERSION "v1.0.11" #define TYPE 1 #define TYPE_NAME "zTC1" diff --git a/TC1/mqtt_server/user_mqtt_client.c b/TC1/mqtt_server/user_mqtt_client.c index b3a42e9..9db5d2e 100644 --- a/TC1/mqtt_server/user_mqtt_client.c +++ b/TC1/mqtt_server/user_mqtt_client.c @@ -69,38 +69,26 @@ void UserMqttTimerFunc(void *arg) mico_stop_timer(&timer_handle); return; } - if (mico_rtos_is_queue_empty(&mqtt_msg_send_queue) == true) + if (mico_rtos_is_queue_empty(&mqtt_msg_send_queue)) { - timer_status++; switch (timer_status) { + case 0: case 1: - UserMqttHassAutoPower(); - break; case 2: case 3: case 4: case 5: + UserMqttHassAuto(timer_status); + break; case 6: - case 7: - UserMqttHassAuto(timer_status - 2); - break; - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - UserMqttHassAuto(timer_status - 8); - break; - case 14: - break; - case 15: + UserMqttHassAutoPower(); break; default: mico_stop_timer(&timer_handle); break; } + timer_status++; } }