commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r6748 - gnuradio/branches/developers/matt/u2f/firmware


From: eb
Subject: [Commit-gnuradio] r6748 - gnuradio/branches/developers/matt/u2f/firmware
Date: Tue, 30 Oct 2007 15:29:24 -0600 (MDT)

Author: eb
Date: 2007-10-30 15:29:24 -0600 (Tue, 30 Oct 2007)
New Revision: 6748

Modified:
   gnuradio/branches/developers/matt/u2f/firmware/test_phy_comm.c
Log:
test code with blinking leds

Modified: gnuradio/branches/developers/matt/u2f/firmware/test_phy_comm.c
===================================================================
--- gnuradio/branches/developers/matt/u2f/firmware/test_phy_comm.c      
2007-10-30 21:22:05 UTC (rev 6747)
+++ gnuradio/branches/developers/matt/u2f/firmware/test_phy_comm.c      
2007-10-30 21:29:24 UTC (rev 6748)
@@ -26,7 +26,22 @@
 #include "hal_io.h"
 #include "eth_driver.h"
 #include "eth_mac.h"
+#include "pic.h"
 
+
+#define DELTA_T  50000000              // 0.5s (10ns per tick)
+
+static int led_val = 0;
+
+void 
+timer_handler(unsigned irq)
+{
+  int t = timer_regs->time;
+  timer_regs->time = t + DELTA_T;
+
+  output_regs->leds = led_val++;
+}
+
 int
 main(void)
 {
@@ -34,6 +49,13 @@
 
   hal_puts("\n\n@@@ test_phy_comm @@@\n\n\n");
 
+  hal_puts("Setting up timer\n");
+  pic_register_handler(IRQ_TIMER, timer_handler);
+
+  int t = timer_regs->time;
+  timer_regs->time = t + DELTA_T;
+
+
   eth_mac_init();
   eth_driver_init();
 





reply via email to

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