Skip to content
Snippets Groups Projects
Commit d8e2611e authored by Sebastian Meiling's avatar Sebastian Meiling
Browse files

cpu/cc2538: refine gpio_init_mux

    Introduces a define to inidicate an unused function parameter.
parent feb3912c
No related branches found
No related tags found
No related merge requests found
......@@ -60,6 +60,10 @@ typedef uint32_t gpio_t;
*/
#define GPIO_UNDEF (0xffffffff)
/**
* @brief Custom value to indicate unused parameter in gpio_init_mux
*/
#define GPIO_MUX_NONE (0xff)
/**
* @brief Define a custom GPIO_PIN macro
*
......
......@@ -264,13 +264,13 @@ void gpio_init_mux(gpio_t pin, uint8_t over, uint8_t sel, uint8_t func)
{
assert(pin != GPIO_UNDEF);
/* configure pin function and multiplexing */
if (over != MODE_NOTSUP) {
if (over != GPIO_MUX_NONE) {
IOC->OVER[_pp_num(pin)] = over;
}
if (sel != MODE_NOTSUP) {
if (sel != GPIO_MUX_NONE) {
IOC->SEL[_pp_num(pin)] = sel;
}
if (func != MODE_NOTSUP) {
if (func != GPIO_MUX_NONE) {
IOC->PINS[func] = _pp_num(pin);
}
/* enable alternative function mode */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment