Skip to content

Commit 5f3d871

Browse files
committed
@hathach says internal classes should not guard against API misuse ... I disagree but he is the gatekeeper
1 parent a7ffaaa commit 5f3d871

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

cores/nRF5/Tone.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class TonePwmConfig {
6464
uint8_t nrf_pin; //< the nrf pin for playback
6565
nrf_pwm_task_t task_to_start; //< Whether to start playback at SEQ0 or SEQ1
6666
nrf_pwm_short_mask_t shorts; //< shortcuts to enable
67-
boolean is_initialized; //< defaults to uninitialized
6867

6968
public:
7069
bool ensurePwmPeripheralOwnership(void);
@@ -330,13 +329,9 @@ bool TonePwmConfig::initializeFromPulseCountAndTimePeriod(uint64_t pulse_count_x
330329
this->seq1_refresh = (total_refresh_count - seq0_count) - 1;
331330
this->shorts = NRF_PWM_SHORT_LOOPSDONE_STOP_MASK;
332331
}
333-
this->is_initialized = true;
334332
return true;
335333
}
336334
bool TonePwmConfig::applyConfiguration(uint32_t pin) {
337-
if (!this->is_initialized) {
338-
return false;
339-
}
340335
if (pin >= PINS_COUNT) {
341336
return false;
342337
}
@@ -389,10 +384,6 @@ bool TonePwmConfig::applyConfiguration(uint32_t pin) {
389384
return true;
390385
}
391386
bool TonePwmConfig::startPlayback(void) {
392-
if (!this->is_initialized) {
393-
LOG_LV1("TON", "Cannot start playback without first initializing");
394-
return false;
395-
}
396387
if (!this->ensurePwmPeripheralOwnership()) {
397388
LOG_LV1("TON", "PWM peripheral not available for playback");
398389
return false;

0 commit comments

Comments
 (0)