曙海教育集团论坛开发语言培训专区C语言开发 → 没有见过的c语言用法,求救


  共有6099人关注过本帖树形打印

主题:没有见过的c语言用法,求救

美女呀,离线,留言给我吧!
wangxinxin
  1楼 个性首页 | 博客 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:青蜂侠 帖子:1393 积分:14038 威望:0 精华:0 注册:2010-11-12 11:08:23
没有见过的c语言用法,求救  发帖心情 Post By:2010-12-10 11:39:46

//-------------------------------------------------------------------------------------
unsigned char IfInterTimeOK(tagInterTime * ptime) {
        if(ptime->ucDelay == 0) return 0;
    ptime->ucCount = (ptime->ucCount) + 1;
    if(ptime->ucCount >= ptime->ucDelay) {
            ptime->ucCount = 0;
        return 1;
    }
    return 0;
}
//-----------------------------------------------------------------
typedef struct {
        unsigned char ucDelay, ucCount;
}tagInterTime;                                                                        // Control the interface control time
unsigned char IfInterTimeOK(tagInterTime * ptime);// 1:Action OK
//---------------------------------------------------------------------------------
#define __INTERTIME_DECL(x, y)        SUBLIB_EXT tagInterTime g_it##x;  
#define __IT_START(x, y)                (g_it##x##.ucDelay = y, g_it##x##.ucCount = y)
#define __IT_STOP(x, y)                        g_it##x##.ucDelay = 0
#define __IT_OK(x, y)                        IfInterTimeOK(&g_it##x)
//------------------------------------------------------------------------------
#define IT_DECL(x)                                __INTERTIME_DECL(x)
#define IT_START(x)                                __IT_START(x)
#define IT_STOP(x)                                __IT_STOP(x)
#define IT_OK(x)                                __IT_OK(x)

#define AAA                        A, 25

下面这是用法,不知道是什么意思?
IT_START(AAA);   
if(IT_OK(AAA)) IT_START(AAA);
IT_STOP(AAA);
忘c语言高手指教一下

支持(0中立(0反对(0单帖管理 | 引用 | 回复 回到顶部

返回版面帖子列表

没有见过的c语言用法,求救








签名