mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 21:25:19 -05:00
mps depends on endpoint, I wonder why gcc didn't warn about i being used uninitialized...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27005 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a398c2846a
commit
9297a02d49
1 changed files with 11 additions and 9 deletions
|
|
@ -150,15 +150,6 @@ static void dma_desc_init(int ep, int dir)
|
||||||
static void reset_endpoints(int init)
|
static void reset_endpoints(int init)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
/*
|
|
||||||
* MPS sizes depending on speed:
|
|
||||||
* LS: 8 (control), no bulk available
|
|
||||||
* FS: 64 (control), 64 (bulk)
|
|
||||||
* HS: 64 (control), 512 (bulk)
|
|
||||||
*
|
|
||||||
* We don't need to handle LS since there is no low-speed only host AFAIK.
|
|
||||||
*/
|
|
||||||
int mps = i == 0 ? 64 : (usb_drv_port_speed() ? 512 : 64);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* OUT EP 2 is an alias for OUT EP 0 on this HW!
|
* OUT EP 2 is an alias for OUT EP 0 on this HW!
|
||||||
|
|
@ -171,6 +162,17 @@ static void reset_endpoints(int init)
|
||||||
endpoints[2][1].state |= EP_STATE_ALLOCATED;
|
endpoints[2][1].state |= EP_STATE_ALLOCATED;
|
||||||
|
|
||||||
for(i = 0; i < USB_NUM_EPS; i++) {
|
for(i = 0; i < USB_NUM_EPS; i++) {
|
||||||
|
/*
|
||||||
|
* MPS sizes depending on speed:
|
||||||
|
* LS: 8 (control), no bulk available
|
||||||
|
* FS: 64 (control), 64 (bulk)
|
||||||
|
* HS: 64 (control), 512 (bulk)
|
||||||
|
*
|
||||||
|
* We don't need to handle LS since there is no low-speed only
|
||||||
|
* host AFAIK.
|
||||||
|
*/
|
||||||
|
int mps = i == 0 ? 64 : (usb_drv_port_speed() ? 512 : 64);
|
||||||
|
|
||||||
if (init) {
|
if (init) {
|
||||||
endpoints[i][0].state = 0;
|
endpoints[i][0].state = 0;
|
||||||
wakeup_init(&endpoints[i][0].complete);
|
wakeup_init(&endpoints[i][0].complete);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue