#include "includes.h"
#include "YuYin_Driver.h"
OS_EVENT *MSBOX_AppTaskUaset1;//定义事件主动上送
unsigned short XHJ_Connect_Flag = 0;
unsigned int SendCount;
void Task_Uaset1(void* p_arg)
{
OS_CPU_SR cpu_sr;
INT8U err;
unsigned int i,j;
unsigned char *p;
static unsigned char *pMSBOX_AppTaskUsart;
static unsigned short Length;
static unsigned short Usart_Timer1 = 2000;//2S
static unsigned short GetXHJAddrCount = 0;
unsigned char kind;
unsigned char data;
unsigned char *pData;
unsigned char temp;
unsigned int count;
Addr Addr_Temp;
(void) p_arg;
//创建USART接收邮箱
MSBOX_AppTaskUaset1 = OSMboxCreate(0);
while (1)
{
// YuYin_Sound(2);
// OSTimeDlyHMSM(0, 0, 3, 0);
pMSBOX_AppTaskUsart = OSMboxPend(MSBOX_AppTaskUaset1,Usart_Timer1,&err); //等待消息的到来.并将此消息给SS这个指针
if(err == OS_NO_ERR) //无错处理
{
OSTimeDlyHMSM(0, 0, 5, 0);
}
if(YYuYin_BL.YuYintask==1) //倒计时开始
{
switch(YYuYin_BL.YuYin)
{
case 0 :
YuYin_Sound(Sound_Stage_R); //红灯请留步
OSTimeDlyHMSM(0, 0, 3, 0);
break;
case 1 :
if(YYuYin_BL.YuYin_G_FLAG==1)
{
YuYin_Sound(Sound_Stage_G); //绿灯通行
OSTimeDlyHMSM(0, 0, 3, 0);
YYuYin_BL.YuYin_G_FLAG=0;
}
else
{
YuYin_Sound(Sound_Stage_G_D); //绿灯1s滴一次
OSTimeDlyHMSM(0, 0, 3, 0);
}
break;
case 2 :
YYuYin_BL.YuYin_G_FLAG=1;
YuYin_Sound(Sound_Stage_G_D_D); //绿灯1s滴两次
OSTimeDlyHMSM(0, 0, 3, 0);
break;
case 3 :
YuYin_Sound(Sound_Stage_R_TZ); //红灯越过停止线
OSTimeDlyHMSM(0, 0, 3, 0);
break;
case 4 :
YuYin_Sound(Sound_Stage_L_YL); //红灯越过停止线
OSTimeDlyHMSM(0, 0, 3, 0);
break;
case 5 :
YuYin_Sound(Sound_Stage_H_YL); //红灯越过停止线
OSTimeDlyHMSM(0, 0, 3, 0);
break;
} |