From 78e001e6dff498e457315136450c4d96eb9d7c5b Mon Sep 17 00:00:00 2001 From: odaki Date: Sat, 25 Apr 2020 22:21:59 +0900 Subject: [PATCH] Fix unintended 0 data when I2S restart --- Grbl_Esp32/i2s_ioexpander.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Grbl_Esp32/i2s_ioexpander.cpp b/Grbl_Esp32/i2s_ioexpander.cpp index c674e2b8..693c0c24 100644 --- a/Grbl_Esp32/i2s_ioexpander.cpp +++ b/Grbl_Esp32/i2s_ioexpander.cpp @@ -244,6 +244,8 @@ static int i2s_start() { I2S0.conf.rx_reset = 1; I2S0.conf.rx_reset = 0; + I2S0.conf1.tx_stop_en = 1; // Prevent unintentional 0's at the start of I2S + I2S0.out_link.addr = (uint32_t)dma.desc[0]; // Connect DMA to FIFO @@ -253,6 +255,8 @@ static int i2s_start() { I2S0.out_link.start = 1; I2S0.conf.tx_start = 1; + I2S0.conf1.tx_stop_en = 0; // BCK, WS start to work + I2S_EXIT_CRITICAL(); return 0;