Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

错误报告 #8

Open
Mountain03 opened this issue Jul 8, 2020 · 0 comments
Open

错误报告 #8

Mountain03 opened this issue Jul 8, 2020 · 0 comments

Comments

@Mountain03
Copy link

uint8_t Button_State :4 ; /* 按键当前状态(按下还是弹起) /
uint8_t Button_Last_State :4 ; /
上一次的按键状态,用于判断双击 /
uint8_t Button_Trigger_Level :2 ; /
按键触发电平 /
uint8_t Button_Last_Level :2 ; /
按键当前电平 */
环境:IAR,stm8,实测,这几个的位域操作与stm8的io电平读取返回函数冲突,
return ((BitStatus)(GPIOx->IDR & (uint8_t)GPIO_Pin));
这个返回值为bool类型的值实际上是对应的uint8_t值,在高位引脚的时候导致Button_Last_Level ,Button_Trigger_Level ,无论如何不能等于io返回值,导致一直报错,望楼主把4个状态位改为bool类型,或去掉后边的位域操作符。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant