From 9a25a6fe19bc798bb7d90ec63e3c54bd8c2892cd Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sun, 19 Feb 2012 00:33:04 -0500 Subject: beep/mixer code: Code police a bit. /firmware is in the #include path with makes #include "asm/beep.c" sufficient. Add a comment to generic beep code and make another express intent better. Change-Id: I587cd704478b894785927bdfe2e647e28614df62 --- apps/beep.c | 2 +- firmware/asm/beep.c | 1 + firmware/pcm_mixer.c | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/beep.c b/apps/beep.c index 79c7f1d2bc..d3345afdf9 100644 --- a/apps/beep.c +++ b/apps/beep.c @@ -27,7 +27,7 @@ #include "misc.h" /** Beep generation, CPU optimized **/ -#include "../firmware/asm/beep.c" +#include "asm/beep.c" static uint32_t beep_phase; /* Phase of square wave generator */ static uint32_t beep_step; /* Step of square wave generator on each sample */ diff --git a/firmware/asm/beep.c b/firmware/asm/beep.c index 0314e32715..d430dff14d 100644 --- a/firmware/asm/beep.c +++ b/firmware/asm/beep.c @@ -24,6 +24,7 @@ #include "m68k/beep.c" #else /* Generic */ +/* Actually output samples into beep_buf */ static FORCE_INLINE void beep_generate(int16_t *out, int count, uint32_t *phase, uint32_t step, int16_t amplitude) diff --git a/firmware/pcm_mixer.c b/firmware/pcm_mixer.c index fcd9a1c4fd..4fd96bc97c 100644 --- a/firmware/pcm_mixer.c +++ b/firmware/pcm_mixer.c @@ -271,7 +271,9 @@ void mixer_channel_play_data(enum pcm_mixer_channel channel, { /* Initial buffer not passed - call the callback now */ pcm_play_lock(); - mixer_deactivate_channel(chan); /* Protect chan struct if active */ + mixer_deactivate_channel(chan); /* Protect chan struct if active; + may also be same callback which + must not be reentered */ pcm_play_unlock(); /* Allow playback while doing callback */ size = 0; -- cgit v1.2.3