1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

Free memory we allocated and actually stop i2s. (#3191)

This commit is contained in:
Pablo Mendoza 2017-05-08 03:33:20 -05:00 committed by Ivan Grokhotkov
parent af0f5ed956
commit db4d3e0098

View File

@ -146,6 +146,10 @@ void ICACHE_FLASH_ATTR i2s_slc_end(){
SLCIE = 0; SLCIE = 0;
SLCTXL &= ~(SLCTXLAM << SLCTXLA); // clear TX descriptor address SLCTXL &= ~(SLCTXLAM << SLCTXLA); // clear TX descriptor address
SLCRXL &= ~(SLCRXLAM << SLCRXLA); // clear RX descriptor address SLCRXL &= ~(SLCRXLAM << SLCRXLA); // clear RX descriptor address
for (int x = 0; x<SLC_BUF_CNT; x++) {
free(i2s_slc_buf_pntr[x]);
}
} }
//This routine pushes a single, 32-bit sample to the I2S buffers. Call this at (on average) //This routine pushes a single, 32-bit sample to the I2S buffers. Call this at (on average)
@ -238,8 +242,16 @@ void ICACHE_FLASH_ATTR i2s_begin(){
} }
void ICACHE_FLASH_ATTR i2s_end(){ void ICACHE_FLASH_ATTR i2s_end(){
i2s_slc_end(); I2SC &= ~I2STXS;
//Reset I2S
I2SC &= ~(I2SRST);
I2SC |= I2SRST;
I2SC &= ~(I2SRST);
pinMode(2, INPUT); pinMode(2, INPUT);
pinMode(3, INPUT); pinMode(3, INPUT);
pinMode(15, INPUT); pinMode(15, INPUT);
i2s_slc_end();
} }