From 5f3d871d91d6fed7a359e35fd707ee42c644b9ed Mon Sep 17 00:00:00 2001 From: Henry Gabryjelski Date: Tue, 11 Aug 2020 23:42:17 -0700 Subject: [PATCH] @hathach says internal classes should not guard against API misuse ... I disagree but he is the gatekeeper --- cores/nRF5/Tone.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/cores/nRF5/Tone.cpp b/cores/nRF5/Tone.cpp index 5bd1c9dd..36e6bdbb 100644 --- a/cores/nRF5/Tone.cpp +++ b/cores/nRF5/Tone.cpp @@ -64,7 +64,6 @@ class TonePwmConfig { uint8_t nrf_pin; //< the nrf pin for playback nrf_pwm_task_t task_to_start; //< Whether to start playback at SEQ0 or SEQ1 nrf_pwm_short_mask_t shorts; //< shortcuts to enable - boolean is_initialized; //< defaults to uninitialized public: bool ensurePwmPeripheralOwnership(void); @@ -330,13 +329,9 @@ bool TonePwmConfig::initializeFromPulseCountAndTimePeriod(uint64_t pulse_count_x this->seq1_refresh = (total_refresh_count - seq0_count) - 1; this->shorts = NRF_PWM_SHORT_LOOPSDONE_STOP_MASK; } - this->is_initialized = true; return true; } bool TonePwmConfig::applyConfiguration(uint32_t pin) { - if (!this->is_initialized) { - return false; - } if (pin >= PINS_COUNT) { return false; } @@ -389,10 +384,6 @@ bool TonePwmConfig::applyConfiguration(uint32_t pin) { return true; } bool TonePwmConfig::startPlayback(void) { - if (!this->is_initialized) { - LOG_LV1("TON", "Cannot start playback without first initializing"); - return false; - } if (!this->ensurePwmPeripheralOwnership()) { LOG_LV1("TON", "PWM peripheral not available for playback"); return false;