DFPlayer: refix Bug created with PR 4758 (#5861)

This commit is contained in:
sandronidi 2024-03-09 03:16:21 +01:00 committed by GitHub
parent 13736b5c57
commit 90f416bd0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,10 +7,10 @@ namespace dfplayer {
static const char *const TAG = "dfplayer";
void DFPlayer::play_folder(uint16_t folder, uint16_t file) {
if (folder <= 10 && file <= 1000) {
if (folder < 100 && file < 256) {
this->ack_set_is_playing_ = true;
this->send_cmd_(0x0F, (uint8_t) folder, (uint8_t) file);
} else if (folder < 100 && file < 256) {
} else if (folder <= 15 && file <= 3000) {
this->ack_set_is_playing_ = true;
this->send_cmd_(0x14, (((uint16_t) folder) << 12) | file);
} else {