Merge pull request #951 from hrzr/master
Make the CC2538DK button sensor clearer to work with
This commit is contained in:
commit
0ba7f8df52
|
@ -103,25 +103,17 @@ btn_callback(uint8_t port, uint8_t pin)
|
||||||
}
|
}
|
||||||
|
|
||||||
timer_set(&debouncetimer, CLOCK_SECOND / 8);
|
timer_set(&debouncetimer, CLOCK_SECOND / 8);
|
||||||
if(port == GPIO_A_NUM) {
|
|
||||||
|
if((port == BUTTON_SELECT_PORT) && (pin == BUTTON_SELECT_PIN)) {
|
||||||
sensors_changed(&button_select_sensor);
|
sensors_changed(&button_select_sensor);
|
||||||
} else if(port == GPIO_C_NUM) {
|
} else if((port == BUTTON_LEFT_PORT) && (pin == BUTTON_LEFT_PIN)) {
|
||||||
switch(pin) {
|
|
||||||
case BUTTON_LEFT_PIN:
|
|
||||||
sensors_changed(&button_left_sensor);
|
sensors_changed(&button_left_sensor);
|
||||||
break;
|
} else if((port == BUTTON_RIGHT_PORT) && (pin == BUTTON_RIGHT_PIN)) {
|
||||||
case BUTTON_RIGHT_PIN:
|
|
||||||
sensors_changed(&button_right_sensor);
|
sensors_changed(&button_right_sensor);
|
||||||
break;
|
} else if((port == BUTTON_UP_PORT) && (pin == BUTTON_UP_PIN)) {
|
||||||
case BUTTON_UP_PIN:
|
|
||||||
sensors_changed(&button_up_sensor);
|
sensors_changed(&button_up_sensor);
|
||||||
break;
|
} else if((port == BUTTON_DOWN_PORT) && (pin == BUTTON_DOWN_PIN)) {
|
||||||
case BUTTON_DOWN_PIN:
|
|
||||||
sensors_changed(&button_down_sensor);
|
sensors_changed(&button_down_sensor);
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
Loading…
Reference in a new issue