Commit Graph

12 Commits

Author SHA1 Message Date
Dario Nieuwenhuis
45355f184a move most interrupt methods to InterruptExt extension trait. Fixes #35 2021-03-01 00:44:38 +01:00
Dario Nieuwenhuis
8a641d1312 Fix warnings. 2021-03-01 00:23:54 +01:00
Dario Nieuwenhuis
962fb95ff0 Optimize PeripheralMutex code size 2021-02-28 22:03:45 +01:00
Dario Nieuwenhuis
da91779117 interrupt: Split set_handler context.
Since introducing the ctx pointer, the handler is now two words, so setting it can
race with the interrupt firing. On race it's possible for the new handler to be
alled with the old ctx pointer or viceversa.

Rather than documenting this, it's better to split the function in two to make it
obvious to the user that it's not atomic. The user can use a critical section, or
disable/enable the interrupt to avoid races if this is a concern.
2021-02-26 02:04:48 +01:00
Dario Nieuwenhuis
11be9170ec Cleanup interrupt package naming. Fixes #40
The `interrupt` package previously tried to be drop-in compatible with the
`interrupt` package from PACs. THis meant that there was both a PAC-style enum
value `UARTE0` and an embassy-style owned `UARTE0Interrupt` type. This made
things VERY confusing.

This drops compatibility with the PAC, improving the names for embassy interrupts.
2021-02-26 01:55:27 +01:00
Dario Nieuwenhuis
03ddc949a0 PeripheralMutex should be Unpin 2021-02-20 00:27:24 +01:00
Thales Fragoso
b69f72e055 Get rid of some warnings 2021-02-13 21:41:36 -03:00
Dario Nieuwenhuis
2616467377 nrf/buffered_uarte: stop on drop, add free() 2021-01-11 10:39:59 +01:00
Dario Nieuwenhuis
deb3c93892 Simpliify PeripheralMutex a bit. 2021-01-06 22:48:54 +01:00
Dario Nieuwenhuis
3a4dbfa52e Massicely simplify peripheral abstraction 2021-01-05 01:57:05 +01:00
Dario Nieuwenhuis
9e88718fbd Add "context" pointer to owned interrupt handlers. 2021-01-04 22:25:39 +01:00
Dario Nieuwenhuis
ace4f40f80 Introduce "peripheral" abstraction to share state between main and interrupt. 2021-01-03 01:40:40 +01:00