@@ -58,16 +58,21 @@ async fn interrupt_driven_task(spi: esp_hal::spi::master::SpiDma<'static, Blocki
58
58
59
59
#[ cfg( not( any( esp32, esp32s2, esp32s3) ) ) ]
60
60
#[ embassy_executor:: task]
61
- async fn interrupt_driven_task ( i2s_tx : esp_hal:: i2s:: master:: I2s < ' static , Blocking > ) {
62
- let ( _, _, _, tx_descriptors) = dma_buffers ! ( 128 ) ;
61
+ async fn interrupt_driven_task_2 ( i2s_tx : esp_hal:: i2s:: master:: I2s < ' static , Blocking > ) {
62
+ use esp_hal:: dma:: DmaTxStreamBuf ;
63
+ let ( _, _, tx_buffer, tx_descriptors) = dma_buffers ! ( 128 ) ;
63
64
64
- let mut i2s_tx = i2s_tx. into_async ( ) . i2s_tx . build ( tx_descriptors) ;
65
+ let i2s_tx = i2s_tx. into_async ( ) . i2s_tx . build ( ) ;
66
+ let mut transfer = i2s_tx
67
+ . write ( DmaTxStreamBuf :: new ( tx_descriptors, tx_buffer) . unwrap ( ) )
68
+ . unwrap ( ) ;
65
69
66
70
loop {
67
71
let mut buffer: [ u8 ; 8 ] = [ 0 ; 8 ] ;
68
72
69
73
INTERRUPT_TASK_WORKING . store ( true , portable_atomic:: Ordering :: Relaxed ) ;
70
- i2s_tx. write_dma_async ( & mut buffer) . await . unwrap ( ) ;
74
+ transfer. wait_for_available ( ) . await . unwrap ( ) ;
75
+ transfer. push ( & mut buffer) ;
71
76
INTERRUPT_TASK_WORKING . store ( false , portable_atomic:: Ordering :: Relaxed ) ;
72
77
73
78
if STOP_INTERRUPT_TASK . load ( portable_atomic:: Ordering :: Relaxed ) {
0 commit comments