File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ bool ICACHE_FLASH_ATTR i2s_is_empty(){
65
65
return (i2s_slc_queue_len >= SLC_BUF_CNT - 1 );
66
66
}
67
67
68
+ int16_t ICACHE_FLASH_ATTR i2s_available (){
69
+ return (SLC_BUF_CNT - i2s_slc_queue_len ) * SLC_BUF_LEN ;
70
+ }
71
+
68
72
uint32_t ICACHE_FLASH_ATTR i2s_slc_queue_next_item (){ //pop the top off the queue
69
73
uint8_t i ;
70
74
uint32_t item = i2s_slc_queue [0 ];
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ bool i2s_write_sample_nb(uint32_t sample);//same as above but does not block whe
48
48
bool i2s_write_lr (int16_t left , int16_t right );//combines both channels and calls i2s_write_sample with the result
49
49
bool i2s_is_full ();//returns true if DMA is full and can not take more bytes (overflow)
50
50
bool i2s_is_empty ();//returns true if DMA is empty (underflow)
51
+ int16_t i2s_available ();// returns the number of samples than can be written before blocking
51
52
52
53
#ifdef __cplusplus
53
54
}
You can’t perform that action at this time.
0 commit comments