mirror of
https://github.com/DFRobot/DFRobotDFPlayerMini.git
synced 2026-03-02 23:04:01 +01:00
Merge pull request #19 from iZhangHui/master
fix failure to initialize issue
This commit is contained in:
@@ -34,7 +34,7 @@ void DFRobotDFPlayerMini::sendStack(){
|
||||
if (_sending[Stack_ACK]) { //if the ack mode is on wait until the last transmition
|
||||
while (_isSending) {
|
||||
delay(0);
|
||||
available();
|
||||
waitAvailable();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ bool DFRobotDFPlayerMini::waitAvailable(unsigned long duration){
|
||||
}
|
||||
while (!available()){
|
||||
if (millis() - timer > duration) {
|
||||
return false;
|
||||
return handleError(TimeOut);
|
||||
}
|
||||
delay(0);
|
||||
}
|
||||
@@ -281,9 +281,6 @@ bool DFRobotDFPlayerMini::available(){
|
||||
}
|
||||
}
|
||||
|
||||
if (_isSending && (millis()-_timeOutTimer>=_timeOutDuration)) {
|
||||
return handleError(TimeOut);
|
||||
}
|
||||
|
||||
return _isAvailable;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user