diff options
Diffstat (limited to 'firmware/pcm_record.c')
-rw-r--r-- | firmware/pcm_record.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/firmware/pcm_record.c b/firmware/pcm_record.c index ea444a31e1..2d9c65a7e4 100644 --- a/firmware/pcm_record.c +++ b/firmware/pcm_record.c @@ -47,6 +47,7 @@ #include "pcm_playback.h" #include "pcm_record.h" +extern int boost_counter; /* used for boost check */ /***************************************************************************/ @@ -552,12 +553,19 @@ static void pcmrec_callback(bool flush) if (num_free <= WRITE_THRESHOLD || flush) { + bool must_boost = (boost_counter ? false : true); + logf("writing: %d (%d)", num_ready, flush); + if(must_boost) + cpu_boost(true); + for (i=0; i<num_ready; i++) { if (write(wav_file, GET_CHUNK(read_index), CHUNK_SIZE) != CHUNK_SIZE) { + if(must_boost) + cpu_boost(false); logf("pcmrec: write err"); pcmrec_dma_stop(); return; @@ -571,6 +579,9 @@ static void pcmrec_callback(bool flush) yield(); } + if(must_boost) + cpu_boost(false); + /* sync file */ fsync(wav_file); |