1
0
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:
Marian Buschsieweke 2021-01-21 10:35:23 +01:00
parent b35e4f4a95
commit 0bc08dfbbc
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F

View File

@ -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 */