evert-arias / EasyBuzzer

The Beep Library For Arduino
https://evert-arias.github.io/EasyBuzzer
MIT License
84 stars 22 forks source link

Sound does not stop if update() is delayed #10

Open mvackel opened 5 years ago

mvackel commented 5 years ago

If the update() function is delayed, for instance because of a long process, the sound does not stop.

Suggestion: Change, from line 122:

    if (!sequenceDuration || (mSequences != 0 && elapsedTime / sequenceDuration >= mSequences))
    {
        mStartTime = 0;
        if (mFinishedCallbackFunction)
        {
            mFinishedCallbackFunction();
        }
        return;
    };

To:

    if (!sequenceDuration || (mSequences != 0 && elapsedTime / sequenceDuration >= mSequences))
    {
        mStartTime = 0;
        if (mFinishedCallbackFunction)
        {
            mFinishedCallbackFunction();
        }
#if defined ESP32
        ledcDetachPin(mPin);
#else
        noTone(mPin);
#endif
        return;
    };
sixtyfive commented 4 years ago

Spent two hours trying to debug this until I had the idea to come and check for an existing Issue. I guess the fact that it's more than a year old means that the project is abandoned?

evert-arias commented 4 years ago

Hi @sixtyfive I am not actively working on this repository but in the next few days I will be solving this particular issue.

sixtyfive commented 4 years ago

Thank you for the quick response, Evert, and sorry for the hopefully not too brazen assumption!

evert-arias commented 4 years ago

Thank you for the quick response, Evert, and sorry for the hopefully not too brazen assumption!

Not at all 👍

iqfareez commented 2 years ago

Hi hii. So have any updates on this issue?