965: (embassy-rp): add RP2040 ROM functions and intrinsics aliases r=Dirbaio a=MathiasKoch
Add RP2040 ROM functions described in section **2.8.3.1. Bootrom Functions** of https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf
Make all ROM functions (normal and floating point) provide both a direct
call that does the operation and a module with a ptr() function to get
the function pointer.
Add a feature to enable automatic caching of the result of ROM table
function lookups.
Add a check for a V2 bootrom when using floating point functions that
require it. Panic when it's not present.
Add a standardized macro for intrinsics export and connect the simple
ROM functions to intrinsics.
Direct copy from `rp-hal`! Full credit to those guys for all the heavy lifting.
Co-authored-by: Mathias <mk@blackbird.online>
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
960: Add non blocking Bxcan constructor r=Dirbaio a=andyblarblar
This PR adds a non-blocking constructor to the Bxcan Can wrapper struct. This allows for the creation of the Can periferal without blocking for a sync with the Can bus.
Co-authored-by: Andrew Ealovega <Andrew@Ealovega.dev>
971: (embassy-boot): add blocking API to FirmwareUpdater r=lulf a=MathiasKoch
Also add a split `prepare_update` + `write_firmware` API, to allow for an optimized update API at the exchange of added complexity.
The old API is left in place to allow users to choose the complexity level that fits their needs.
Co-authored-by: Mathias <mk@blackbird.online>
961: Parameterize Signal with RawMutex r=ivmarkov a=ivmarkov
The `RawMutex` parameter is deliberately chosen to be the second one, so as it can take as a default `CriticalSectionRawMutex`. This way backwards compatibility is preserved, and users utilizing the `critical-section` crate everywhere can just continue to use the more ergonomic single-generic-parameter version of Signal.
I'm thinking we should probably do the same for `Channel`, and move the `RawMutex` parameter as the last one in the list, with a `CriticalSectionRawMutex` being its default. But that's a backwards-incompatible change of course.
Co-authored-by: ivmarkov <ivan.markov@gmail.com>
958: Implement proper `Drop` for `BufferedUarte` r=lulf a=ZoeyR
The drop method in `BufferedUarte` was prone to hanging indefinitely and also didn't actually disable the peripheral. I mostly copied over the drop method from `Uarte` with some modifications since `BufferedUarte` could have a transmit lasting indefinitely.
Co-authored-by: Zoey Riordan <zoey@dos.cafe>
963: Remove some uses of the `futures` crate r=Dirbaio a=Dirbaio
- use `Future` from `core`
- `poll_fn` is now stable in `core` since Rust 1.64 (out today)
- Use `join` from `embassy-futures`.
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
949: (embassy-rp): Implement RealTimeClock r=lulf a=MathiasKoch
Basically a 1:1 port of the great implementation effort made by `rp-hal`
Co-authored-by: Mathias <mk@blackbird.online>
957: Take into account size of revert index r=lulf a=lulf
Fixes a bug in the partition assertions that ensures that the state page(s) have enough space for 2x active partition range.
Add unit test to verify that panic is observed.
Co-authored-by: Ulf Lilleengen <ulf.lilleengen@gmail.com>
Fixes a bug in the partition assertions that ensures that the state
page(s) have enough space for 2x active partition range.
Add unit test to verify that panic is observed.
956: Remove BootFlash borrow r=lulf a=lulf
Compiler will infer a different lifetime for BootFlash than for the borrowed flash, which makes it require more type annotations than if it was just owning the type. Since it doesn't really matter if it owns or borrows in practical use, change it to own so that it simplifies usage.
Co-authored-by: Ulf Lilleengen <ulf.lilleengen@gmail.com>
Compiler will infer a different lifetime for BootFlash than for the
borrowed flash, which makes it require more type annotations than if it
was just owning the type. Since it doesn't really matter if it owns or
borrows in practical use, change it to own so that it simplifies usage.
950: Add .into_inner() and .get_mut() to Mutex r=Dirbaio a=hulthe
Similar to the methods on std Mutex, these methods allow accessing the underlying data without locking the mutex when you have exclusive access to it.
Co-authored-by: Joakim Hulthe <joakim@hulthe.net>
948: (embassy-stm32): make `State::new()` const, consistent with others r=Dirbaio a=FrozenDroid
Co-authored-by: Vincent Stakenburg <v.stakenburg@sinewave.nl>
946: sync/signal: wake old waker on overflow instead of panicking. r=Dirbaio a=Dirbaio
This makes behavior consistent with `WakerRegistration`. It allows canceling `wait` in one task and then calling `wait` in another. If two tasks are `wait`ing concurrently the signal will be received by only one of them, randomly.
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
This makes behavior consistent with `WakerRegistration`. It allows canceling `wait`
in one task and then calling `wait` in another. If two tasks are `wait`ing
concurrently the signal will be received by only one of them, randomly.