File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -335,6 +335,7 @@ where
335
335
/// `DmaConfig` while initializing a memory to memory transfer.
336
336
/// * When double buffering is enabled but the `double_buf` argument is
337
337
/// `None`.
338
+ /// * When the transfer length is greater than (2^16 - 1)
338
339
pub fn init (
339
340
mut stream : STREAM ,
340
341
peripheral : PERIPHERAL ,
@@ -408,10 +409,15 @@ where
408
409
} ;
409
410
410
411
let n_transfers = if let Some ( db) = db_len {
411
- buf_len. min ( db) as u16
412
+ buf_len. min ( db)
412
413
} else {
413
- buf_len as u16
414
+ buf_len
414
415
} ;
416
+ assert ! (
417
+ n_transfers <= 65535 ,
418
+ "Hardware does not support more than 65535 transfers"
419
+ ) ;
420
+ let n_transfers = n_transfers as u16 ;
415
421
stream. set_number_of_transfers ( n_transfers) ;
416
422
417
423
// Set the DMAMUX request line if needed
You can’t perform that action at this time.
0 commit comments