aboutsummaryrefslogtreecommitdiff
path: root/embassy-extras/src/peripheral_shared.rs
Commit message (Collapse)AuthorAgeFilesLines
* Rename embassy-extras to embassy-hal-commonDario Nieuwenhuis2021-07-291-122/+0
|
* Replace `PeripheralStateUnchecked` with `register_interrupt_unchecked`Liam Murphy2021-07-291-19/+33
|
* Don't allow disabling interrupts wrapped by `PeripheralMutex`Liam Murphy2021-07-281-16/+0
|
* Remove critical sections from `PeripheralMutex` interrupt handler by ↵Liam Murphy2021-07-271-14/+47
| | | | | | | | 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/+12
|
* Fix stm32 ethernetLiam Murphy2021-07-051-2/+2
|
* Elide lifetimes on `Peripheral::state`Liam Murphy2021-07-051-1/+1
|
* extras: Fix UB in `Peripheral`Liam Murphy2021-07-051-12/+33
| | | | | | | | | | | | | | | | | | `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-5/+0
|
* extras: add Peripheral with shared state (like PeripheralMutex but without ↵Dario Nieuwenhuis2021-03-291-0/+68
mutex)