File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ uint16_t DFRobotDFPlayerMini::calculateCheckSum(uint8_t *buffer){
33
33
void DFRobotDFPlayerMini::sendStack (){
34
34
if (_sending[Stack_ACK]) {
35
35
while (_isSending) {
36
+ delay (0 );
36
37
available ();
37
38
}
38
39
}
@@ -81,7 +82,9 @@ void DFRobotDFPlayerMini::disableACK(){
81
82
82
83
bool DFRobotDFPlayerMini::waitAvailable (){
83
84
_isSending = true ;
84
- while (!available ());
85
+ while (!available ()){
86
+ delay (0 );
87
+ }
85
88
return _handleType != TimeOut;
86
89
}
87
90
@@ -195,6 +198,7 @@ bool DFRobotDFPlayerMini::validateStack(){
195
198
196
199
bool DFRobotDFPlayerMini::available (){
197
200
while (_serial->available ()) {
201
+ delay (0 );
198
202
if (_receivedIndex == 0 ) {
199
203
_received[Stack_Header] = _serial->read ();
200
204
#ifdef _DEBUG
@@ -394,7 +398,6 @@ int DFRobotDFPlayerMini::readVolume(){
394
398
395
399
uint8_t DFRobotDFPlayerMini::readEQ (){
396
400
sendStack (0x44 );
397
- while (!available ());
398
401
if (waitAvailable ()) {
399
402
return read ();
400
403
}
Original file line number Diff line number Diff line change 1
1
/* **************************************************
2
2
DFPlayer - A Mini MP3 Player For Arduino
3
- <https://www.dfrobot.com/index.php?route=product/product&product_id=1121>
3
+ <https://www.dfrobot.com/index.php?route=product/product&search=mp3&description=true& product_id=1121>
4
4
5
5
***************************************************
6
6
This example shows the basic function of library for DFPlayer.
7
7
8
- Created 2016-12-07
8
+ Created 2014-8-28
9
9
By [Angelo qiao]([email protected] )
10
10
11
11
GNU Lesser General Public License.
@@ -15,7 +15,7 @@ DFPlayer - A Mini MP3 Player For Arduino
15
15
16
16
/* **********Notice and Trouble shooting***************
17
17
1.Connection and Diagram can be found here
18
- <https://www.dfrobot.com/wiki/index.php/DFPlayer_Mini_SKU:DFR0299#Connection_Diagram >
18
+ <>
19
19
2.This code is tested on Arduino Uno, Leonardo, Mega boards.
20
20
****************************************************/
21
21
@@ -40,7 +40,9 @@ void setup()
40
40
Serial.println (F (" Unable to begin:" ));
41
41
Serial.println (F (" 1.Please recheck the connection!" ));
42
42
Serial.println (F (" 2.Please insert the SD card!" ));
43
- while (true );
43
+ while (true ){
44
+ delay (0 ); // Code to compatible with ESP8266 watch dog.
45
+ }
44
46
}
45
47
Serial.println (F (" DFPlayer Mini online." ));
46
48
You can’t perform that action at this time.
0 commit comments