[ARM程序分析与设计] 初学者请高手分析一下程序啊

[复制链接]
3264|0
 楼主| gaogao0730 发表于 2009-9-11 14:34 | 显示全部楼层 |阅读模式
void Smokesensor_alarm(int sig)
    {   char *psmoke;
        int ret,i;  int j = 0;  
   #if !USE_ALM
       intflag=get_alarm_io();
#else if
intflag = (1<<6);   //set intflag use alarm happen
printf("intflag in smokesensor_alarm is %d\n", intflag);
  alarm(10);

#endif

    }

void sig_init()
sensor    //  signal(SIGPIPE, alarm_handler);
    //   signal(SIGINT, exit_app);
    sigact_smokesensor.sa_handler = Smokesensor_alarm;  
    sigemptyset(&sigact_smokesensor.sa_mask);      
    sigaddset(&sigact_smokesensor.sa_mask,SIGUSR2);     
    sigact_smokesensor.sa_flags=0;         
    if(sigaction(SIGUSR2,&sigact_smokesensor,NULL)<0)        
        printf("Install smokesensor_alarm Signal Action Error");   
#if USE_ALM
signal (SIGALRM, Smokesensor_alarm);
alarm (5);
#endif
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

17

主题

26

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部