在STM32F103RCT6中用状态机的方法加按键,但是在一段函数中不想让按键起到效果
[复制链接]
#define READ_CHILD_KEY_VALUE (GPIO_ReadInputDataBit(GPIOA, GPIO_Pin_0))
#define READ_HOT_KEY_VALUE (GPIO_ReadInputDataBit(GPIOA, GPIO_Pin_1))
#define READ_COLD_KEY_VALUE (GPIO_ReadInputDataBit(GPIOA, GPIO_Pin_2))
#define READ_VDD_VOL_VALUE (GPIO_ReadInputDataBit(GPIOC, GPIO_Pin_1))
#define READ_LEAK_WATER_VALUE (GPIO_ReadInputDataBit(GPIOC, GPIO_Pin_2))
static char shot=0;// status hot
static char scold= 0;//status cold
static char child = 0;//童锁
/*让按键"失效"*/
if((READ_HOT_KEY_VALUE == 1) || (READ_COLD_KEY_VALUE == 1) || (READ_CHILD_KEY_VALUE == 1))
{
child = shot = scold = 0;
}
/**************/
我在if中的做法似乎不行
|