commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r7186 - in usrp2/trunk: firmware/apps firmware/include


From: eb
Subject: [Commit-gnuradio] r7186 - in usrp2/trunk: firmware/apps firmware/include host
Date: Fri, 14 Dec 2007 17:33:47 -0700 (MST)

Author: eb
Date: 2007-12-14 17:33:46 -0700 (Fri, 14 Dec 2007)
New Revision: 7186

Added:
   usrp2/trunk/host/ibs_check.m
Modified:
   usrp2/trunk/firmware/apps/rx_only.c
   usrp2/trunk/firmware/include/usrp2_eth_packet.h
Log:
Work-in-progress on Rx.  Still some problems one 2nd or later runs
following powerup.


Modified: usrp2/trunk/firmware/apps/rx_only.c
===================================================================
--- usrp2/trunk/firmware/apps/rx_only.c 2007-12-14 23:47:25 UTC (rev 7185)
+++ usrp2/trunk/firmware/apps/rx_only.c 2007-12-15 00:33:46 UTC (rev 7186)
@@ -38,6 +38,9 @@
 
 #define        _AL4 __attribute__((aligned (4)))
 
+#define USE_BUFFER_INTERRUPT   1       // 0 or 1
+
+
 static int timer_delta = MASTER_CLK_RATE/1000; // tick at 1kHz
 
 /*
@@ -105,18 +108,28 @@
 void
 underrun_irq_handler(unsigned irq)
 {
-  putstr("\nirq: underrun\n");
   dsp_tx_regs->clear_state = 1;
+  //bp_clear_buf(DSP_TX_BUF_0);
+  //bp_clear_buf(DSP_TX_BUF_1);
+  //dbsm_stop(&dsp_tx_sm);
+
   // FIXME anything else?
+
+  putstr("\nirq: underrun\n");
 }
 
 // Rx DSP overrun
 void
 overrun_irq_handler(unsigned irq)
 {
-  putstr("\nirq: overrun\n");
   dsp_rx_regs->clear_state = 1;
+  bp_clear_buf(DSP_RX_BUF_0);
+  bp_clear_buf(DSP_RX_BUF_1);
+  dbsm_stop(&dsp_rx_sm);
+
   // FIXME anything else?
+
+  putstr("\nirq: overrun\n");
 }
 
 
@@ -312,7 +325,9 @@
   // Control LEDs
   hal_set_leds(0x0, 0x3);
 
-  pic_register_handler(IRQ_BUFFER,   buffer_irq_handler);
+  if (USE_BUFFER_INTERRUPT)
+    pic_register_handler(IRQ_BUFFER,   buffer_irq_handler);
+
   pic_register_handler(IRQ_OVERRUN,  overrun_irq_handler);
   pic_register_handler(IRQ_UNDERRUN, underrun_irq_handler);
 
@@ -338,6 +353,8 @@
   }
 
   while(1){
+    if (!USE_BUFFER_INTERRUPT)
+      buffer_irq_handler(0);
     // FIXME perhaps handle low-pri stuff here
   }
 }

Modified: usrp2/trunk/firmware/include/usrp2_eth_packet.h
===================================================================
--- usrp2/trunk/firmware/include/usrp2_eth_packet.h     2007-12-14 23:47:25 UTC 
(rev 7185)
+++ usrp2/trunk/firmware/include/usrp2_eth_packet.h     2007-12-15 00:33:46 UTC 
(rev 7186)
@@ -194,6 +194,17 @@
   uint8_t      opcode;
   uint8_t      len;
   uint16_t     mbz;
+
+  int32_t      freq;
+  uint32_t     scale_iq;
+  uint32_t     decim;
+  uint32_t     cmd;
+} op_config_rx_t;
+
+typedef struct {
+  uint8_t      opcode;
+  uint8_t      len;
+  uint16_t     mbz;
 } op_stop_rx_t;
 
 

Added: usrp2/trunk/host/ibs_check.m
===================================================================
--- usrp2/trunk/host/ibs_check.m                                (rev 0)
+++ usrp2/trunk/host/ibs_check.m        2007-12-15 00:33:46 UTC (rev 7186)
@@ -0,0 +1,43 @@
+
+function y = ibs_check(filename)
+  pass = 1;
+  a = read_short_binary(filename);
+  b = max(size(a));
+  s1 = a(1:2:b);
+  s2 = a(2:2:b);
+
+  printf("Size of packet %d\n",size(s2)(1))
+  if(mod(b,2) != 0)
+     printf( "Odd number of samples");
+     pass = 0;
+   endif
+     
+     bad = find( s1(1) != s1);
+     if(size(bad)(1) != 0)
+       printf("%d Failures on const column\n", (size(bad)(1)) )
+       pass = 0;
+     endif
+
+     bad = find(diff(s2)!=1)
+     jumps = diff(s2)(bad)
+     spacing = diff(bad)
+
+     if(find(jumps != -65535))
+       printf("Failure in jump values\n");
+       pass = 0;
+     endif
+
+     pktlen_bad = find(spacing != 65536);
+
+     if(size(pktlen_bad)(1) != 0)
+       printf("%d Failures on monotonic increase\n",size(bad)(1))
+       pass = 0;
+     endif
+
+     if(pass)
+       printf("Passed\n")
+     endif
+   endfunction
+     
+  
+  





reply via email to

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