mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-12 13:08:13 +08:00
主循环执行定时任务
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "mqtt_server/user_mqtt_client.h"
|
||||
#include "mqtt_server/user_function.h"
|
||||
#include "http_server/app_httpd.h"
|
||||
#include "time_task/time_task.h"
|
||||
|
||||
#define os_log(format, ...) custom_log("TC1", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__)
|
||||
|
||||
@@ -167,6 +168,14 @@ int application_start(void)
|
||||
strMac, (unsigned int)(power2 / 10), (unsigned int)(power2 % 10), (unsigned int)total_time);
|
||||
user_send(0, power_buf);
|
||||
user_mqtt_hass_power();
|
||||
|
||||
time_t now = time(NULL);
|
||||
if (now >= task_top->time)
|
||||
{
|
||||
os_log("now");
|
||||
UserRelaySet(task_top->socket_idx, task_top->on);
|
||||
DelFirstTask();
|
||||
}
|
||||
mico_thread_msleep(1000);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user