cc2538: gpio: Use accessor macros
Use the GPIO accessor macros instead of copying raw register access code all over the place. This is cleaner and less error prone. This fixes the setting of the USB pull-up resistor that worked only by chance on the CC2538DK because it is controlled by the pin 0 of the used GPIO port. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
This commit is contained in:
parent
923f161b7b
commit
680050861c
4 changed files with 13 additions and 14 deletions
|
@ -89,7 +89,7 @@ gpio_port_a_isr()
|
|||
|
||||
notify(REG(GPIO_A_BASE | GPIO_MIS), GPIO_A_NUM);
|
||||
|
||||
REG(GPIO_A_BASE | GPIO_IC) = 0xFF;
|
||||
GPIO_CLEAR_INTERRUPT(GPIO_A_BASE, 0xFF);
|
||||
|
||||
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ gpio_port_b_isr()
|
|||
|
||||
notify(REG(GPIO_B_BASE | GPIO_MIS), GPIO_B_NUM);
|
||||
|
||||
REG(GPIO_B_BASE | GPIO_IC) = 0xFF;
|
||||
GPIO_CLEAR_INTERRUPT(GPIO_B_BASE, 0xFF);
|
||||
|
||||
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ gpio_port_c_isr()
|
|||
|
||||
notify(REG(GPIO_C_BASE | GPIO_MIS), GPIO_C_NUM);
|
||||
|
||||
REG(GPIO_C_BASE | GPIO_IC) = 0xFF;
|
||||
GPIO_CLEAR_INTERRUPT(GPIO_C_BASE, 0xFF);
|
||||
|
||||
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ gpio_port_d_isr()
|
|||
|
||||
notify(REG(GPIO_D_BASE | GPIO_MIS), GPIO_D_NUM);
|
||||
|
||||
REG(GPIO_D_BASE | GPIO_IC) = 0xFF;
|
||||
GPIO_CLEAR_INTERRUPT(GPIO_D_BASE, 0xFF);
|
||||
|
||||
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue