Skip to content
Snippets Groups Projects
Commit e87fae30 authored by Stefan Gehr's avatar Stefan Gehr
Browse files

add option to respect busy pin in playFile

parent c229826e
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
#define MP3_H
void mp3Setup(void);
void playFile(uint8_t fileNumber);
void playFile(uint8_t fileNumber, bool respectBusyPin);
void mp3Loop(void);
void playFileQueue(uint8_t fileNumber);
......
......@@ -14,8 +14,12 @@ void mp3Setup(void) {
//mp3.sendCommand(CMD_SEL_DEV, 0, 2); //select sd-card
}
// immediately play a file, ignoring any queue or BUSY pin
void playFile(uint8_t fileNumber) {
// immediately play a file
void playFile(uint8_t fileNumber, bool respectBusyPin) {
// do nothing if we want to wait for the BUSY pin
if (respectBusyPin && digitalRead(MP3BUSY)) {
return;
}
mp3.write(fileNumber);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment