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 @@ | |||
47 | #include "pcm_playback.h" | 47 | #include "pcm_playback.h" |
48 | #include "pcm_record.h" | 48 | #include "pcm_record.h" |
49 | 49 | ||
50 | extern int boost_counter; /* used for boost check */ | ||
50 | 51 | ||
51 | /***************************************************************************/ | 52 | /***************************************************************************/ |
52 | 53 | ||
@@ -552,12 +553,19 @@ static void pcmrec_callback(bool flush) | |||
552 | 553 | ||
553 | if (num_free <= WRITE_THRESHOLD || flush) | 554 | if (num_free <= WRITE_THRESHOLD || flush) |
554 | { | 555 | { |
556 | bool must_boost = (boost_counter ? false : true); | ||
557 | |||
555 | logf("writing: %d (%d)", num_ready, flush); | 558 | logf("writing: %d (%d)", num_ready, flush); |
556 | 559 | ||
560 | if(must_boost) | ||
561 | cpu_boost(true); | ||
562 | |||
557 | for (i=0; i<num_ready; i++) | 563 | for (i=0; i<num_ready; i++) |
558 | { | 564 | { |
559 | if (write(wav_file, GET_CHUNK(read_index), CHUNK_SIZE) != CHUNK_SIZE) | 565 | if (write(wav_file, GET_CHUNK(read_index), CHUNK_SIZE) != CHUNK_SIZE) |
560 | { | 566 | { |
567 | if(must_boost) | ||
568 | cpu_boost(false); | ||
561 | logf("pcmrec: write err"); | 569 | logf("pcmrec: write err"); |
562 | pcmrec_dma_stop(); | 570 | pcmrec_dma_stop(); |
563 | return; | 571 | return; |
@@ -571,6 +579,9 @@ static void pcmrec_callback(bool flush) | |||
571 | yield(); | 579 | yield(); |
572 | } | 580 | } |
573 | 581 | ||
582 | if(must_boost) | ||
583 | cpu_boost(false); | ||
584 | |||
574 | /* sync file */ | 585 | /* sync file */ |
575 | fsync(wav_file); | 586 | fsync(wav_file); |
576 | 587 | ||