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

@@ -4246,7 +4246,7 @@ void Audio::setBalance(int8_t bal){ // bal -16...16
}
//---------------------------------------------------------------------------------------------------------------------
void Audio::setVolume(uint8_t vol) { // vol 22 steps, 0...21
if(vol > 256) vol = 256;
if(vol > 255) vol = 255;
//volume = map(eeprom_config.volume, 0, 21, 0, 255);
//m_vol = map(vol, 0, 254, 0, 64);
m_vol = vol;

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

View File

@@ -10,7 +10,6 @@
#define TFT_LINEHGHT 8
#define TFT_FRAMEWDT 0
#define TFT_CONTRAST 55
#define PLMITEMS 7
#define PLMITEMLENGHT 40

View File

@@ -123,7 +123,7 @@ void DisplaySSD1306::apScreen() {
}
void DisplaySSD1306::initD(uint16_t &screenwidth, uint16_t &screenheight) {
I2CSSD1306.begin(I2C_SDA, I2C_SCL, 400000);
I2CSSD1306.begin(I2C_SDA, I2C_SCL, (uint32_t)400000);
if (!begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
Serial.println(F("SSD1306 allocation failed"));
for (;;); // Don't proceed, loop forever