Skip to content

Commit

Permalink
v0.7.017
Browse files Browse the repository at this point in the history
  • Loading branch information
e2002 committed Aug 3, 2022
1 parent 2aa2fe3 commit 19fede3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ Work is in progress...

---
## Version history
#### v0.7.017
- fix initialization of some vs1053b green boards
- fix VU initialization on vs1053b boards

#### v0.7.010
- fixed choppy of sound when volume adjustment
- fixed initialisation of Nextion displays
Expand Down
2 changes: 1 addition & 1 deletion yoRadio/options.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef options_h
#define options_h

#define VERSION "0.7.010"
#define VERSION "0.7.017"

/*******************************************************
DO NOT EDIT THIS FILE.
Expand Down
15 changes: 11 additions & 4 deletions yoRadio/src/audioVS1053/audioVS1053Ex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ void Audio::begin(){
mutex_pl = xSemaphoreCreateMutex();
DCS_HIGH();
CS_HIGH();
delay(100);
delay(200);

// Init SPI in slow mode (0.2 MHz)
VS1053_SPI = SPISettings(200000, MSBFIRST, SPI_MODE0);
Expand All @@ -331,14 +331,14 @@ void Audio::begin(){
write_register(SCI_AUDATA, 44100 + 1); // 44.1kHz + stereo
// The next clocksetting allows SPI clocking at 5 MHz, 4 MHz is safe then.
write_register(SCI_CLOCKF, 6 << 12); // Normal clock settings multiplyer 3.0=12.2 MHz
//set vu meter
setVUmeter();
//SPI Clock to 4 MHz. Now you can set high speed SPI clock.
VS1053_SPI=SPISettings(6700000, MSBFIRST, SPI_MODE0); // SPIDIV 12 -> 80/12=6.66 MHz
write_register(SCI_MODE, _BV (SM_SDINEW) | _BV(SM_LINE1));
//testComm("Fast SPI, Testing VS1053 read/write registers again... \n");
delay(10);
await_data_request();
//set vu meter
setVUmeter();
m_endFillByte=wram_read(0x1E06) & 0xFF;
// sprintf(chbuf, "endFillByte is %X", endFillByte);
// if(audio_info) audio_info(chbuf);
Expand Down Expand Up @@ -467,7 +467,7 @@ void Audio::stopSong()
//---------------------------------------------------------------------------------------------------------------------
void Audio::softReset()
{
if(VS1053_RST>0) return; // Hard resrt present
// if(VS1053_RST>0) return; // Hard resrt present
write_register(SCI_MODE, _BV (SM_SDINEW) | _BV(SM_RESET));
delay(10);
await_data_request();
Expand Down Expand Up @@ -1571,6 +1571,12 @@ void Audio::setDefaults(){
void Audio::setVUmeter() {
// if(!ENABLE_VU_METER) return;
uint16_t MP3Status = read_register(SCI_STATUS);
if(MP3Status==0) {
Serial.println("VS1053 Error: Unable to write SCI_STATUS");
_vuInitalized = false;
return;
}
_vuInitalized = true;
write_register(SCI_STATUS, MP3Status | _BV(9));
}

Expand All @@ -1588,6 +1594,7 @@ void Audio::setVUmeter() {
*/
void Audio::getVUlevel() {
// if(!ENABLE_VU_METER) return;
if(!_vuInitalized) return;
int16_t reg = read_register(SCI_AICTRL3);
uint8_t rl = map((uint8_t)reg, 85, 92, 0, 255);
uint8_t rr = map((uint8_t)(reg >> 8), 85, 92, 0, 255);
Expand Down
3 changes: 2 additions & 1 deletion yoRadio/src/audioVS1053/audioVS1053Ex.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ class Audio : private AudioBuffer{
bool m_f_stream_ready=false; // Set after connecttohost and first streamdata are available
bool m_f_unsync = false;
bool m_f_exthdr = false; // ID3 extended header

bool _vuInitalized;

const char volumetable[22]={ 0,50,60,65,70,75,80,82,84,86,
88,90,91,92,93,94,95,96,97,98,99,100}; //22 elements
protected:
Expand Down

0 comments on commit 19fede3

Please sign in to comment.