freemyipod r855 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r854‎ | r855 | r856 >
Date:01:07, 2 January 2012
Author:theseven
Status:new
Tags:
Comment:
Revert r850: This is not stable enough yet for a release
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 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;
 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;
8989 }
9090 else
9191 {
92 - /* DISABLED ACTIVE DATA0 */
93 - DIEPCTL1 = DIEPCTL1 | 0x50008000;
94 - DOEPCTL2 = DOEPCTL2 | 0x50008000;
95 - DIEPCTL3 = DIEPCTL3 | 0x50008000;
96 - DOEPCTL4 = DOEPCTL4 | 0x50008000;
 92+ /* INACTIVE DATA0 */
 93+ DIEPCTL1 = (DIEPCTL1 & ~0x00008000) | 0x10000000;
 94+ DOEPCTL2 = (DOEPCTL2 & ~0x00008000) | 0x10000000;
 95+ DIEPCTL3 = (DIEPCTL3 & ~0x00008000) | 0x10000000;
 96+ DOEPCTL4 = (DOEPCTL4 & ~0x00008000) | 0x10000000;
9797 }
9898 DAINTMSK = 0xFFFFFFFF; /* Enable interrupts on all EPs */
9999 }
@@ -288,6 +288,7 @@
289289 endpoints[ep].busy = true;
290290 endpoints[ep].size = length;
291291 DOEPCTL(ep) &= ~0x20000; /* EPx UNSTALL */
 292+ DOEPCTL(ep) |= 0x8000; /* EPx OUT ACTIVE */
292293 int blocksize = usb_drv_port_speed() ? 512 : 64;
293294 int packets = (length + blocksize - 1) / blocksize;
294295 if (!length)

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r850emCORE: synopsysotg: Fix endpoints being enabled too latetheseven03:51, 31 December 2011