commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r7397 - usrp2/trunk/firmware/apps


From: eb
Subject: [Commit-gnuradio] r7397 - usrp2/trunk/firmware/apps
Date: Thu, 10 Jan 2008 23:20:02 -0700 (MST)

Author: eb
Date: 2008-01-10 23:20:02 -0700 (Thu, 10 Jan 2008)
New Revision: 7397

Modified:
   usrp2/trunk/firmware/apps/gen_eth_packets.c
Log:
gen pkt every 100us when simulating

Modified: usrp2/trunk/firmware/apps/gen_eth_packets.c
===================================================================
--- usrp2/trunk/firmware/apps/gen_eth_packets.c 2008-01-10 22:08:36 UTC (rev 
7396)
+++ usrp2/trunk/firmware/apps/gen_eth_packets.c 2008-01-11 06:20:02 UTC (rev 
7397)
@@ -46,7 +46,8 @@
 
 // static int timer_delta = MASTER_CLK_RATE/ETH_PACKET_RATE;   // ticks 
between interrupts
 
-static int timer_delta = MASTER_CLK_RATE/1000; // tick at 1kHz
+static int timer_delta = (int)(MASTER_CLK_RATE * 1e-3);                // tick 
at 1 kHz
+static int sim_timer_delta = (int)(MASTER_CLK_RATE * 100e-6);  // tick at 10 
kHz
 
 static volatile bool send_packet_now = false;   // timer handler sets this
 static volatile bool link_is_up = false;       // eth handler sets this
@@ -167,13 +168,21 @@
 
   // pic_register_handler(IRQ_BUFFER, buffer_irq_handler);  // poll for now
   pic_register_handler(IRQ_TIMER, timer_irq_handler);
+
+
+  if (hwconfig_simulation_p())
+    timer_delta = sim_timer_delta;
+
   hal_set_timeout(timer_delta);
 
   ethernet_register_link_changed_callback(link_changed_callback);
 
   ethernet_init();
 
-  // eth_mac->speed = 4;       // FIXME hardcode mac speed to 1000
+  if (hwconfig_simulation_p()){
+    eth_mac->speed = 4;        // FIXME hardcode mac speed to 1000
+    link_is_up = true;
+  }
 
   while(1){
     if (link_is_up && send_packet_now){





reply via email to

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