-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kinetis_common: Refactor GPIO implementation #4042
kinetis_common: Refactor GPIO implementation #4042
Conversation
c940779
to
e67d13e
Compare
Compare #3996 (comment) |
e67d13e
to
462bcf7
Compare
Semi-depends on/has the same GPIO_PIN syntax as #3847 |
(Updated the commit message to explain what this commit actually changes) |
I could test this on the phy-board soon, if it speeds up things. @gebart is this PR still waiting for an other? |
@PeterKietzmann not waiting any more |
462bcf7
to
6ef83cf
Compare
rebased on latest master |
ping @PeterKietzmann |
6ef83cf
to
ef63371
Compare
Rebased after #3485 was merged, updated GPIO pin for NVRAM CS, immediately squashed |
I can test it tomorrow. |
Aaah, dammit. Sorry for the delay. @jfischer-phytec-iot did you already test anything here? |
@gebart @PeterKietzmann There is somewhere a bug when testing with init_int. Maybe I can dig deeper today afternoon. |
@gebart, @jfischer-phytec-iot , @haukepetersen I tested some pins one the pba-d-01-kw2x with the functionalities from tests/periph_gpio. Everything went well. I don't have time for a complete review here |
@jfischer-phytec-iot what is the bug looking like? I didn't see it |
@PeterKietzmann Please try |
|
7ea1407
to
0ebeda9
Compare
rebased on latest master, added the ISR fix by @jfischer-phytec-iot |
@jfischer-phytec-iot does the current state of this PR work on your test set up? |
I can confirm that the button didn't trigger an interrupt without Johan's PR but does work with it. |
@gebart We test it, still need about 30 minutes. |
Just tested the communication between two pba-d-01 boards with this PR -> works fine. |
@gebart ACK, please throw cpu/stm32f1/periph/gpio.c out. |
This is a rewrite of the Kinetis GPIO driver which follows the refactored API in [1]. Pins are specified using the GPIO_PIN(PORT_x, y) macro, e.g. GPIO_PIN(PORT_E, 25) for the PTE25 pin. The interrupt pin handling is now implemented as a linked list, this is more memory efficient, but with a minor variation in interrupt latency depending on in what order the pins were initialized at runtime. Because the linked list entries are taken from a shared pool, there is also the possibility of running out of available configuration slots, define the preprocessor macro GPIO_INT_POOL_SIZE in periph_conf.h if you need more than 16 pins configured for interrupts in the same application. [1]: RIOT-OS#3095
0ebeda9
to
142c280
Compare
rebased, squashed and threw out the unrelated change in stm32f1 |
Happy times and go |
kinetis_common: Refactor GPIO implementation
This is a refactor of the GPIO implementation on Kinetis to follow the updated GPIO interface in #3095.
This implementation uses a linked list to handle the interrupt callbacks instead of statically allocating a few bytes per pin, this keeps the RAM usage down when not using all pins as interrupt inputs.