Question
Counting up from GPIO READ
Hi,all:
I wrote a code for counting up when GPIO ReadPin change high level to low, here is the code:
while(1)
{
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, GPIO_PIN_SET);
if(HAL_GPIO_ReadPin(GPIOE,GPIO_PIN_10)==1)
{
HAL_Delay(1);
if(HAL_GPIO_ReadPin(GPIOE,GPIO_PIN_10)==0)
{
cnt=cnt+1;
}
}
if(cnt==3)
{
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, GPIO_PIN_RESET);
break;
}
}
It's work, but...
did it has any way to remove "HAL_Delay()", and make it work also?
I'm worried that it will affect the operation of other functions...
