aboutsummaryrefslogtreecommitdiff
path: root/embassy-extras/src/peripheral.rs
Commit message (Collapse)AuthorAgeFilesLines
* Rename embassy-extras to embassy-hal-commonDario Nieuwenhuis2021-07-291-160/+0
|
* Don't bother supporting creating a `PeripheralMutex` in an exception handlerLiam Murphy2021-07-291-31/+5
|
* Replace `PeripheralStateUnchecked` with `register_interrupt_unchecked`Liam Murphy2021-07-291-30/+36
|
* Don't allow disabling interrupts wrapped by `PeripheralMutex`Liam Murphy2021-07-281-20/+1
|
* fix: interrupts with equal priority can't preempt each otherLiam Murphy2021-07-281-24/+4
|
* Remove critical sections from `PeripheralMutex` interrupt handler by ↵Liam Murphy2021-07-271-18/+122
| | | | | | | | checking the interrupt's priority on startup. Since `PeripheralMutex` is the only way to safely maintain state across interrupts, and it no longer allows setting the interrupt's priority, the priority changing isn't a concern. This also prevents other causes of UB due to the interrupt being exposed during `with`, and allowing enabling the interrupt and setting its context to a bogus pointer.
* Add `Send/Sync` bounds to `PeripheralState`Liam Murphy2021-07-241-5/+13
|
* Fix stm32 ethernetLiam Murphy2021-07-051-2/+2
|
* extras: Fix UB in `Peripheral`Liam Murphy2021-07-051-9/+41
| | | | | | | | | | | | | | | | | | `Peripheral` assumed that interrupts can't be preempted, when they can be preempted by higher priority interrupts. So I put the interrupt handler inside a critical section, and also added checks for whether the state had been dropped before the critical section was entered. I also added a `'static` bound to `PeripheralState`, since `Pin` only guarantees that the memory it directly references will not be invalidated. It doesn't guarantee that memory its pointee references also won't be invalidated. There were already some implementations of `PeripheralState` that weren't `'static`, though, so I added an unsafe `PeripheralStateUnchecked` trait and forwarded the `unsafe` to the constructors of the implementors.
* Code size optimizations.Dario Nieuwenhuis2021-03-291-8/+0
|
* peripheralmutex: separate interrupt registration to own method.Dario Nieuwenhuis2021-03-181-12/+13
|
* Remove free() from PeripheralMutex and all nrf drivers.Dario Nieuwenhuis2021-03-181-57/+20
|
* Move nRF's util into a separate crateThales Fragoso2021-03-071-0/+119