diff options
| author | Felipe Balbi <[email protected]> | 2025-12-16 11:28:31 -0800 |
|---|---|---|
| committer | Felipe Balbi <[email protected]> | 2025-12-16 15:04:15 -0800 |
| commit | 772c9f951b5ee292089670d9b489314d75f8a92a (patch) | |
| tree | 5760dacb87bebdc64a82e3afaf539b1454c541d3 /rustfmt.toml | |
| parent | 2102dba83b3254b77c12a23fd17853cbf985233f (diff) | |
[iMXRT] dma: fix transfer count computation
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.
Diffstat (limited to 'rustfmt.toml')
0 files changed, 0 insertions, 0 deletions
