-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I2S driver fixes for IRQs, protocol, factoring (#4574)
* I2S driver fixes for IRQs, protocol, factoring All redundant ICACHE_FLASH_ATTR decorators were removed, we already do this by default for all routines, anyway, The actual ISR and its called function moved to to IRAM. Used to be in flash due to the decorator, which could lead to crashes. Use ets_memset to mute buffers in ISR. Fix the I2S on-the-wire protocol by enabling the transmit delay I2STMS because I2S is supposed to send the MSB one clock after LRCLK toggles. This was causing I2S to be twice as loud as intended in the best of cases, and causing garbage/noise output when the MSB was set since data was effectively shifted. Refactor the clock divider setting to be done in one function only, as there is no reason to do the same complicated bit setting in two spots. * Comment some add'l registers, use optimstic_yield Comment the known and unknown I2S register settings for posterity, using the ESP32 guide as a basis. Use optimistic_yield() instead of esp_wdt_disable/enable when busy waiting in blocking writes to ensure we don't hog the CPU completely. Move the constant IO pins to #defines for easier understanding.
- Loading branch information
1 parent
a3a3654
commit decfbdd
Showing
1 changed file
with
49 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters