mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-02-16 22:19:14 +01:00
Update IO_DFPlayer.h
Ensure device goes off-line when not responding.
This commit is contained in:
parent
6b535654f8
commit
6fbaca7930
@ -231,11 +231,13 @@ protected:
|
|||||||
// Poll device every second that other commands aren't being sent,
|
// Poll device every second that other commands aren't being sent,
|
||||||
// to check if it's still connected and responding.
|
// to check if it's still connected and responding.
|
||||||
sendPacket(0x42);
|
sendPacket(0x42);
|
||||||
|
if (!_awaitingResponse) {
|
||||||
_timeoutTime = currentMicros + 5000000UL; // Timeout if no response within 5 seconds
|
_timeoutTime = currentMicros + 5000000UL; // Timeout if no response within 5 seconds
|
||||||
_awaitingResponse = true;
|
_awaitingResponse = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Write with value 1 starts playing a song. The relative pin number is the file number.
|
// Write with value 1 starts playing a song. The relative pin number is the file number.
|
||||||
// Write with value 0 stops playing.
|
// Write with value 0 stops playing.
|
||||||
|
Loading…
Reference in New Issue
Block a user