v0.4.292 - ir support

This commit is contained in:
e2002
2022-02-27 17:51:49 +03:00
parent 5aeec09366
commit 36e2f096de
15 changed files with 299 additions and 77 deletions

View File

@@ -376,7 +376,7 @@ void Audio::setVolume(uint8_t vol){
write_register(SCI_VOL, value);
}
//---------------------------------------------------------------------------------------------------------------------
void Audio::setTone(uint8_t *rtone){ // Set bass/treble (4 nibbles)
void Audio::setTone(int8_t *rtone){ // Set bass/treble (4 nibbles)
// Set tone characteristics. See documentation for the 4 nibbles.
uint16_t value=0; // Value to send to SCI_BASS
@@ -400,7 +400,7 @@ void Audio::setTone(int8_t gainLowPass, int8_t gainBandPass, int8_t gainHighPass
if(gainLowPass>15) gainLowPass=15;
if(gainBandPass<0) gainBandPass=0;
if(gainBandPass>13) gainBandPass=13;
uint8_t rtone[] = {map(gainHighPass, -16, 16, -8, 7), 2+gainBandPass, gainLowPass, 15-gainBandPass};
int8_t rtone[] = {(int8_t)map(gainHighPass, -16, 16, -8, 7), (int8_t)(2+gainBandPass), gainLowPass, (int8_t)(15-gainBandPass)};
setTone(rtone);
}
void Audio::setBalance(int8_t bal){

View File

@@ -248,7 +248,7 @@ public:
void begin() ; // Begin operation. Sets pins correctly and prepares SPI bus.
void stop_mp3client();
void setVolume(uint8_t vol); // Set the player volume.Level from 0-21, higher is louder.
void setTone(uint8_t* rtone); // Set the player baas/treble, 4 nibbles for treble gain/freq and bass gain/freq
void setTone(int8_t* rtone); // Set the player baas/treble, 4 nibbles for treble gain/freq and bass gain/freq
uint8_t getVolume(); // Get the current volume setting, higher is louder.
void printDetails(const char* str); // Print configuration details to serial output.
const char* printVersion(); // Print ID and version of vs1053 chip