From ac9063395d65ecbade30f240a9b2e2535724bbd9 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 25 Aug 2020 18:09:31 +0700 Subject: [PATCH] more clean up --- cores/nRF5/Tone.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cores/nRF5/Tone.cpp b/cores/nRF5/Tone.cpp index 462af999..df33e34f 100644 --- a/cores/nRF5/Tone.cpp +++ b/cores/nRF5/Tone.cpp @@ -370,13 +370,9 @@ bool TonePwmConfig::startPlayback(void) { bool TonePwmConfig::stopPlayback(bool releaseOwnership) { - bool notInIsr = !isInISR(); - if (!_HwPWM->isOwner(TonePwmConfig::toneToken)) { - if (notInIsr) { - LOG_LV2("TON", "Attempt to set noTone when not the owner of the PWM peripheral. Ignoring call...."); - } - return false; + LOG_LV2("TON", "Attempt to set noTone when not the owner of the PWM peripheral. Ignoring call...."); + return false; } // ensure stopped and then disable if (_is_pwm_enabled(_PWMInstance)) { @@ -388,5 +384,6 @@ bool TonePwmConfig::stopPlayback(bool releaseOwnership) { if (releaseOwnership) { _HwPWM->releaseOwnership(TonePwmConfig::toneToken); } + return true; }