Makuna / DFMiniMp3

Arduino library for the DFPlayer Mini Mp3 module. Please refer to the Wiki for more details. Please use the GitHub Discussions ask questions as the GitHub Issues feature is used for bug tracking.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve getTotalTrackCount taking into account USB and SD

ghmartin77 opened this issue · comments

Introduce different methods for USB and SD:

    uint16_t getTotalTrackCountUsb()
    {
        drainResponses();
        sendPacket(0x47);
        uint16_t result = listenForReply(0x47);
        return result;
    }

    uint16_t getTotalTrackCountSd()
    {
        drainResponses();
        sendPacket(0x48);
        uint16_t result = listenForReply(0x48);
        return result;
    }

For backwards-compatibility implement getTotalTrackCount() based on PlaybackSource set invoking one or the other. Please also see #37.

v.1.0.6