ziye320122 发表于 2010-4-15 16:48

ucOS的邮箱使用

小弟刚刚接触到ucOS,有个菜鸟问题麻烦大家解决下.
在uCOS中邮箱函数:OSMboxPost(OS_EVENT *pevent,void *msg)
static voidtask( void*p_arg)
{    INT8U temp=1;
   ....//处理代码
    OSMboxPost(OS_EVENT *pevent,(void *)1 );
    ......   
}
请问这种写法(void *)1和(void *)(&temp)有没有区别,(void *)1这种写法存不存在风险?

hgjinwei 发表于 2010-4-15 19:51

(void *)1             ->    msg <= 1;
(void *)(&temp)   ->   msg<= "temp"的地址

你说有没有区别呢?
页: [1]
查看完整版本: ucOS的邮箱使用