You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In void DFRobotDFPlayerMini::parseStack() the media online reporting code is case 0x3F: if (_handleParameter & 0x01) { handleMessage(DFPlayerUSBOnline, _handleParameter); } else if (_handleParameter & 0x02) { handleMessage(DFPlayerCardOnline, _handleParameter); } else if (_handleParameter & 0x03) { handleMessage(DFPlayerCardUSBOnline, _handleParameter); } break;
If a USB and SD are both online the last else if is unreachable because of the bitwise & testing. Currently it would only report the USB as online.
I think each test should be if (_handleParameter == 0x0?) where ? is 1, 2 or 3.
I thought about reversing the order of tests, putting if (_handleParameter == 0x03) first. But that would return non zero i.e. true if either or both USB and/or SD were online.
I leave the matter for your review; I suspect very few users employ both USB and SD so the library has worked for us.
Thanks.
The text was updated successfully, but these errors were encountered:
In
void DFRobotDFPlayerMini::parseStack()
the media online reporting code iscase 0x3F: if (_handleParameter & 0x01) { handleMessage(DFPlayerUSBOnline, _handleParameter); } else if (_handleParameter & 0x02) { handleMessage(DFPlayerCardOnline, _handleParameter); } else if (_handleParameter & 0x03) { handleMessage(DFPlayerCardUSBOnline, _handleParameter); } break;
If a USB and SD are both online the last
else if
is unreachable because of the bitwise&
testing. Currently it would only report the USB as online.I think each test should be
if (_handleParameter == 0x0?)
where ? is 1, 2 or 3.I thought about reversing the order of tests, putting
if (_handleParameter == 0x03)
first. But that would return non zero i.e. true if either or both USB and/or SD were online.I leave the matter for your review; I suspect very few users employ both USB and SD so the library has worked for us.
Thanks.
The text was updated successfully, but these errors were encountered: