Skip to content
Snippets Groups Projects
Commit 8f96af95 authored by fleur's avatar fleur
Browse files

Merge branch 'fleur/buttons' of git.card10.badge.events.ccc.de:fleur/firmware into fleur/buttons

parents 80e6a500 651961d6
Branches
No related tags found
No related merge requests found
......@@ -6,13 +6,13 @@
#define TOP_RIGHT 6
static const uint8_t ButtonPin[] = { BOTTOM_LEFT, BOTTOM_RIGHT, TOP_RIGHT };
static uint8_t button_states[4]; //as defined by button pin, 3->reset button
uint8_t epic_buttons_read(uint8_t mask)
{
uint8_t retval = 0;
if (portexpander_detected() && (mask % 8)) {
uint8_t button_status = ~portexpander_get();
/* Not using PB_Get() here as that performs one I2C transcation per button */
uint8_t button_status = portexpander_get();
for (int i = 0; i < 3; i++) {
if ((mask >> i) & 1) {
retval += ((button_status >> ButtonPin[i]) & 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment