This commit is contained in:
e2002
2022-09-05 11:10:54 +03:00
parent b574b4ab8d
commit da238ea42a
24 changed files with 470 additions and 214 deletions

View File

@@ -18,7 +18,9 @@
#ifdef SDFATFS_USED
fs::SDFATFS SD_SDFAT;
#endif
#ifndef DMA_BUFCOUNT
#define DMA_BUFCOUNT 4
#endif
//---------------------------------------------------------------------------------------------------------------------
AudioBuffer::AudioBuffer(size_t maxBlockSize) {
// if maxBlockSize isn't set use defaultspace (1600 bytes) is enough for aac and mp3 player
@@ -174,7 +176,11 @@ Audio::Audio(bool internalDAC /* = false */, uint8_t channelEnabled /* = I2S_DAC
m_i2s_config.bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT;
m_i2s_config.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT;
m_i2s_config.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1; // interrupt priority
m_i2s_config.dma_buf_count = 16;
#ifdef OLD_DMABUF_PARAMS
m_i2s_config.dma_buf_count = 16; // 4×512×16=32768
#else
m_i2s_config.dma_buf_count = psramInit()?16:DMA_BUFCOUNT;
#endif
m_i2s_config.dma_buf_len = 512;
m_i2s_config.use_apll = APLL_DISABLE; // must be disabled in V2.0.1-RC1
m_i2s_config.tx_desc_auto_clear = true; // new in V1.0.1

View File

@@ -712,6 +712,12 @@ void Nextion::startWeather(){
updateWeather();
}
void Nextion::sleep(void) {
putcmd("sleep=1");
}
void Nextion::wake(void) {
putcmd("sleep=0");
}
/*
По мотивам https://forum.amperka.ru/threads/%D0%94%D0%B8%D1%81%D0%BF%D0%BB%D0%B5%D0%B9-nextion-%D0%B0%D0%B7%D1%8B-arduino-esp8266.9204/page-18#post-173442
*/

View File

@@ -71,6 +71,8 @@ class Nextion {
bool getForecast();
static void updateWeather();
static void getWeather(void * pvParameters);
void sleep();
void wake();
};
extern Nextion nextion;