//----------------------------------------------------------------------- void systick_isr(void) { //Set the old value to 2nd index and new values of the encoder into the 1st index Encoder1[1] = Encoder1[0]; Encoder2[1] = Encoder2[0]; //Get values of the encoder Encoder1[0] = Debouncer(GPIO_PORT_P4, GPIO_PIN6); Encoder2[0] = Debouncer(GPIO_PORT_P6, GPIO_PIN5); PushButton[0] = Debouncer(GPIO_PORT_P6, GPIO_PIN4); //Variable controlling where the process should evaluate where there was movement or not encoderRefresh = 1; }
void WaitHighButton(SwitchDefine * mySwitch) { while(mySwitch->CurrentValidState != High) mySwitch->CurrentValidState = Debouncer(mySwitch); //update current valid state of button }