summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKattni <kattni@adafruit.com>2019-12-17 13:53:31 -0500
committerGitHub <noreply@github.com>2019-12-17 13:53:31 -0500
commit1108e8f2cca58db4a399d156ea892d21bb3b8fee (patch)
treea24d050b35d263f36deea6ced4a8401ea923547d
parentbe644228a24f7ca2bdcdb5d1a716a2f5bff085f8 (diff)
parent8137ac4c49257396e6ba513f68418cd72c8b0d8b (diff)
Merge pull request #2400 from jepler/nrf-rawsample-loop
nRF: PWMAudioOut: handle non-looping rawsamples
-rw-r--r--ports/nrf/common-hal/audiopwmio/PWMAudioOut.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c
index b4c626355..d9226628f 100644
--- a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c
+++ b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c
@@ -255,16 +255,18 @@ void common_hal_audiopwmio_pwmaudioout_play(audiopwmio_pwmaudioout_obj_t* self,
self->pwm->LOOP = 1;
audiosample_reset_buffer(self->sample, false, 0);
activate_audiopwmout_obj(self);
+ self->stopping = false;
+ self->pwm->SHORTS = NRF_PWM_SHORT_LOOPSDONE_SEQSTART0_MASK;
fill_buffers(self, 0);
self->pwm->SEQ[1].PTR = self->pwm->SEQ[0].PTR;
self->pwm->SEQ[1].CNT = self->pwm->SEQ[0].CNT;
self->pwm->EVENTS_SEQSTARTED[0] = 0;
self->pwm->EVENTS_SEQSTARTED[1] = 0;
+ self->pwm->EVENTS_SEQEND[0] = 0;
+ self->pwm->EVENTS_SEQEND[1] = 0;
self->pwm->EVENTS_STOPPED = 0;
- self->pwm->SHORTS = NRF_PWM_SHORT_LOOPSDONE_SEQSTART0_MASK;
self->pwm->TASKS_SEQSTART[0] = 1;
self->playing = true;
- self->stopping = false;
self->paused = false;
}