@@ -323,14 +323,14 @@ where
323
323
/// Buffer must be located in RAM.
324
324
/// Returns a value that represents the in-progress DMA transfer.
325
325
#[ allow( unused_mut) ]
326
- pub fn transfer < W , B > ( mut self , mut buffer : B ) -> Result < Transfer < T , B > , Error >
326
+ pub fn transfer < W , B > ( mut self , mut buffer : B ) -> Result < Transfer < T , B > , ( Error , Spis < T > , B ) >
327
327
where
328
328
B : WriteBuffer < Word = W > ,
329
329
{
330
330
let ( ptr, len) = unsafe { buffer. write_buffer ( ) } ;
331
331
let maxcnt = len * core:: mem:: size_of :: < W > ( ) ;
332
332
if maxcnt > EASY_DMA_SIZE {
333
- return Err ( Error :: BufferTooLong ) ;
333
+ return Err ( ( Error :: BufferTooLong , self , buffer ) ) ;
334
334
}
335
335
compiler_fence ( Ordering :: SeqCst ) ;
336
336
self . spis
@@ -366,7 +366,7 @@ where
366
366
mut self ,
367
367
tx_buffer : TxB ,
368
368
mut rx_buffer : RxB ,
369
- ) -> Result < TransferSplit < T , TxB , RxB > , Error >
369
+ ) -> Result < TransferSplit < T , TxB , RxB > , ( Error , Spis < T > , TxB , RxB ) >
370
370
where
371
371
TxB : ReadBuffer < Word = TxW > ,
372
372
RxB : WriteBuffer < Word = RxW > ,
@@ -376,10 +376,10 @@ where
376
376
let rx_maxcnt = rx_len * core:: mem:: size_of :: < RxW > ( ) ;
377
377
let tx_maxcnt = tx_len * core:: mem:: size_of :: < TxW > ( ) ;
378
378
if rx_maxcnt. max ( tx_maxcnt) > EASY_DMA_SIZE {
379
- return Err ( Error :: BufferTooLong ) ;
379
+ return Err ( ( Error :: BufferTooLong , self , tx_buffer , rx_buffer ) ) ;
380
380
}
381
381
if ( tx_ptr as usize ) < SRAM_LOWER || ( tx_ptr as usize ) > SRAM_UPPER {
382
- return Err ( Error :: DMABufferNotInDataMemory ) ;
382
+ return Err ( ( Error :: DMABufferNotInDataMemory , self , tx_buffer , rx_buffer ) ) ;
383
383
}
384
384
compiler_fence ( Ordering :: SeqCst ) ;
385
385
self . spis
0 commit comments