首页 > 编程语言 > 详细

用GPIO_WriteBit时产生enumerated type mixed with another type警告

时间:2015-06-28 21:35:17      阅读:8505      评论:0      收藏:0      [点我收藏+]

在keil里面写STM32程序,这样写GPIO_WriteBit(GPIOC,GPIO_Pin_9,1),编译的时候就报enumerated type mixed with another type警告,  这说明数据类型混用了,进入GPIO_WriteBit函数发现其原型是void GPIO_WriteBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, BitAction BitVal)这样的 ,BitAction这个是枚举,所以要类型转换

即把GPIO_WriteBit(GPIOC,GPIO_Pin_9,1)改为GPIO_WriteBit(GPIOC,(BitAction)GPIO_Pin_9,1)即可,再编译时,发现没有了警告

用GPIO_WriteBit时产生enumerated type mixed with another type警告

原文:http://www.cnblogs.com/baitx/p/4606112.html

(1)
(1)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!