[riot-notifications] [RIOT-OS/RIOT] periph/gpio: add gpio_set_cb() function (#12082)

Marian Buschsieweke notifications at github.com
Tue Sep 17 01:29:51 CEST 2019


I like the general idea, but two general things:

1. If the argument of the callback is `NULL`, the current implementation keeps the argument of the previous caller. I think the argument should be set to whatever is given in `gpio_set_cb()`, otherwise it would not be possible to willingly set this to `NULL` after the some non-`NULL` argument has been set.
2. The new function could be called internally in `gpio_init_int()` to make sure the code is tested much. (I expect the compiler to inline this call, so that this would have no effect on the ROM size. But if I'm wrong with that, I'm fine with not calling it from `gpio_init_int()`.

I'll take a more in depth look tomorrow, I'm too tired to concentrate now.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/12082#issuecomment-531996696
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190916/f1d0d717/attachment.htm>


More information about the notifications mailing list