summaryrefslogtreecommitdiffstats
path: root/firmware/usb.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-12-13 02:48:36 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-12-13 02:48:36 +0000
commit826688e69953530d6ccadb77df05395940b8fe30 (patch)
treeb9d83559f8930b8c4fb6c57466d5328469425051 /firmware/usb.c
parentcc57381707a2372809ce5398fa49cef64ec138bc (diff)
downloadrockbox-826688e69953530d6ccadb77df05395940b8fe30.tar.gz
rockbox-826688e69953530d6ccadb77df05395940b8fe30.zip
PCM buffer beeping needs the audio buffer reset in order to work after operations that trash the buffer or keyclick won't be audible until playback is restarted.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19413 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/usb.c')
-rw-r--r--firmware/usb.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/firmware/usb.c b/firmware/usb.c
index 95c33ad8e9..eb040a60a0 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -125,6 +125,17 @@ static void usb_slave_mode(bool on)
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