Skip to content

Commit

Permalink
fix(i2s): Check if pin is used before clearing bus
Browse files Browse the repository at this point in the history
  • Loading branch information
P-R-O-C-H-Y committed Jan 9, 2025
1 parent 2f423af commit bed762c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions libraries/ESP_I2S/src/ESP_I2S.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,9 +719,15 @@ bool I2SClass::end() {
#if SOC_I2S_SUPPORTS_TDM
case I2S_MODE_TDM:
#endif
perimanClearPinBus(_mclk);
perimanClearPinBus(_bclk);
perimanClearPinBus(_ws);
if(_mclk >= 0) {
perimanClearPinBus(_mclk);
}
if(_bclk >= 0) {
perimanClearPinBus(_bclk);
}
if(_ws >= 0) {
perimanClearPinBus(_ws);
}
if (_dout >= 0) {
perimanClearPinBus(_dout);
}
Expand Down

0 comments on commit bed762c

Please sign in to comment.