summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-12-13 06:01:08 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-12-13 06:01:08 +0000
commit93572e2a9e651b7d0bffae491da3d2ece2f0c2d2 (patch)
treeec4f1b6c6634b4e6d70aee6165e60d91b6201b7e /firmware
parentbdcdf8b5e463a581f67639db9d0bd6735ac218e0 (diff)
downloadrockbox-93572e2a9e651b7d0bffae491da3d2ece2f0c2d2.tar.gz
rockbox-93572e2a9e651b7d0bffae491da3d2ece2f0c2d2.tar.bz2
rockbox-93572e2a9e651b7d0bffae491da3d2ece2f0c2d2.zip
Keyclick fixup take two. It is only 88 samples (2msec) long so keep a small static buffer around for beeps less than or equal to keyclick duration. This way it operates no matter the buffer state and still won't interfere with alternate PCM operations like recording or plugin playback.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19415 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/audio.h1
-rw-r--r--firmware/export/pcm.h3
-rw-r--r--firmware/pcm.c5
-rw-r--r--firmware/usb.c12
4 files changed, 8 insertions, 13 deletions
diff --git a/firmware/export/audio.h b/firmware/export/audio.h
index 8320642947..b4a2c82200 100644
--- a/firmware/export/audio.h
+++ b/firmware/export/audio.h
@@ -112,7 +112,6 @@ enum audio_buffer_state
AUDIOBUF_STATE_VOICED_ONLY = 1, /* voice-only */
};
int audio_buffer_state(void);
-void audio_buffer_reset(void);
#endif
/* channel modes */
diff --git a/firmware/export/pcm.h b/firmware/export/pcm.h
index ac8ddb1b3c..053f954767 100644
--- a/firmware/export/pcm.h
+++ b/firmware/export/pcm.h
@@ -126,6 +126,9 @@ void pcm_record_data(pcm_more_callback_type2 more_ready,
/* Stop tranferring data into supplied buffer */
void pcm_stop_recording(void);
+/* Is pcm currently recording? */
+bool pcm_is_recording(void);
+
/* Continue transferring data in - call during interrupt handler */
void pcm_record_more(void *start, size_t size);
diff --git a/firmware/pcm.c b/firmware/pcm.c
index 0b5b49ebab..19bba4143e 100644
--- a/firmware/pcm.c
+++ b/firmware/pcm.c
@@ -478,6 +478,11 @@ void pcm_stop_recording(void)
pcm_rec_unlock();
} /* pcm_stop_recording */
+bool pcm_is_recording(void)
+{
+ return pcm_recording;
+}
+
void pcm_rec_dma_stopped_callback(void)
{
pcm_recording = false;
diff --git a/firmware/usb.c b/firmware/usb.c
index eb040a60a0..ec47e0653c 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -124,18 +124,6 @@ static void usb_slave_mode(bool on)
rc = disk_mount_all();
if (rc <= 0) /* no partition */
panicf("mount: %d",rc);
-
-#ifndef BOOTLOADER
-#if CONFIG_CPU == IMX31L || CONFIG_USBOTG == USBOTG_ISP1583 || \
- defined(CPU_TCC77X) || defined(CPU_TCC780X)
- /* These use a static transfer buffer */
-#elif defined(USB_STORAGE) && !defined (HAVE_HARDWARE_BEEP)
- /* Storage can use the audio buffer, restore it if it did to get
- * keyclicks back. */
- if (audio_buffer_state() == BUFFER_STATE_TRASHED)
- audio_buffer_reset();
-#endif /* USB_STORAGE */
-#endif /* BOOTLOADER */
}
}
#endif