Skip to content

Commit

Permalink
Update xdrv_123_plugins.ino
Browse files Browse the repository at this point in the history
  • Loading branch information
gemu2015 committed Aug 28, 2024
1 parent f31a898 commit fcba966
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tasmota/tasmota_xdrv_driver/xdrv_123_plugins.ino
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ uint32_t tmod_wifi(uint32_t sel, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t
#endif

uint32_t tmod_i2s(uint32_t sel, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4, uint32_t p5) {
#ifdef ESP32
#if defined(ESP32) && ESP_IDF_VERSION_MAJOR >= 5
i2s_chan_handle_t tx_handle = (i2s_chan_handle_t)p1;
#endif

Expand All @@ -647,7 +647,7 @@ i2s_chan_handle_t tx_handle = (i2s_chan_handle_t)p1;
i2s_begin();
return 0;
#endif
#ifdef ESP32
#if defined(ESP32) && ESP_IDF_VERSION_MAJOR >= 5
{
i2s_chan_config_t chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(I2S_NUM_AUTO, I2S_ROLE_MASTER);
/* Allocate a new TX channel and get the handle of this channel */
Expand Down Expand Up @@ -704,7 +704,7 @@ i2s_chan_handle_t tx_handle = (i2s_chan_handle_t)p1;
#ifdef ESP8266
i2s_end();
#endif
#ifdef ESP32
#if defined(ESP32) && ESP_IDF_VERSION_MAJOR >= 5
{
i2s_channel_disable(tx_handle);
i2s_del_channel(tx_handle);
Expand All @@ -716,7 +716,7 @@ i2s_chan_handle_t tx_handle = (i2s_chan_handle_t)p1;
#ifdef ESP8266
i2s_set_rate(p2);
#endif
#ifdef ESP32
#if defined(ESP32) && ESP_IDF_VERSION_MAJOR >= 5
{
i2s_channel_disable(tx_handle);

Expand Down Expand Up @@ -769,7 +769,7 @@ i2s_chan_handle_t tx_handle = (i2s_chan_handle_t)p1;
}
}
#endif
#ifdef ESP32
#if defined(ESP32) && ESP_IDF_VERSION_MAJOR >= 5
i2s_channel_write(tx_handle, (uint8_t *)p2, p3 * 2, nullptr, 100);
#endif
break;
Expand All @@ -779,28 +779,28 @@ i2s_chan_handle_t tx_handle = (i2s_chan_handle_t)p1;
return i2s_read_sample((int16_t *)p2, (int16_t *)p3, p4);
#endif

#ifdef ESP32
#if defined(ESP32) && ESP_IDF_VERSION_MAJOR >= 5
#endif
break;
case 5:
// write one sample
#ifdef ESP8266
i2s_write_sample(p2);
#endif // ESP8266
#ifdef ESP32
#if defined(ESP32) && ESP_IDF_VERSION_MAJOR >= 5
{
int16_t src_buf = p2;
i2s_channel_write(tx_handle, &src_buf, 2, nullptr, 5);
}
break;
#endif // ESP32
case 6:
#ifdef ESP32
#if defined(ESP32) && ESP_IDF_VERSION_MAJOR >= 5
return i2s_channel_enable(tx_handle);
#endif
break;
case 7:
#ifdef ESP32
#if defined(ESP32) && ESP_IDF_VERSION_MAJOR >= 5
return i2s_channel_disable(tx_handle);
#endif
break;
Expand Down

0 comments on commit fcba966

Please sign in to comment.