make dma_buf_count configurable by user, so we can have a larger dma buffer on ESP32 (#106)
* make dma_buf_count configurable by user, so we can have a larger dma buffer on esp32 * fix comment about interrupt priority (see esp-idf documentation system/intr_alloc)
This commit is contained in:
1 parent
ff18640db7
commit
c6ee72e9db
2 files changed
+5
-5
No files matched your search
@@ -26,7 +26,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "AudioOutputI2S.h"
|
#include "AudioOutputI2S.h"
|
||||||
|
|
||||||
AudioOutputI2S::AudioOutputI2S(int port, int output_mode, int use_apll)
|
AudioOutputI2S::AudioOutputI2S(int port, int output_mode, int dma_buf_count, int use_apll)
|
||||||
{
|
{
|
||||||
this->portNo = port;
|
this->portNo = port;
|
||||||
this->i2sOn = false;
|
this->i2sOn = false;
|
||||||
@@ -64,9 +64,9 @@ AudioOutputI2S::AudioOutputI2S(int port, int output_mode, int use_apll)
|
|||||||
.bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT,
|
.bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT,
|
||||||
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
|
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
|
||||||
.communication_format = comm_fmt,
|
.communication_format = comm_fmt,
|
||||||
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1, // high interrupt priority
|
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1, // lowest interrupt priority
|
||||||
.dma_buf_count = 8,
|
.dma_buf_count = dma_buf_count,
|
||||||
.dma_buf_len = 64, //Interrupt level 1
|
.dma_buf_len = 64,
|
||||||
.use_apll = use_apll // Use audio PLL
|
.use_apll = use_apll // Use audio PLL
|
||||||
};
|
};
|
||||||
Serial.printf("+%d %p\n", portNo, &i2s_config_dac);
|
Serial.printf("+%d %p\n", portNo, &i2s_config_dac);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
class AudioOutputI2S : public AudioOutput
|
class AudioOutputI2S : public AudioOutput
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AudioOutputI2S(int port=0, int output_mode=EXTERNAL_I2S, int use_apll=APLL_DISABLE);
|
AudioOutputI2S(int port=0, int output_mode=EXTERNAL_I2S, int dma_buf_count = 8, int use_apll=APLL_DISABLE);
|
||||||
virtual ~AudioOutputI2S() override;
|
virtual ~AudioOutputI2S() override;
|
||||||
bool SetPinout(int bclkPin, int wclkPin, int doutPin);
|
bool SetPinout(int bclkPin, int wclkPin, int doutPin);
|
||||||
virtual bool SetRate(int hz) override;
|
virtual bool SetRate(int hz) override;
|
||||||
|
|||||||
Reference in new issue
Block a user