commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: eb
Subject: [Commit-gnuradio] r6767 - gnuradio/branches/developers/matt/u2f/firmware
Date: Wed, 31 Oct 2007 22:49:34 -0600 (MDT)

Author: eb
Date: 2007-10-31 22:49:33 -0600 (Wed, 31 Oct 2007)
New Revision: 6767

Added:
   gnuradio/branches/developers/matt/u2f/firmware/blink_leds.c
   gnuradio/branches/developers/matt/u2f/firmware/blink_leds2.c
Modified:
   gnuradio/branches/developers/matt/u2f/firmware/Makefile
   gnuradio/branches/developers/matt/u2f/firmware/u2_init.c
Log:
work-in-progress

Modified: gnuradio/branches/developers/matt/u2f/firmware/Makefile
===================================================================
--- gnuradio/branches/developers/matt/u2f/firmware/Makefile     2007-11-01 
04:34:30 UTC (rev 6766)
+++ gnuradio/branches/developers/matt/u2f/firmware/Makefile     2007-11-01 
04:49:33 UTC (rev 6767)
@@ -24,7 +24,7 @@
 
 ROMS = test1.rom eth_test.rom timer_test.rom \
        ibs_tx_test.rom ibs_rx_test.rom \
-       test_phy_comm.rom
+       test_phy_comm.rom blink_leds.rom blink_leds2.rom
 
 DUMPS = $(ROMS:.rom=.dump)
 
@@ -63,6 +63,12 @@
 test_phy_comm.exe:  test_phy_comm.o libu2fw.a
        $(CC) $(LDFLAGS) $^ -o $@
 
+blink_leds.exe:  blink_leds.o libu2fw.a
+       $(CC) $(LDFLAGS) $^ -o $@
+
+blink_leds2.exe:  blink_leds2.o libu2fw.a
+       $(CC) $(LDFLAGS) $^ -o $@
+
 clean:
        rm -f *.a *.o *.bin *.rom *.exe *.dump
 

Added: gnuradio/branches/developers/matt/u2f/firmware/blink_leds.c
===================================================================
--- gnuradio/branches/developers/matt/u2f/firmware/blink_leds.c                 
        (rev 0)
+++ gnuradio/branches/developers/matt/u2f/firmware/blink_leds.c 2007-11-01 
04:49:33 UTC (rev 6767)
@@ -0,0 +1,45 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+// check communication with ethernet PHY chip
+
+#include "u2_init.h"
+#include "memory_map.h"
+#include "hal_io.h"
+#include "eth_driver.h"
+#include "eth_mac.h"
+#include "pic.h"
+
+
+int
+main(void)
+{
+  int  counter = 0;
+
+  u2_init();
+  
+
+  while(1){
+    output_regs->leds = (counter++ & 0x3);
+  }
+
+  return 0;
+}


Property changes on: gnuradio/branches/developers/matt/u2f/firmware/blink_leds.c
___________________________________________________________________
Name: svn:eol-style
   + native

Added: gnuradio/branches/developers/matt/u2f/firmware/blink_leds2.c
===================================================================
--- gnuradio/branches/developers/matt/u2f/firmware/blink_leds2.c                
                (rev 0)
+++ gnuradio/branches/developers/matt/u2f/firmware/blink_leds2.c        
2007-11-01 04:49:33 UTC (rev 6767)
@@ -0,0 +1,65 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+// check communication with ethernet PHY chip
+
+#include "u2_init.h"
+#include "memory_map.h"
+#include "hal_io.h"
+#include "eth_driver.h"
+#include "eth_mac.h"
+#include "pic.h"
+
+
+// #define DELTA_T  50000000           // 0.5s (10ns per tick)
+#define DELTA_T  500                   // 5 us (10ns per tick)
+
+static int led_state = 0;
+
+void
+timer_handler(unsigned irq)
+{
+
+  int t = timer_regs->time;
+  timer_regs->time = t + DELTA_T;
+
+  led_state ^= 0x2;
+  output_regs->leds = led_state;
+}
+
+int
+main(void)
+{
+  u2_init();
+
+  //hal_puts("Setting up timer\n");
+  pic_register_handler(IRQ_TIMER, timer_handler);
+
+  int t = timer_regs->time;
+  timer_regs->time = t + DELTA_T;
+
+  while(1){
+    led_state ^= 0x1;
+    output_regs->leds = led_state;
+  }
+
+  return 0;
+}


Property changes on: 
gnuradio/branches/developers/matt/u2f/firmware/blink_leds2.c
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: gnuradio/branches/developers/matt/u2f/firmware/u2_init.c
===================================================================
--- gnuradio/branches/developers/matt/u2f/firmware/u2_init.c    2007-11-01 
04:34:30 UTC (rev 6766)
+++ gnuradio/branches/developers/matt/u2f/firmware/u2_init.c    2007-11-01 
04:49:33 UTC (rev 6767)
@@ -20,7 +20,7 @@
 
   hal_io_init();
 
-  hal_puts("u2_init\n");
+  // hal_puts("u2_init\n");
 
   spi_init();
 





reply via email to

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