Update to latest CCxxwares: Srf06+EM drivers
This commit is contained in:
parent
f6437b6086
commit
01590088d3
4 changed files with 33 additions and 33 deletions
|
@ -87,7 +87,7 @@ button_press_handler(uint8_t ioid)
|
|||
* Start press duration counter on press (falling), notify on release
|
||||
* (rising)
|
||||
*/
|
||||
if(ti_lib_gpio_pin_read(BOARD_KEY_SELECT) == 0) {
|
||||
if(ti_lib_gpio_read_dio(BOARD_IOID_KEY_SELECT) == 0) {
|
||||
sel_timer.start = clock_time();
|
||||
sel_timer.duration = 0;
|
||||
} else {
|
||||
|
@ -107,7 +107,7 @@ button_press_handler(uint8_t ioid)
|
|||
* Start press duration counter on press (falling), notify on release
|
||||
* (rising)
|
||||
*/
|
||||
if(ti_lib_gpio_pin_read(BOARD_KEY_LEFT) == 0) {
|
||||
if(ti_lib_gpio_read_dio(BOARD_IOID_KEY_LEFT) == 0) {
|
||||
left_timer.start = clock_time();
|
||||
left_timer.duration = 0;
|
||||
} else {
|
||||
|
@ -128,7 +128,7 @@ button_press_handler(uint8_t ioid)
|
|||
* Start press duration counter on press (falling), notify on release
|
||||
* (rising)
|
||||
*/
|
||||
if(ti_lib_gpio_pin_read(BOARD_KEY_RIGHT) == 0) {
|
||||
if(ti_lib_gpio_read_dio(BOARD_IOID_KEY_RIGHT) == 0) {
|
||||
right_timer.start = clock_time();
|
||||
right_timer.duration = 0;
|
||||
} else {
|
||||
|
@ -151,7 +151,7 @@ button_press_handler(uint8_t ioid)
|
|||
* Start press duration counter on press (falling), notify on release
|
||||
* (rising)
|
||||
*/
|
||||
if(ti_lib_gpio_pin_read(BOARD_KEY_UP) == 0) {
|
||||
if(ti_lib_gpio_read_dio(BOARD_IOID_KEY_UP) == 0) {
|
||||
up_timer.start = clock_time();
|
||||
up_timer.duration = 0;
|
||||
} else {
|
||||
|
@ -171,7 +171,7 @@ button_press_handler(uint8_t ioid)
|
|||
* Start press duration counter on press (falling), notify on release
|
||||
* (rising)
|
||||
*/
|
||||
if(ti_lib_gpio_pin_read(BOARD_KEY_DOWN) == 0) {
|
||||
if(ti_lib_gpio_read_dio(BOARD_IOID_KEY_DOWN) == 0) {
|
||||
down_timer.start = clock_time();
|
||||
down_timer.duration = 0;
|
||||
} else {
|
||||
|
@ -193,19 +193,19 @@ config_buttons(int type, int c, uint32_t key)
|
|||
{
|
||||
switch(type) {
|
||||
case SENSORS_HW_INIT:
|
||||
ti_lib_gpio_event_clear(1 << key);
|
||||
ti_lib_ioc_port_configure_set(key, IOC_PORT_GPIO, BUTTON_GPIO_CFG);
|
||||
ti_lib_gpio_dir_mode_set((1 << key), GPIO_DIR_MODE_IN);
|
||||
ti_lib_gpio_clear_event_dio(key);
|
||||
ti_lib_rom_ioc_pin_type_gpio_input(key);
|
||||
ti_lib_rom_ioc_port_configure_set(key, IOC_PORT_GPIO, BUTTON_GPIO_CFG);
|
||||
gpio_interrupt_register_handler(key, button_press_handler);
|
||||
break;
|
||||
case SENSORS_ACTIVE:
|
||||
if(c) {
|
||||
ti_lib_gpio_event_clear(1 << key);
|
||||
ti_lib_ioc_port_configure_set(key, IOC_PORT_GPIO, BUTTON_GPIO_CFG);
|
||||
ti_lib_gpio_dir_mode_set((1 << key), GPIO_DIR_MODE_IN);
|
||||
ti_lib_ioc_int_enable(key);
|
||||
ti_lib_gpio_clear_event_dio(key);
|
||||
ti_lib_rom_ioc_pin_type_gpio_input(key);
|
||||
ti_lib_rom_ioc_port_configure_set(key, IOC_PORT_GPIO, BUTTON_GPIO_CFG);
|
||||
ti_lib_rom_ioc_int_enable(key);
|
||||
} else {
|
||||
ti_lib_ioc_int_disable(key);
|
||||
ti_lib_rom_ioc_int_disable(key);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -327,7 +327,7 @@ static int
|
|||
value_select(int type)
|
||||
{
|
||||
if(type == BUTTON_SENSOR_VALUE_STATE) {
|
||||
return ti_lib_gpio_pin_read(BOARD_KEY_SELECT) == 0 ?
|
||||
return ti_lib_gpio_read_dio(BOARD_IOID_KEY_SELECT) == 0 ?
|
||||
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
|
||||
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
|
||||
return (int)sel_timer.duration;
|
||||
|
@ -339,7 +339,7 @@ static int
|
|||
value_left(int type)
|
||||
{
|
||||
if(type == BUTTON_SENSOR_VALUE_STATE) {
|
||||
return ti_lib_gpio_pin_read(BOARD_KEY_LEFT) == 0 ?
|
||||
return ti_lib_gpio_read_dio(BOARD_IOID_KEY_LEFT) == 0 ?
|
||||
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
|
||||
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
|
||||
return (int)left_timer.duration;
|
||||
|
@ -351,7 +351,7 @@ static int
|
|||
value_right(int type)
|
||||
{
|
||||
if(type == BUTTON_SENSOR_VALUE_STATE) {
|
||||
return ti_lib_gpio_pin_read(BOARD_KEY_RIGHT) == 0 ?
|
||||
return ti_lib_gpio_read_dio(BOARD_IOID_KEY_RIGHT) == 0 ?
|
||||
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
|
||||
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
|
||||
return (int)right_timer.duration;
|
||||
|
@ -363,7 +363,7 @@ static int
|
|||
value_up(int type)
|
||||
{
|
||||
if(type == BUTTON_SENSOR_VALUE_STATE) {
|
||||
return ti_lib_gpio_pin_read(BOARD_KEY_UP) == 0 ?
|
||||
return ti_lib_gpio_read_dio(BOARD_IOID_KEY_UP) == 0 ?
|
||||
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
|
||||
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
|
||||
return (int)up_timer.duration;
|
||||
|
@ -375,7 +375,7 @@ static int
|
|||
value_down(int type)
|
||||
{
|
||||
if(type == BUTTON_SENSOR_VALUE_STATE) {
|
||||
return ti_lib_gpio_pin_read(BOARD_KEY_DOWN) == 0 ?
|
||||
return ti_lib_gpio_read_dio(BOARD_IOID_KEY_DOWN) == 0 ?
|
||||
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
|
||||
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
|
||||
return (int)down_timer.duration;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue