cpu/sam0_common: implement periph_gpio_ll and periph_gpio_ll_irq#20189
cpu/sam0_common: implement periph_gpio_ll and periph_gpio_ll_irq#20189maribu merged 3 commits intoRIOT-OS:masterfrom
Conversation
5552b4d to
c939c63
Compare
c939c63 to
06c2d95
Compare
When using level triggered IRQs, a new IRQ flag may already have been set while the IRQ callback is executed. Hence, we cannot just toggle the output, but rather should drive it low/high for a level trigger on high/low. Also test `gpio_ll_query_conf()` for the disconnected state as well.
06c2d95 to
67b3815
Compare
|
Rebased on |
|
I tried this on and I get |
|
PA21 seems to be connected to Could you try it again with other GPIOs? |
|
Ah indeed, works with PA04/05, PA14/15 |
|
I get a different failure on |
| { | ||
| if (port_num >= ARRAY_SIZE(exti_config)) { | ||
| return -1; | ||
| } |
There was a problem hiding this comment.
The call sites of get_exti_num() actually do:
assume((unsigned)exti_num < IRQS_NUMOF);That should cover this as well, but also gives the compiler information about what values are to be expected within exti_config.
Good catch! That would have been a nasty race condition bug that could have caused lots of pain and tears. For me it now works correctly. |
Co-authored-by: benpicco <[email protected]>
Co-authored-by: benpicco <[email protected]>
cdc840e to
1484d30
Compare
|
Thx :) |
|
Improving the test in 891c627 had the side effect that lots of boards now fail the test 😅 (But the issues it detects are indeed very real.) |
Contribution description
This implements
periph_gpio_llandperiph_gpio_ll_irqfor SAM0 based MCUs.Testing procedure
Issues/PRs references