[riot-notifications] [RIOT] Arduino-mega2560 GPIO implementation (#2799)

Peter Kietzmann notifications at github.com
Tue Sep 1 09:27:19 CEST 2015


> +        _SFR_MEM8(_ddr_addr(pin)) |= (1 << _pin_num(pin));
> +        ret_code = bit_is_set(_SFR_MEM8(_ddr_addr(pin)), _pin_num(pin));
> +    }
> +    else {
> +        _SFR_MEM8(_ddr_addr(pin)) &= ~(1 << _pin_num(pin));
> +        ret_code = bit_is_clear(_SFR_MEM8(_ddr_addr(pin)), _pin_num(pin));
> +    }
> +
> +    if (ret_code == 0) {
> +        return -1;
> +    }
> +
> +    return 0;
> +}
> +
> +int gpio_init_int(gpio_t pin, gpio_pp_t pullup, gpio_flank_t flank,

@haukepetersen, with the new gpio design we said, that it is up to the user to know his board and **not**  try to initialize "invalid" port/pin combinations. On the atmega2560 there are IIRC just some external interrupt lines. Do you think it makes sense to add a check here if the port/pin **is** valid?

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


More information about the notifications mailing list