[riot-notifications] [RIOT] cpu/msp430: added periph GPIO driver implementation (#3760)

Oleg Hahm notifications at github.com
Thu Sep 3 15:01:55 CEST 2015


> +    /* check if port and pullup resistor configuration are valid */
> +    if (port == NULL || pullup != GPIO_NOPULL) {
> +        return -1;
> +    }
> +
> +    /* disable any activated interrupt */
> +    port->IE &= ~(_pin(pin));
> +    /* configure as input */
> +    gpio_init(pin, GPIO_DIR_IN, GPIO_NOPULL);
> +    /* save ISR context */
> +    isr_ctx[_ctx(pin)].cb = cb;
> +    isr_ctx[_ctx(pin)].arg = arg;
> +    /* configure flank */
> +    if (flank == GPIO_BOTH) {
> +        return -1;
> +    }

Move this test to the to of the function, please.

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/3760/files#r38642444
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20150903/1502a337/attachment.html>


More information about the notifications mailing list