Last active
February 20, 2017 00:35
-
-
Save 2garryn/6c7e550c78087d51aaa1404e4fcaaca0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void btn_loop(void) { | |
uint16_t port0 = GPIO_ReadInputData(BTN_PORT_0); | |
uint16_t port1 = GPIO_ReadInputData(BTN_PORT_1); | |
if(port0 & (BTN_PORT_0_PINS)) { | |
if(port0 & BTN_PORT_0_PIN_0) btn_callback_clicked_0_0() | |
else if(port0 & BTN_PORT_0_PIN_1) btn_callback_clicked_0_1() | |
else if(port0 & BTN_PORT_0_PIN_2) btn_callback_clicked_0_2() | |
else if(port0 & BTN_PORT_0_PIN_3) btn_callback_clicked_0_3(); | |
} else if(port1 & (BTN_PORT_1_PINS)) { | |
if(port1 & BTN_PORT_1_PIN_0) btn_callback_clicked_1_0() | |
else if(port1 & BTN_PORT_1_PIN_1) btn_callback_clicked_1_1() | |
else if(port1 & BTN_PORT_1_PIN_2) btn_callback_clicked_1_2() | |
else if(port1 & BTN_PORT_1_PIN_3) btn_callback_clicked_1_3(); | |
} else { | |
return; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment