mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-10 05:35:20 -05:00
usb: fix usb_storage_disconnect shouldn't call core_free for static buffer
Fixes Sansa e200v2 bootloader doesn't boot after 3301c5a
Change-Id: I8f4780961203beb18863f5d2b1f1e61857c4fe27
This commit is contained in:
parent
52e22b253d
commit
777098fca9
1 changed files with 10 additions and 5 deletions
|
|
@ -425,17 +425,20 @@ int usb_storage_get_config_descriptor(unsigned char *dest,int max_packet_size)
|
||||||
|
|
||||||
return (dest - orig_dest);
|
return (dest - orig_dest);
|
||||||
}
|
}
|
||||||
|
#if (CONFIG_CPU == IMX31L || defined(CPU_TCC780X) || \
|
||||||
static int usb_handle;
|
CONFIG_CPU == S5L8702 || CONFIG_CPU == S5L8701 || CONFIG_CPU == AS3525v2 || \
|
||||||
|
defined(BOOTLOADER) || CONFIG_CPU == DM320) && !defined(CPU_PP502x)
|
||||||
|
#define USB_STATIC_ALLOC
|
||||||
|
#else
|
||||||
|
static int usb_handle = 0;
|
||||||
|
#endif
|
||||||
void usb_storage_init_connection(void)
|
void usb_storage_init_connection(void)
|
||||||
{
|
{
|
||||||
logf("ums: set config");
|
logf("ums: set config");
|
||||||
/* prime rx endpoint. We only need room for commands */
|
/* prime rx endpoint. We only need room for commands */
|
||||||
state = WAITING_FOR_COMMAND;
|
state = WAITING_FOR_COMMAND;
|
||||||
|
|
||||||
#if (CONFIG_CPU == IMX31L || defined(CPU_TCC780X) || \
|
#ifdef USB_STATIC_ALLOC
|
||||||
CONFIG_CPU == S5L8702 || CONFIG_CPU == S5L8701 || CONFIG_CPU == AS3525v2 || \
|
|
||||||
defined(BOOTLOADER) || CONFIG_CPU == DM320) && !defined(CPU_PP502x)
|
|
||||||
static unsigned char _cbw_buffer[MAX_CBW_SIZE]
|
static unsigned char _cbw_buffer[MAX_CBW_SIZE]
|
||||||
USB_DEVBSS_ATTR __attribute__((aligned(32)));
|
USB_DEVBSS_ATTR __attribute__((aligned(32)));
|
||||||
cbw_buffer = (void *)_cbw_buffer;
|
cbw_buffer = (void *)_cbw_buffer;
|
||||||
|
|
@ -480,7 +483,9 @@ void usb_storage_init_connection(void)
|
||||||
|
|
||||||
void usb_storage_disconnect(void)
|
void usb_storage_disconnect(void)
|
||||||
{
|
{
|
||||||
|
#ifndef USB_STATIC_ALLOC
|
||||||
usb_handle = core_free(usb_handle);
|
usb_handle = core_free(usb_handle);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* called by usb_core_transfer_complete() */
|
/* called by usb_core_transfer_complete() */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue