diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/export/audio.h | 1 | ||||
-rw-r--r-- | firmware/usb.c | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/firmware/export/audio.h b/firmware/export/audio.h index b4a2c82200..8320642947 100644 --- a/firmware/export/audio.h +++ b/firmware/export/audio.h @@ -112,6 +112,7 @@ 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/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 |