/******************************************************************************* * Function Name : EXTI15_10_IRQHandler * Description : This function handles External lines 15 to 10 interrupt request. * Input : None * Output : None * Return : None *******************************************************************************/ void EXTI15_10_IRQHandler(void) { if(EXTI_GetITStatus(EXTI_Line12) != RESET) { SelFunc(); /* Clear the EXTI Line 12 */ EXTI_ClearITPendingBit(EXTI_Line12); } if(EXTI_GetITStatus(EXTI_Line14) != RESET) { DownFunc(); /* Clear the EXTI Line 14 */ EXTI_ClearITPendingBit(EXTI_Line14); } }
/******************************************************************************* * Function Name : ReadKey * Description : Dispatcher function * Input : None * Output : None * Return : None *******************************************************************************/ void ReadKey(void) { uint32_t key; while (1) { key = GetKey(); switch (key) { case SEL: SelFunc(); break; case UP: UpFunc(); break; case DOWN: DownFunc(); break; case BACK: ReturnFunc(); break; } WAIT_UNTIL_KEY_RELEASED(key); } }
/******************************************************************************* * Function Name : main * Description : Main program. * Input : None * Output : None * Return : None *******************************************************************************/ int main(void) { /* Initialize the Demo */ Demo_Init(); while (1) { /* If SEL pushbutton is pressed */ if(SELStatus == 1) { /* External Interrupt Disable */ IntExtOnOffConfig(DISABLE); /* Execute Sel Function */ SelFunc(); /* External Interrupt Enable */ IntExtOnOffConfig(ENABLE); /* Reset SELStatus value */ SELStatus = 0; } } }