freemyipod r850 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r849‎ | r850 | r851 >
Date:04:51, 31 December 2011
Author:theseven
Status:new
Tags:
Comment:
emCORE: synopsysotg: Fix endpoints being enabled too late
Modified paths:
  • /emcore/trunk/usb/synopsysotg.c (modified) (history)

Diff [purge]

Index: emcore/trunk/usb/synopsysotg.c
@@ -77,22 +77,22 @@
7878 {
7979 /* The size is getting set to zero, because we don't know
8080 whether we are Full Speed or High Speed at this stage */
81 - /* EP1 IN INACTIVE DATA0 SIZE=0 NEXT=3 */
82 - DIEPCTL1 = 0x10001800;
83 - /* EP2 OUT INACTIVE DATA0 SIZE=0 */
84 - DOEPCTL2 = 0x10000000;
85 - /* EP3 IN INACTIVE DATA0 SIZE=0 NEXT=0 */
86 - DIEPCTL3 = 0x10000000;
87 - /* EP4 OUT INACTIVE DATA0 SIZE=0 */
88 - DOEPCTL4 = 0x10000000;
 81+ /* EP1 DISABLED IN ACTIVE DATA0 SIZE=0 NEXT=3 */
 82+ DIEPCTL1 = 0x50009800;
 83+ /* EP2 DISABLED OUT ACTIVE DATA0 SIZE=0 */
 84+ DOEPCTL2 = 0x50008000;
 85+ /* EP3 DISABLED IN ACTIVE DATA0 SIZE=0 NEXT=0 */
 86+ DIEPCTL3 = 0x50008000;
 87+ /* EP4 DISABLED OUT ACTIVE DATA0 SIZE=0 */
 88+ DOEPCTL4 = 0x50008000;
8989 }
9090 else
9191 {
92 - /* INACTIVE DATA0 */
93 - DIEPCTL1 = (DIEPCTL1 & ~0x00008000) | 0x10000000;
94 - DOEPCTL2 = (DOEPCTL2 & ~0x00008000) | 0x10000000;
95 - DIEPCTL3 = (DIEPCTL3 & ~0x00008000) | 0x10000000;
96 - DOEPCTL4 = (DOEPCTL4 & ~0x00008000) | 0x10000000;
 92+ /* DISABLED ACTIVE DATA0 */
 93+ DIEPCTL1 = DIEPCTL1 | 0x50008000;
 94+ DOEPCTL2 = DOEPCTL2 | 0x50008000;
 95+ DIEPCTL3 = DIEPCTL3 | 0x50008000;
 96+ DOEPCTL4 = DOEPCTL4 | 0x50008000;
9797 }
9898 DAINTMSK = 0xFFFFFFFF; /* Enable interrupts on all EPs */
9999 }
@@ -288,7 +288,6 @@
289289 endpoints[ep].busy = true;
290290 endpoints[ep].size = length;
291291 DOEPCTL(ep) &= ~0x20000; /* EPx UNSTALL */
292 - DOEPCTL(ep) |= 0x8000; /* EPx OUT ACTIVE */
293292 int blocksize = usb_drv_port_speed() ? 512 : 64;
294293 int packets = (length + blocksize - 1) / blocksize;
295294 if (!length)

Follow-up revisions

RevisionCommit summaryAuthorDate
r855Revert r850: This is not stable enough yet for a releasetheseven02:07, 2 January 2012