drivers/dfplayer: fix error handling
The error code was previously overwritten :-/ this clearly is not how it is intended to work. (cherry picked from commit 0bc08dfbbc538138758391f32a3ea1b4fcc04312)
This commit is contained in:
parent
f5793c375e
commit
fdcda067ad
@ -416,13 +416,12 @@ int dfplayer_file_cmd(dfplayer_t *dev, uint8_t cmd, uint8_t p1, uint8_t p2)
|
||||
* We just check if the DFPlayer is actually playing
|
||||
*/
|
||||
if (gpio_is_valid(dev->busy_pin)) {
|
||||
retval = 0;
|
||||
/* Using BUSY pin to check if device is playing */
|
||||
if (gpio_read(dev->busy_pin)) {
|
||||
/* Device not playing, file does not exist */
|
||||
retval = -ENOENT;
|
||||
}
|
||||
|
||||
retval = 0;
|
||||
}
|
||||
else {
|
||||
/* BUSY pin not connected, query status instead */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user