Skip to content

Commit 1f2ba1f

Browse files
authoredJun 24, 2024
docs(i2s): Fix I2S documentation example (espressif#9916)
* docs(i2s): Fix I2S documentation example * docs(idf): Fix name of Arduino as component link
1 parent 26db8cb commit 1f2ba1f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
 

‎docs/en/advanced_utils.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ Advanced Utilities
66
:maxdepth: 2
77

88
Library Builder <lib_builder>
9-
ESP-IDF as Component <esp-idf_component>
9+
Arduino as an ESP-IDF component <esp-idf_component>
1010
OTA Web Update <ota_web_update>
1111
makeEspArduino <make>

‎docs/en/api/i2s.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -536,21 +536,21 @@ Sample code
536536
#include <ESP_I2S.h>
537537
538538
const int buff_size = 128;
539-
int available, read;
539+
int available_bytes, read_bytes;
540540
uint8_t buffer[buff_size];
541541
I2SClass I2S;
542542
543543
void setup() {
544544
I2S.setPins(5, 25, 26, 35, 0); //SCK, WS, SDOUT, SDIN, MCLK
545545
I2S.begin(I2S_MODE_STD, 16000, I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_STEREO);
546546
I2S.read();
547-
available = I2S.available();
548-
if(available < buff_size) {
549-
read = I2S.read(buffer, available);
547+
available_bytes = I2S.available();
548+
if(available_bytes < buff_size) {
549+
read_bytes = I2S.read(buffer, available_bytes);
550550
} else {
551-
read = I2S.read(buffer, buff_size);
551+
read_bytes = I2S.read(buffer, buff_size);
552552
}
553-
I2S.write(buffer, read);
553+
I2S.write(buffer, read_bytes);
554554
I2S.end();
555555
}
556556

0 commit comments

Comments
 (0)
Please sign in to comment.