n5110_crash_fix_127

This commit is contained in:
e2002
2023-03-26 21:28:22 +03:00
parent 4c9f1bdbb0
commit d2193350f8
8 changed files with 21 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
#ifndef options_h
#define options_h
#define YOVERSION "0.9.122"
#define YOVERSION "0.9.127"
/*******************************************************
DO NOT EDIT THIS FILE.
@@ -257,6 +257,9 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti
#ifndef MUTE_VAL
#define MUTE_VAL HIGH // Write this to MUTE_PIN when player is stopped
#endif
#ifndef MUTE_LOCK
#define MUTE_LOCK false // for vs1053 Shield rev2 - lock MUTE_PIN to !MUTE_VAL
#endif
#ifndef BRIGHTNESS_PIN
#define BRIGHTNESS_PIN 255 // BRIGHTNESS Pin
#endif

View File

@@ -37,7 +37,8 @@ void Player::init() {
Serial.print("##[BOOT]#\tplayer.init\t");
playerQueue=NULL;
playerQueue = xQueueCreate( 5, sizeof( playerRequestParams_t ) );
setOutputPins(false);
delay(50);
memset(_plError, 0, PLERR_LN);
#ifdef MQTT_ROOT_TOPIC
memset(burl, 0, MQTT_BURL_SIZE);
@@ -56,7 +57,7 @@ void Player::init() {
setTone(config.store.bass, config.store.middle, config.store.trebble);
setVolume(0);
_status = STOPPED;
setOutputPins(false);
//setOutputPins(false);
_volTimer=false;
playmutex = xSemaphoreCreateMutex();
randomSeed(analogRead(0));
@@ -159,7 +160,8 @@ void Player::loop() {
void Player::setOutputPins(bool isPlaying) {
if(LED_BUILTIN!=255) digitalWrite(LED_BUILTIN, LED_INVERT?!isPlaying:isPlaying);
if(MUTE_PIN!=255) digitalWrite(MUTE_PIN, isPlaying?!MUTE_VAL:MUTE_VAL);
bool _ml = MUTE_LOCK?!MUTE_VAL:(isPlaying?!MUTE_VAL:MUTE_VAL);
if(MUTE_PIN!=255) digitalWrite(MUTE_PIN, _ml);
}
void Player::_play(uint16_t stationId) {