count should be defined as the integer div_round_up of buffer length
and word size, otherwise transferring small buffers will cause a panic
due to underflow:
if we let from = [0u32; 1];
then calling dma::write() will result in:
let count = ((1 / 4 as usize) - 1)
= 0 - 1 // underflow
Rounding up results in 1 - 1 as expected.
Instead of adding magic constants all over the place, let's just
define DMA MAX_CHUNK_SIZE in a single constant that be referenced by
the various users.
the `bind_interrupts` macro creates a `struct` for the interrupts. it
was so far not possible to document those (except for STM32) and there
was no generic documentation being generated/added either, thus the
`missing_docs` lint was triggered for consumers which enabled it.
with this change it is now possible to manually add a comment on the
`struct` being defined in the macro invocation.
to show that this works one RP example has been modified accordingly.
Whenever any of the defmt-timestamp-uptime* features is enabled, defmt
will insert code that reads the timestamp in order to embed it into
the format string. This means that we *must* have a functional time
driver by the time the very first defmt message is printed.
Because clocks.rs is the part of the code setting up clocks that may,
indeed, be required by the chosen clock driver, it cannot contain any
defmt messages, otherwise it will trigger a read to a function that
does not yet exist.
Signed-off-by: Felipe Balbi <febalbi@microsoft.com>