| | |
| | | gpio_pin_set(CN3); |
| | | gpio_pin_set(CN4); |
| | | } |
| | | } |
| | | //第二行拉低做检测 |
| | | gpio_pin_set(CN1); |
| | | gpio_pin_clr(CN2); |
| | | gpio_pin_set(CN3); |
| | | gpio_pin_set(CN4); |
| | | if(!gpio_pin_get_val(COM1)||!gpio_pin_get_val(COM2)||!gpio_pin_get_val(COM3)||!gpio_pin_get_val(COM4)) |
| | | { |
| | | if(!gpio_pin_get_val(COM1)) |
| | | { |
| | | key_down_flag=1; |
| | |
| | | gpio_pin_set(CN3); |
| | | gpio_pin_set(CN4); |
| | | } |
| | | } |
| | | |
| | | //第三行拉低做检测 |
| | | gpio_pin_set(CN1); |
| | | gpio_pin_set(CN2); |
| | | gpio_pin_clr(CN3); |
| | | gpio_pin_set(CN4); |
| | | if(!gpio_pin_get_val(COM1)||!gpio_pin_get_val(COM2)||!gpio_pin_get_val(COM3)||!gpio_pin_get_val(COM4)) |
| | | { |
| | | if(!gpio_pin_get_val(COM1)) |
| | | { |
| | | key_down_flag=1; |
| | |
| | | gpio_pin_set(CN3); |
| | | gpio_pin_set(CN4); |
| | | } |
| | | } |
| | | //第四行拉低做检测 |
| | | gpio_pin_set(CN1); |
| | | gpio_pin_set(CN2); |
| | | gpio_pin_set(CN3); |
| | | gpio_pin_clr(CN4); |
| | | if(!gpio_pin_get_val(COM1)||!gpio_pin_get_val(COM2)||!gpio_pin_get_val(COM3)||!gpio_pin_get_val(COM4)) |
| | | { |
| | | if(!gpio_pin_get_val(COM1)) |
| | | { |
| | | key_down_flag=1; |