This commit is contained in:
e2002
2022-08-29 10:23:53 +03:00
parent de9753058d
commit b574b4ab8d
15 changed files with 435 additions and 680 deletions

View File

@@ -32,8 +32,8 @@
#include <FFat.h>
#endif // SDFATFS_USED
#ifndef AUDIOBUFFER_MULTIPLIER
#define AUDIOBUFFER_MULTIPLIER 12
#ifndef AUDIOBUFFER_MULTIPLIER2
#define AUDIOBUFFER_MULTIPLIER2 8
#endif
#ifdef SDFATFS_USED
@@ -140,7 +140,7 @@ public:
protected:
size_t m_buffSizePSRAM = 300000; // most webstreams limit the advance to 100...300Kbytes
//size_t m_buffSizeRAM = 1600 * 5;
size_t m_buffSizeRAM = 1600 * AUDIOBUFFER_MULTIPLIER;
size_t m_buffSizeRAM = 1600 * AUDIOBUFFER_MULTIPLIER2;
size_t m_buffSize = 0;
size_t m_freeSpace = 0;
size_t m_writeSpace = 0;

View File

@@ -7,7 +7,9 @@
* Updated on: Aug 15.2022
* Author: Wolle
*/
#ifndef VS_PATCH_ENABLE
#define VS_PATCH_ENABLE true
#endif
#include "audioVS1053Ex.h"
//---------------------------------------------------------------------------------------------------------------------
@@ -325,7 +327,7 @@ void Audio::begin(){
setVUmeter();
m_endFillByte = wram_read(0x1E06) & 0xFF;
// printDetails("After last clocksetting \n");
loadUserCode(); // load in VS1053B if you want to play flac
if(VS_PATCH_ENABLE) loadUserCode(); // load in VS1053B if you want to play flac
startSong();
}
//---------------------------------------------------------------------------------------------------------------------
@@ -1613,6 +1615,7 @@ void Audio::setDefaults(){
* \n The VU meter takes about 0.2MHz of processing power with 48 kHz samplerate.
*/
void Audio::setVUmeter() {
if(!VS_PATCH_ENABLE) return;
uint16_t MP3Status = read_register(SCI_STATUS);
if(MP3Status==0) {
Serial.println("VS1053 Error: Unable to write SCI_STATUS");
@@ -1636,6 +1639,7 @@ void Audio::setVUmeter() {
* \warning This feature is only available with patches that support VU meter.
*/
void Audio::getVUlevel() {
if(!VS_PATCH_ENABLE) return;
if(!_vuInitalized) return;
int16_t reg = read_register(SCI_AICTRL3);
uint8_t rl = map((uint8_t)reg, 85, 92, 0, 255);

View File

@@ -9,8 +9,8 @@
#ifndef _vs1053_ext
#define _vs1053_ext
#ifndef AUDIOBUFFER_MULTIPLIER
#define AUDIOBUFFER_MULTIPLIER 12
#ifndef AUDIOBUFFER_MULTIPLIER2
#define AUDIOBUFFER_MULTIPLIER2 10
#endif
#define VS1053VOLM 128 // 128 or 96 only
@@ -97,7 +97,7 @@ public:
protected:
const size_t m_buffSizePSRAM = 300000; // most webstreams limit the advance to 100...300Kbytes
//const size_t m_buffSizeRAM = 1600 * 10;
const size_t m_buffSizeRAM = 1600 * AUDIOBUFFER_MULTIPLIER;
const size_t m_buffSizeRAM = 1600 * AUDIOBUFFER_MULTIPLIER2;
size_t m_buffSize = 0;
size_t m_freeSpace = 0;
size_t m_writeSpace = 0;

View File

@@ -353,7 +353,7 @@ void Nextion::loop() {
wifisettings+=(String(scanBuf)+"\n");
}
if (sscanf(rxbuf, "wifidone=%d", &scanDigit) == 1){
config.saveWifi(wifisettings.c_str());
config.saveWifiFromNextion(wifisettings.c_str());
}
}
}