Beispiel #1
0
/** Poll all the buttons and update their state.  */
void
button_update (void)
{
    uint8_t i;

    for (i = 0; i < BUTTONS_NUM; i++)
    {
        buttons_state[i].previous = buttons_state[i].current;

        buttons_state[i].current = ! (pio_input_get (buttons_cfg[i].pio)
                                      ^ buttons_cfg[i].active_high);
    }
}
Beispiel #2
0
bool bt_connected(void) {
	return pio_input_get(PIO_BT_CONNECTED);
}