Skip to content

Commit 6237a14

Browse files
committed
espressif: i2sout: Comment on these constants better
1 parent 50a971e commit 6237a14

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

ports/espressif/common-hal/audiobusio/__init__.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,14 @@
3535

3636
#include "shared-module/audiocore/__init__.h"
3737

38-
#define CIRCUITPY_BUFFER_COUNT 3
39-
#define CIRCUITPY_BUFFER_SIZE 1023
40-
#define CIRCUITPY_OUTPUT_SLOTS 2
38+
// The maximum DMA buffer size (in bytes)
39+
#define I2S_DMA_BUFFER_MAX_SIZE 4092
40+
// The number of DMA buffers to allocate
41+
#define CIRCUITPY_BUFFER_COUNT (3)
42+
// The maximum DMA buffer size in frames (at stereo 16-bit)
43+
#define CIRCUITPY_BUFFER_SIZE (I2S_DMA_BUFFER_MAX_SIZE / 4)
44+
// The number of output channels is fixed at 2
45+
#define CIRCUITPY_OUTPUT_SLOTS (2)
4146

4247
static void i2s_fill_buffer(i2s_t *self) {
4348
if (self->next_buffer_size == 0) {

0 commit comments

Comments
 (0)