报警关阀
This commit is contained in:
parent
1a2a8c7660
commit
1ef1ac80e7
|
@ -345,7 +345,10 @@ int main(void)
|
||||||
Flash_Write_Record(kRecordAlarm); // 写入flash报警信息
|
Flash_Write_Record(kRecordAlarm); // 写入flash报警信息
|
||||||
if (Flash_Get_Valve_Num())
|
if (Flash_Get_Valve_Num())
|
||||||
{
|
{
|
||||||
Bt_Valve_Handler(kValveCmdCtr, 0, RT_NULL);
|
// Bt_Valve_Handler(kValveCmdCtr, 0, RT_NULL);
|
||||||
|
rt_uint8_t mac_addr[6];
|
||||||
|
Flash_Get_Mac_Addr(mac_addr, 1);
|
||||||
|
Bt_Valve_Handler(kValveCmdCtr, 1, mac_addr);
|
||||||
if (rt_sem_take(&bt_ctr_sem, 10000) == RT_EOK)
|
if (rt_sem_take(&bt_ctr_sem, 10000) == RT_EOK)
|
||||||
{
|
{
|
||||||
LOG_D("电磁阀动作完成");
|
LOG_D("电磁阀动作完成");
|
||||||
|
|
|
@ -56,7 +56,7 @@ static void _CommonBtnEvtCb(void *arg)
|
||||||
{
|
{
|
||||||
Send_Laser_Alarm_Event(kSelfCheckEvent);
|
Send_Laser_Alarm_Event(kSelfCheckEvent);
|
||||||
}
|
}
|
||||||
if ((flex_button_event_read(&user_button[USER_BUTTON_0]) == FLEX_BTN_PRESS_LONG_HOLD) || (flex_button_event_read(&user_button[USER_BUTTON_1]) == FLEX_BTN_PRESS_LONG_HOLD))
|
else if ((flex_button_event_read(&user_button[USER_BUTTON_0]) == FLEX_BTN_PRESS_LONG_HOLD) || (flex_button_event_read(&user_button[USER_BUTTON_1]) == FLEX_BTN_PRESS_LONG_HOLD))
|
||||||
{
|
{
|
||||||
LOG_I("本地清除阀门信息");
|
LOG_I("本地清除阀门信息");
|
||||||
rt_uint8_t mac_addr[6] = {0};
|
rt_uint8_t mac_addr[6] = {0};
|
||||||
|
@ -85,7 +85,7 @@ static void _CommonBtnEvtCb(void *arg)
|
||||||
LOG_I("本地清除阀门信息成功");
|
LOG_I("本地清除阀门信息成功");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if 1 // 测试LED灯状态用,测试完成后关闭
|
#if 0 // 测试LED灯状态用,测试完成后关闭
|
||||||
if ((flex_button_event_read(&user_button[USER_BUTTON_0]) == FLEX_BTN_PRESS_DOUBLE_CLICK) || (flex_button_event_read(&user_button[USER_BUTTON_1]) == FLEX_BTN_PRESS_DOUBLE_CLICK))
|
if ((flex_button_event_read(&user_button[USER_BUTTON_0]) == FLEX_BTN_PRESS_DOUBLE_CLICK) || (flex_button_event_read(&user_button[USER_BUTTON_1]) == FLEX_BTN_PRESS_DOUBLE_CLICK))
|
||||||
{
|
{
|
||||||
button_cnt++;
|
button_cnt++;
|
||||||
|
|
|
@ -52,7 +52,7 @@ static void BSP_Led_thread_entry(void *param)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if ((SysControl.status == kNormalDetectionEvents)||(SysControl.status == KMuteEvent))
|
if (SysControl.status == kNormalDetectionEvents)
|
||||||
{
|
{
|
||||||
if ((ml307_conncet_tcp_flag))
|
if ((ml307_conncet_tcp_flag))
|
||||||
{
|
{
|
||||||
|
@ -63,11 +63,24 @@ static void BSP_Led_thread_entry(void *param)
|
||||||
LED_G_INTERNET;
|
LED_G_INTERNET;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (SysControl.status == KMuteEvent)
|
||||||
|
{
|
||||||
|
if (SysControl.last_status == kNormalDetectionEvents)
|
||||||
|
{
|
||||||
|
if ((ml307_conncet_tcp_flag))
|
||||||
|
{
|
||||||
|
LED_G_NORMAL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LED_G_INTERNET;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
rt_thread_mdelay(1000);
|
rt_thread_mdelay(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int BSP_LED_Init(void)
|
int BSP_LED_Init(void)
|
||||||
{
|
{
|
||||||
led_r = agile_led_create(LED_R_PIN, PIN_LOW, "100,100", 0);
|
led_r = agile_led_create(LED_R_PIN, PIN_LOW, "100,100", 0);
|
||||||
|
|
Loading…
Reference in New Issue