commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r7184 - in usrp2/trunk/firmware: . apps lib


From: eb
Subject: [Commit-gnuradio] r7184 - in usrp2/trunk/firmware: . apps lib
Date: Fri, 14 Dec 2007 15:10:30 -0700 (MST)

Author: eb
Date: 2007-12-14 15:10:30 -0700 (Fri, 14 Dec 2007)
New Revision: 7184

Modified:
   usrp2/trunk/firmware/Makefile.common
   usrp2/trunk/firmware/apps/rx_only.c
   usrp2/trunk/firmware/lib/buffer_pool.c
   usrp2/trunk/firmware/lib/dbsm.c
   usrp2/trunk/firmware/lib/eth_driver.c
Log:



Modified: usrp2/trunk/firmware/Makefile.common
===================================================================
--- usrp2/trunk/firmware/Makefile.common        2007-12-14 22:04:34 UTC (rev 
7183)
+++ usrp2/trunk/firmware/Makefile.common        2007-12-14 22:10:30 UTC (rev 
7184)
@@ -19,7 +19,7 @@
 STD_INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/lib
 
 #HAL_IO = -DHAL_IO_USES_DBOARD_PINS 
-HAL_IO = -DHAL_IO_USES_UART 
+#HAL_IO = -DHAL_IO_USES_UART 
 
 AM_CPPFLAGS = $(HAL_IO) $(STD_INCLUDES)
 

Modified: usrp2/trunk/firmware/apps/rx_only.c
===================================================================
--- usrp2/trunk/firmware/apps/rx_only.c 2007-12-14 22:04:34 UTC (rev 7183)
+++ usrp2/trunk/firmware/apps/rx_only.c 2007-12-14 22:10:30 UTC (rev 7184)
@@ -123,10 +123,9 @@
 static void
 start_rx_cmd(const u2_mac_addr_t *host)
 {
-  printf("start_rx_cmd\n");
+  // printf("start_rx_cmd\n");
+  // hal_toggle_leds(0x2);
 
-  hal_toggle_leds(0x2);
-
   host_mac_addr = *host;       // remember who we're sending to
 
   /*
@@ -150,16 +149,14 @@
   dsp_rx_regs->decim_rate = 63;        // register gets N - 1
 
   uint32_t cmd = MK_RX_CMD(10000 * DSP_RX_SAMPLES_PER_FRAME, 
DSP_RX_SAMPLES_PER_FRAME);
-  printf("rx_command = "); puthex32_nl(cmd);
-  
+  // printf("rx_command = "); puthex32_nl(cmd);
   dsp_rx_regs->rx_command = cmd;
-  dsp_rx_regs->rx_time = T_NOW;                // start NOW!
-  // dsp_rx_regs->rx_time = 1; // timer_regs->time + 10000;
 
   // kick off the state machine
   dbsm_start(&dsp_rx_sm);
 
-  printf("end start_rx_cmd\n");
+  // dsp_rx_regs->rx_time = 1; // timer_regs->time + 10000;
+  dsp_rx_regs->rx_time = T_NOW;                // start NOW!
 
   // FIXME need to arrange to add additional stuff to cmd queue
 }
@@ -186,13 +183,14 @@
 static void
 handle_control_chan_frame(int bufno, u2_eth_packet_t *pkt, size_t len)
 {
-  static unsigned char payload[256] _AL4;
+  static unsigned char payload[64] _AL4;
   static unsigned char reply[sizeof(u2_eth_packet_t) + sizeof(u2_subpkt_t)] 
_AL4;
   unsigned char *s = &reply[sizeof(u2_eth_packet_t)];
   size_t reply_len = 0;
   int   i;
 
-  // copy 256 bytes of payload into stack buffer
+  // FIXME copy as needed...
+  // copy 64 bytes of payload into stack buffer
   memcpy_wordaligned(payload,
                     (unsigned char *) buffer_ram(bufno) + 
sizeof(u2_eth_packet_t),
                     sizeof(payload));
@@ -385,7 +383,5 @@
 
   // hal_set_leds(link_is_up ? 0x2 : 0x0, 0x2);
 
-  putstr("\neth link changed: speed = ");
-  //puthex16_nl(speed);
-  printf("%d\n", speed);
+  printf("\neth link changed: speed = %d\n", speed);
 }

Modified: usrp2/trunk/firmware/lib/buffer_pool.c
===================================================================
--- usrp2/trunk/firmware/lib/buffer_pool.c      2007-12-14 22:04:34 UTC (rev 
7183)
+++ usrp2/trunk/firmware/lib/buffer_pool.c      2007-12-14 22:10:30 UTC (rev 
7184)
@@ -22,8 +22,12 @@
 void
 bp_init(void)
 {
+  int i;
   bp_disable_port(PORT_SERDES);
   bp_disable_port(PORT_DSP);
   bp_disable_port(PORT_ETH);
   bp_disable_port(PORT_RAM);
+
+  for (i = 0; i < NBUFFERS; i++)
+    bp_clear_buf(i);
 }

Modified: usrp2/trunk/firmware/lib/dbsm.c
===================================================================
--- usrp2/trunk/firmware/lib/dbsm.c     2007-12-14 22:04:34 UTC (rev 7183)
+++ usrp2/trunk/firmware/lib/dbsm.c     2007-12-14 22:10:30 UTC (rev 7184)
@@ -60,7 +60,7 @@
 void
 dbsm_start(dbsm_t *sm)
 {
-  printf("dbsm_start: buf0 = %d, recv_port = %d\n", sm->buf0, 
sm->recv_args.port);
+  // printf("dbsm_start: buf0 = %d, recv_port = %d\n", sm->buf0, 
sm->recv_args.port);
 
   sm->running = true;
 

Modified: usrp2/trunk/firmware/lib/eth_driver.c
===================================================================
--- usrp2/trunk/firmware/lib/eth_driver.c       2007-12-14 22:04:34 UTC (rev 
7183)
+++ usrp2/trunk/firmware/lib/eth_driver.c       2007-12-14 22:10:30 UTC (rev 
7184)
@@ -24,6 +24,8 @@
 #include "hal_io.h"
 #include "nonstdio.h"
 
+#define VERBOSE 0
+
 static eth_driver_t ed_state;
 static ed_link_changed_callback_t ed_callback = 0;
 
@@ -76,8 +78,6 @@
 static void
 ed_link_speed_change(int speed)
 {
-  putstr("ed_link_speed_change: "); puthex16_nl(speed);
-
   ed_link_down();
   ed_link_up(speed);
 }
@@ -92,10 +92,14 @@
   eth_link_state_t new_state = LS_UNKNOWN;
   int new_speed = S_UNKNOWN;
 
-  putstr("LANSR: "); puthex16_nl(lansr);
+  if (VERBOSE){
+    putstr("LANSR: ");
+    puthex16_nl(lansr);
+  }
 
   if (lansr & LANSR_LINK_GOOD){                // link's up
-    puts("  LINK_GOOD");
+    if (VERBOSE)
+      puts("  LINK_GOOD");
 
     new_state = LS_UP;
     switch (lansr & LANSR_SPEED_MASK){
@@ -117,7 +121,8 @@
     }
   }
   else {                               // link's down
-    puts("  NOT LINK_GOOD");
+    if (VERBOSE)
+      puts("  NOT LINK_GOOD");
     
     new_state = LS_DOWN;
     new_speed = S_UNKNOWN;
@@ -132,7 +137,6 @@
   }
   else if (new_state == LS_UP && new_speed != ed_state.link_speed){
     ed_state.link_speed = new_speed;           // remember new speed
-    puts("  New Speed: "); puthex_nl(new_speed);
     ed_link_speed_change(new_speed);
   }
 }





reply via email to

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