Start with speakers off.
This commit is contained in:
parent
bcf7625285
commit
3751904cb4
@ -70,6 +70,11 @@ void setup() {
|
|||||||
#endif
|
#endif
|
||||||
INFO("Initializing...\n");
|
INFO("Initializing...\n");
|
||||||
|
|
||||||
|
PIN_SPEAKER_L_SETUP();
|
||||||
|
PIN_SPEAKER_R_SETUP();
|
||||||
|
PIN_SPEAKER_L(LOW);
|
||||||
|
PIN_SPEAKER_R(LOW);
|
||||||
|
|
||||||
DEBUG("Setting up SPI...\n");
|
DEBUG("Setting up SPI...\n");
|
||||||
SPI.begin();
|
SPI.begin();
|
||||||
SPI.setHwCs(false);
|
SPI.setHwCs(false);
|
||||||
|
@ -10,8 +10,6 @@ Player::Player(SPIMaster* s) {
|
|||||||
_spi = s;
|
_spi = s;
|
||||||
PIN_VS1053_XRESET_SETUP();
|
PIN_VS1053_XRESET_SETUP();
|
||||||
PIN_VS1053_XRESET(HIGH);
|
PIN_VS1053_XRESET(HIGH);
|
||||||
PIN_SPEAKER_L_SETUP();
|
|
||||||
PIN_SPEAKER_R_SETUP();
|
|
||||||
_speaker_off();
|
_speaker_off();
|
||||||
_spi->disable();
|
_spi->disable();
|
||||||
PIN_VS1053_DREQ_SETUP();
|
PIN_VS1053_DREQ_SETUP();
|
||||||
@ -534,6 +532,7 @@ bool Player::play() {
|
|||||||
if (_state != idle) return false;
|
if (_state != idle) return false;
|
||||||
if (_current_playlist == NULL) return false;
|
if (_current_playlist == NULL) return false;
|
||||||
if (_current_playlist->get_file_count()==0) return false;
|
if (_current_playlist->get_file_count()==0) return false;
|
||||||
|
_speaker_on();
|
||||||
_current_playlist->start();
|
_current_playlist->start();
|
||||||
String file;
|
String file;
|
||||||
if (!_current_playlist->get_current_file(&file)) {
|
if (!_current_playlist->get_current_file(&file)) {
|
||||||
|
@ -77,7 +77,6 @@ void Playlist::_examine_http_url(String url) {
|
|||||||
String ct = http->getContentType();
|
String ct = http->getContentType();
|
||||||
DEBUG("Content-Type is %s.\n", ct.c_str());
|
DEBUG("Content-Type is %s.\n", ct.c_str());
|
||||||
if (ct.startsWith("audio/x-mpegurl")) {
|
if (ct.startsWith("audio/x-mpegurl")) {
|
||||||
|
|
||||||
_parse_m3u(http);
|
_parse_m3u(http);
|
||||||
} else if (ct.startsWith("audio/")) {
|
} else if (ct.startsWith("audio/")) {
|
||||||
persistence = PERSIST_NONE;
|
persistence = PERSIST_NONE;
|
||||||
|
Loading…
Reference in New Issue
Block a user