Skip to content

Commit

Permalink
C_ACK_TIMEOUT (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
Makuna authored Nov 12, 2023
1 parent c6f4ee7 commit 5eed63f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/DFMiniMp3.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ License along with DFMiniMp3. If not, see
#include "Mp3ChipIncongruousNoAck.h"


template <class T_SERIAL_METHOD, class T_NOTIFICATION_METHOD, class T_CHIP_VARIANT = Mp3ChipOriginal>
template <class T_SERIAL_METHOD, class T_NOTIFICATION_METHOD, class T_CHIP_VARIANT = Mp3ChipOriginal, uint32_t C_ACK_TIMEOUT = 900>
class DFMiniMp3
{
public:
Expand Down Expand Up @@ -374,7 +374,7 @@ class DFMiniMp3
#endif
};

const uint32_t c_AckTimeout = 900;
const uint32_t c_AckTimeout = C_ACK_TIMEOUT;
const uint32_t c_NoAckTimeout = 50; // 30ms observerd, added a little overhead

T_SERIAL_METHOD& _serial;
Expand Down Expand Up @@ -555,7 +555,8 @@ class DFMiniMp3
// with ack support,
// we may retry if we don't get what we expected
//
_serial.setTimeout(c_AckTimeout); do
_serial.setTimeout(c_AckTimeout);
do
{
sendPacket(command, arg, requestAck);
reply = listenForReply(expectedCommand);
Expand Down

0 comments on commit 5eed63f

Please sign in to comment.