The documentation of CLKDIV_RESTART contains the following sentence:
"Note also that CLKDIV_RESTART can be written to whilst the state
machine is running, and this is useful to resynchronise clock dividers
after the divisors (SMx_CLKDIV) have been changed on-the-fly."
This implies that it's allowed to change the value of CLKDIV on a
running state machine.
Add derive(Debug) and derive(defmt::Format) to error types.
pll and xosc Error types didn't implement Debug, which made them annoying to work with.
And only a few of our Error types implemented derive(defmt::Format).
I added both to all the errors I could find to make things a little more consistent.
The wrap source and target cannot change after installing the program
into the PIO at present, even though this is possible with the C/C++
HAL. This is useful when using the same program across multiple state
machines that have different wrap sources and targets.
`LOCK_OWNER` is only accessed using the atomic APIs, which take `&self`, so it does not need to be `static mut`, `static` is fine.
(I haven't seen any miscompilations of this, but I'm unsure if Rust is allowed to assume `static mut`s are not aliased and apply optimizations based on that. If so, this would prevent that.)
Limit the discarded data reference to the data that has actually been
read so far, instead of the whole input buffer. Also fix a spelling
error in the field name.
Fix the watchdog load to reflect the 1us tick rate. This was changed
in #361, which presumably used the field name (delay_ms) and assumed
it was in milliseconds. So this also fixes the name to reflect that
it's microseconds.
* Add rtic-monotonic support for timer & alarms
* Force Alarm interrupt if timer is set too soon
* timer: Remove non_exhaustive attribute from ScheduleAlarmError
* timer: TooSoon is no longer emitted so it can be removed
* pio: Move interrupt related (en|dis)abling/forcing methods to the statemachine
The SM knows its id using the type system so there's no need for checking it.
This commit also adds a `PioIRQ` enum to select the output IRQ.
* Move the interrupt control to Rx & Tx and make all accesses to inte atomic
* Adjust the ergonomics of IRQ handling.
* Elide lifetimes where they can be (clippy's advice)