新手上路
- 积分
- 24
- 金钱
- 24
- 注册时间
- 2016-7-22
- 在线时间
- 4 小时
|

楼主 |
发表于 2016-7-25 10:32:36
|
显示全部楼层
uint8_t GPIO_ReadOutputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
{
uint8_t bitstatus = 0x00;
/* Check the parameters */
assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
assert_param(IS_GET_GPIO_PIN(GPIO_Pin));
if ((GPIOx->ODR /*& GPIO_Pin*/) != (uint32_t)Bit_RESET)
{
bitstatus = (uint8_t)Bit_SET;
}
else
{
bitstatus = (uint8_t)Bit_RESET;
}
return bitstatus;
}
这个函数我改了一下,把if判断的GPIO_Pin位于注释了,结果是对的。假设管脚是PF8,ODR=0x00000100,GPIO_Pin=0x0008,位于的结果一直为零。 |
|