2024-05-31
This commit is contained in:
1 parent
f8591b8b99
commit
4a963bd78c
27 files changed
+2956
-229
No files matched your search
@@ -12,6 +12,7 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "mqtt-board.h"
|
||||
#include "relay-board.h"
|
||||
#include "data.h"
|
||||
uint32_t os_timer_count = 1;
|
||||
|
||||
@@ -38,7 +39,7 @@ static rt_timer_t locktimer;
|
||||
static void locktimerouter (void* parameter)
|
||||
{
|
||||
// todo 关闭定时器
|
||||
HAL_GPIO_WritePin (LOCK_GPIO_Port, LOCK_Pin, GPIO_PIN_RESET);
|
||||
MX_Relay_Push(RELAYDoor,RELAY_DISC);
|
||||
}
|
||||
|
||||
static void thread_entry (void *parameter)
|
||||
@@ -68,6 +69,7 @@ static void thread_entry (void *parameter)
|
||||
//gCommEvents = rt_event_create ("gCommEvents", RT_IPC_FLAG_FIFO) ;
|
||||
|
||||
locktimer = rt_timer_create ("locktimer", locktimerouter, RT_NULL, 1000, RT_TIMER_FLAG_ONE_SHOT); // 异常检测定时器
|
||||
RtcThreadStart ();
|
||||
SluiceThreadStart(); // 闸门控制线程
|
||||
U4851ThreadStart(); // 4851采集线程
|
||||
U4852ThreadStart(); // 4852采集线程
|
||||
@@ -89,7 +91,7 @@ static void thread_entry (void *parameter)
|
||||
if (RT_EOK == rt_event_recv (gCtrlEvents, EVENT_CTRL_SET_UNLOCK, RT_EVENT_FLAG_AND | RT_EVENT_FLAG_CLEAR, 2000, RT_NULL)) // 数据接受失败,上报异常状态
|
||||
{
|
||||
// todo: 打开继电器,开启定时器
|
||||
HAL_GPIO_WritePin (LOCK_GPIO_Port, LOCK_Pin, GPIO_PIN_SET);
|
||||
MX_Relay_Push(RELAYDoor,RELAY_CONN);
|
||||
rt_timer_start (locktimer);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user