mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
drivers/dfplayer: fix error handling
The error code was previously overwritten :-/ this clearly is not how it is intended to work.
This commit is contained in:
parent
b35e4f4a95
commit
0bc08dfbbc
@ -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…
Reference in New Issue
Block a user