evert-arias / EasyBuzzer

The Beep Library For Arduino

Home Page:https://evert-arias.github.io/EasyBuzzer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sound does not stop if update() is delayed

mvackel opened this issue · comments

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;
	};

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?

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

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

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

Not at all 👍

Hi hii. So have any updates on this issue?