751: Use explicit return statement TaskStorage::spawn r=Dirbaio a=danbev
This commit removes the else branch in `TaskStorage::spawn`, and returns
explicitly from the if statement's branch, similar to what
[TaskPool::spawn](85c0525e01/embassy/src/executor/raw/mod.rs (L235-L243)) does.
Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
This commit removes the else branch in TaskStorage::spawn, and returns
explicitly from the if statement's branch, similar to what
TaskPool::spawn does.
The replacement is `embassy-usb`. There's a WIP driver for stm32 USBD in #709,
there's no WIP driver for stm32 USB_OTG. This means we're left without
USB_OTG support for now.
Reason for removing is I'm going to soon remove `embassy::io`, and
USB uses it. I don't want to spend time maintaining "dead" code
that is going to be removed. Volunteers welcome, either to update
old USB to the new IO, or write a USB_OTG driver fo the new USB.
749: Rename spawn_allocate to spawn_mark_used r=Dirbaio a=danbev
This commit contains a suggestion to rename `TaskStorage::spawn_allocate`.
The motivation for this is when reading through the code I was
expecting something else to happen in this method, due to `allocate` in
the method name.
I'm very new to this code base so I may be wrong in thinking this
is a good change, but I wanted to open this PR to get some feedback.
Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
This commit contains a suggestion to rename TaskStorage::spawn_allocate.
The motivation for this is when reading through the code I was
expecting something else to happen in this method, due to 'allocate' in
the method name.
743: Add PLL config support for F2 r=Dirbaio a=Gekkio
- minor changes to make the F2 RCC API a bit more flexible
- low-level PLL config with assertions based on datasheet specs. It shouldn't be very difficult to later add a "reverse API" where you pass the clocks you want to a function and it generates a `PLLConfig` struct for you
- PLL API tested on my custom board with 12 MHz HSE as source for PLL to generate max clocks for SYSCLK/AHB/APB/APB1/PLL48
- the example *should* work but is untested since I don't have the Nucleo board 😞
Co-authored-by: Joonas Javanainen <joonas.javanainen@gmail.com>
733: Add f107 ethernet support. r=Dirbaio a=davidlenfesty
The original driver works perfectly, the only required changes were only to clock and pin configuration.
Bits that are also present and deserve some scrutiny:
- Migrated LAN8742a driver to a generic SMI version (only *functional* difference is a couple extra status checks for the link poll, which IMO weren't great anyways (i.e. it would consider the link down if it negotiated to 10M)
- Migrated f1 RCC init to "new" style. As of creating this draft PR, it is pretty much only tested on the happy path for my specific configuration, and also needs a couple things done (calculated clock speeds are hardcoded and ADC clock isn't implemented)
- Support for v1b driver (f2 and f4) was added, but not tested.
(Made a draft PR until f4 support is verified and I finish the clock init - adding testing and at least feature parity with how it was before)
Co-authored-by: David Lenfesty <lenfesty@ualberta.ca>
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
SMI Ethernet PHYs all share a common base set of registers that can do
90% of all tasks. The LAN8742 driver used some vendor-specific
registers to check link negotiation status, but the need for that was
debatable, so I migrated it to a generic driver instead, anybody who
wants extra functionality can copy it and impl their own on top of it.
This makes the configuration more flexible and closer to the underlying
configuration register structure. For example, we could use HSI for the
system clock, but use HSE to output a clock with MCO.
742: Only 1 argument in embassy::main when there is no HAL r=Dirbaio a=jbeaurivage
There is a slight mistake in an error message from `[embassy::main]` macro. When there is no HAL specified, `main` should take only one argument.
Co-authored-by: Justin Beaurivage <justin@wearableavionics.com>
738: Add split method to UarteWithIdle in nrf hal r=lulf a=ZoeyR
I needed this method because I was writing a driver for the sim7000 modem. Its a line based protocol so the read until idle was very useful to me. Unfortunately unlike the primary `Uarte` struct the `UarteWithIdle` didn't have `split()`. So I added it 😄
Co-authored-by: Zoey Riordan <zoey@dos.cafe>