commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r5169 - gnuradio/branches/developers/eb/fx2/usrp/firmw


From: eb
Subject: [Commit-gnuradio] r5169 - gnuradio/branches/developers/eb/fx2/usrp/firmware/lib
Date: Fri, 27 Apr 2007 18:58:00 -0600 (MDT)

Author: eb
Date: 2007-04-27 18:58:00 -0600 (Fri, 27 Apr 2007)
New Revision: 5169

Modified:
   gnuradio/branches/developers/eb/fx2/usrp/firmware/lib/fx2utils.c
   gnuradio/branches/developers/eb/fx2/usrp/firmware/lib/usb_common.c
Log:
work-in-progress on FX2 power mgmt

Modified: gnuradio/branches/developers/eb/fx2/usrp/firmware/lib/fx2utils.c
===================================================================
--- gnuradio/branches/developers/eb/fx2/usrp/firmware/lib/fx2utils.c    
2007-04-28 00:54:56 UTC (rev 5168)
+++ gnuradio/branches/developers/eb/fx2/usrp/firmware/lib/fx2utils.c    
2007-04-28 00:58:00 UTC (rev 5169)
@@ -43,7 +43,8 @@
   USBCS |= bmDISCON | bmRENUM;
 
   // mdelay (1500);            // FIXME why 1.5 seconds?
-  mdelay (250);                        // FIXME why 1.5 seconds?
+  // mdelay (250);                     // FIXME why 1.5 seconds?
+  mdelay (500);                        // FIXME why 1.5 seconds?
   
   USBIRQ = 0xff;               // clear any pending USB irqs...
   EPIRQ =  0xff;               //   they're from before the renumeration
@@ -62,8 +63,8 @@
         orl    a,#0xC0
        movx    @dptr,a
 
-        mov     dptr,#_SUSPEND   ; write any value to SUSPEND reg
-        movx    @dptr,a          
+       ; mov     dptr,#_SUSPEND   ; write any value to SUSPEND reg
+        ; movx    @dptr,a          
 
         orl    PCON,#0x01       ; power down processor
 

Modified: gnuradio/branches/developers/eb/fx2/usrp/firmware/lib/usb_common.c
===================================================================
--- gnuradio/branches/developers/eb/fx2/usrp/firmware/lib/usb_common.c  
2007-04-28 00:54:56 UTC (rev 5168)
+++ gnuradio/branches/developers/eb/fx2/usrp/firmware/lib/usb_common.c  
2007-04-28 00:58:00 UTC (rev 5169)
@@ -112,6 +112,11 @@
   _usb_got_SUSPEND = 1;
 }
 
+/*
+ * Hmmm, it seems like it's nearly impossible to use this interrupt safely.
+ * There is no way to block it, and I don't see how to prevent a race between
+ * servicing the SUSPEND interrupt and possibly handling this one in the 
middle.
+ */
 static void
 isr_RESUME (void) interrupt
 {
@@ -119,7 +124,6 @@
   _usb_got_RESUME = 1;
 }
 
-
 void
 usb_install_handlers (void)
 {
@@ -136,9 +140,25 @@
 
   // mbWU2| mbWU2 clear possible interrupt requests
   WAKEUPCS = bmWU2 | bmWU | bmDPEN;    // we wakeup only on USB activity
-  // ERESI = 1;                // enable RESUME interrupt
+  RESI  = 0;           // clear pending intr flag
+#if 0
+  ERESI = 1;           // enable RESUME interrupt
+#else
+  ERESI = 0;            // disable RESUME interrupt
+#endif
 }
 
+
+void
+usb_handle_suspend (void)
+{
+  _usb_got_SUSPEND = 0;
+
+  user_enter_suspend();
+  fx2_idle ();         // put FX2 in idle state
+  user_leave_suspend();
+}
+
 // On the FX2 the only plausible endpoints are 0, 1, 2, 4, 6, 8
 // This doesn't check to see that they're enabled
 
@@ -305,6 +325,7 @@
          fx2_stall_ep0 ();
          break;
        }
+       break;
 
       // --------------------------------
 
@@ -409,20 +430,3 @@
   // ack handshake phase of device request
   EP0CS |= bmHSNAK;
 }
-
-void
-usb_handle_suspend (void)
-{
-  _usb_got_SUSPEND = 0;
-
-  user_enter_suspend();
-
-  fx2_idle (); // FIXME put FX2 in idle state
-
-  //while (!_usb_got_RESUME)
-  //  ; // nop
-
-  _usb_got_RESUME = 0;
-
-  user_leave_suspend();
-}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]