Fix RAM disk when no audio buffer is available

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19814 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Maurus Cuelenaere 2009-01-21 20:52:35 +00:00
parent ae351903a6
commit 868a4bdbc3

View file

@ -403,6 +403,10 @@ void usb_storage_init_connection(void)
static unsigned char _transfer_buffer[BUFFER_SIZE*2] static unsigned char _transfer_buffer[BUFFER_SIZE*2]
USB_DEVBSS_ATTR __attribute__((aligned(32))); USB_DEVBSS_ATTR __attribute__((aligned(32)));
tb.transfer_buffer = (void *)_transfer_buffer; tb.transfer_buffer = (void *)_transfer_buffer;
#ifdef USB_USE_RAMDISK
static unsigned char _ramdisk_buffer[RAMDISK_SIZE*SECTOR_SIZE];
ramdisk_buffer = _ramdisk_buffer;
#endif
#else #else
/* TODO : check if bufsize is at least 32K ? */ /* TODO : check if bufsize is at least 32K ? */
size_t bufsize; size_t bufsize;
@ -412,9 +416,9 @@ void usb_storage_init_connection(void)
tb.transfer_buffer = tb.transfer_buffer =
(void *)UNCACHED_ADDR((unsigned int)(audio_buffer + 31) & 0xffffffe0); (void *)UNCACHED_ADDR((unsigned int)(audio_buffer + 31) & 0xffffffe0);
invalidate_icache(); invalidate_icache();
#endif
#ifdef USB_USE_RAMDISK #ifdef USB_USE_RAMDISK
ramdisk_buffer = tb.transfer_buffer + BUFFER_SIZE*2; ramdisk_buffer = tb.transfer_buffer + BUFFER_SIZE*2;
#endif
#endif #endif
usb_drv_recv(ep_out, tb.transfer_buffer, 1024); usb_drv_recv(ep_out, tb.transfer_buffer, 1024);
} }