Skip to content

Commit 787699f

Browse files
committed
Merge branch 'bugfix/fix_periph_i2s_deinit_channel_delete' into 'main'
fix(esp_board_manager): Fix periph i2s deinit channel delete See merge request adf/multimedia/esp-gmf!232
2 parents b02661a + 3b73326 commit 787699f

File tree

4 files changed

+25
-14
lines changed

4 files changed

+25
-14
lines changed

packages/esp_board_manager/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 0.4.5
4+
5+
### Bug Fixes
6+
7+
- Fix `periph_i2s_deinit` channel delete
8+
- Fix i2s config `total_slot` for esp32_s3_korvo2_v3
9+
310
## 0.4.4
411

512
### Bug Fixes

packages/esp_board_manager/boards/esp32_s3_korvo2_v3/board_peripherals.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ peripherals:
2929
slot_mode: I2S_SLOT_MODE_MONO # I2S_SLOT_MODE_MONO or I2S_SLOT_MODE_STEREO
3030
slot_mask: I2S_TDM_SLOT0 # I2S_TDM_SLOT0, I2S_TDM_SLOT1 slots
3131
ws_width: 16 # WS signal width in BCLK ticks
32-
total_slot: 4
32+
total_slot: 2
3333

3434
# GPIO configuration
3535
pins:

packages/esp_board_manager/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 0.4.4
1+
version: 0.4.5
22
description: Board manager for ESP-GMF
33
url: https://github.com/espressif/esp-gmf/tree/main/packages/esp_board_manager
44
documentation: https://github.com/espressif/esp-gmf/blob/main/packages/esp_board_manager/README.md

packages/esp_board_manager/peripherals/periph_i2s.c

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -151,26 +151,30 @@ int periph_i2s_deinit(void *periph_handle)
151151
i2s_chan_handle_t handle = (i2s_chan_handle_t)periph_handle;
152152
for (size_t i = 0; i < SOC_I2S_NUM; i++) {
153153
if (i2s_chan_handles[i].chan_out == handle) {
154+
i2s_channel_disable(i2s_chan_handles[i].chan_out);
154155
i2s_del_channel(i2s_chan_handles[i].chan_out);
155156
i2s_chan_handles[i].chan_out = NULL;
156157
i2s_chan_handles[i].out_en = false;
157-
ESP_LOGW(TAG, "Caution: Releasing TX (%p), RX (%p) forced to stop.",
158-
i2s_chan_handles[i].chan_out, i2s_chan_handles[i].chan_in);
159-
i2s_channel_disable(i2s_chan_handles[i].chan_in);
160-
i2s_del_channel(i2s_chan_handles[i].chan_in);
161-
i2s_chan_handles[i].chan_in = NULL;
162-
i2s_chan_handles[i].in_en = false;
158+
ESP_LOGW(TAG, "Caution: Releasing TX (%p).", i2s_chan_handles[i].chan_out);
159+
if (i2s_chan_handles[i].chan_in != NULL && i2s_chan_handles[i].in_en == false) {
160+
ESP_LOGW(TAG, "Caution: RX (%p) forced to stop.", i2s_chan_handles[i].chan_in);
161+
i2s_channel_disable(i2s_chan_handles[i].chan_in);
162+
i2s_del_channel(i2s_chan_handles[i].chan_in);
163+
i2s_chan_handles[i].chan_in = NULL;
164+
}
163165
}
164166
if (i2s_chan_handles[i].chan_in == handle) {
167+
i2s_channel_disable(i2s_chan_handles[i].chan_in);
165168
i2s_del_channel(i2s_chan_handles[i].chan_in);
166169
i2s_chan_handles[i].chan_in = NULL;
167170
i2s_chan_handles[i].in_en = false;
168-
ESP_LOGW(TAG, "Caution: Releasing RX (%p), TX (%p) forced to stop.",
169-
i2s_chan_handles[i].chan_in, i2s_chan_handles[i].chan_out);
170-
i2s_channel_disable(i2s_chan_handles[i].chan_out);
171-
i2s_del_channel(i2s_chan_handles[i].chan_out);
172-
i2s_chan_handles[i].chan_out = NULL;
173-
i2s_chan_handles[i].out_en = false;
171+
ESP_LOGW(TAG, "Caution: Releasing RX (%p).", i2s_chan_handles[i].chan_in);
172+
if (i2s_chan_handles[i].chan_out != NULL && i2s_chan_handles[i].out_en == false) {
173+
ESP_LOGW(TAG, "Caution: TX (%p) forced to stop.", i2s_chan_handles[i].chan_out);
174+
i2s_channel_disable(i2s_chan_handles[i].chan_out);
175+
i2s_del_channel(i2s_chan_handles[i].chan_out);
176+
i2s_chan_handles[i].chan_out = NULL;
177+
}
174178
}
175179
}
176180
return 0;

0 commit comments

Comments
 (0)