| | |
| | | #include "key.h" |
| | | #include "gpio.h" |
| | | |
| | | |
| | | void key_interruptinit_disable(void) |
| | | /******************************************************************************* |
| | | * Function Name: Key_GPIO_Init |
| | | * Parameters: none |
| | | * Return: none |
| | | * Description: |
| | | ******************************************************************************/ |
| | | void Key_GPIO_Init(void) |
| | | { |
| | | InputtIO(KEY1_PORT,KEY1_PIN,IN_PULLUP); |
| | | InputtIO(KEY2_PORT,KEY2_PIN,IN_PULLUP); |
| | | InputtIO(KEY3_PORT,KEY3_PIN,IN_PULLUP); |
| | | InputtIO(KEY4_PORT,KEY4_PIN,IN_PULLUP); |
| | | } |
| | | |
| | | void key_interruptinit_enable(void) |
| | | |
| | | |
| | | void keyPro(void) |
| | | { |
| | | static uint8_t P_Key1Cnt=0,R_Key2Cnt=0,L_Key3Cnt=0; |
| | | |
| | | P_Key1Cnt = (KEY1_IO_READ==Bit_RESET)? P_Key1Cnt+1:0; |
| | | R_Key2Cnt = (KEY2_IO_READ==Bit_RESET)? R_Key2Cnt+1:0; |
| | | L_Key3Cnt = (KEY3_IO_READ==Bit_RESET)? L_Key3Cnt+1:0; |
| | | |
| | | } |
| | | |
| | | void key_interruptinit(void) |
| | | { |
| | | |
| | | } |
| | | |
| | | if(R_Key2Cnt== 5) |
| | | { |
| | | //ÀýÈçÓÒ¼ü³¤°´5Ãë½øÈë²éѯģʽ |
| | | |
| | | } |
| | | |
| | | |
| | | } |