commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: eb
Subject: [Commit-gnuradio] r6914 - gnuradio/branches/developers/matt/u2f/firmware
Date: Wed, 14 Nov 2007 19:09:57 -0700 (MST)

Author: eb
Date: 2007-11-14 19:09:56 -0700 (Wed, 14 Nov 2007)
New Revision: 6914

Modified:
   gnuradio/branches/developers/matt/u2f/firmware/pic.c
   gnuradio/branches/developers/matt/u2f/firmware/u2_init.c
Log:
doc fixes

Modified: gnuradio/branches/developers/matt/u2f/firmware/pic.c
===================================================================
--- gnuradio/branches/developers/matt/u2f/firmware/pic.c        2007-11-15 
01:45:08 UTC (rev 6913)
+++ gnuradio/branches/developers/matt/u2f/firmware/pic.c        2007-11-15 
02:09:56 UTC (rev 6914)
@@ -40,29 +40,10 @@
   nop_handler
 };
 
-#if 0
-static inline int
-irq_to_mask(int irq)
-{
-  static int table[8] = {
-    IRQ_TO_MASK(0),
-    IRQ_TO_MASK(1),
-    IRQ_TO_MASK(2),
-    IRQ_TO_MASK(3),
-    IRQ_TO_MASK(4),
-    IRQ_TO_MASK(5),
-    IRQ_TO_MASK(6),
-    IRQ_TO_MASK(7)
-  };
 
-  return table[irq & 0x7];
-}
-#endif
-
 void
 pic_init(void)
 {
-  // FIXME assume processor interrupts are enabled here.
   // uP is level triggered
 
   pic_regs->mask = ~0;                                // mask all interrupts
@@ -80,13 +61,13 @@
 
 void pic_interrupt_handler()
 {
-  // hal_puts("PIC_handler: ");
-
   // pending and not masked interrupts
   int live = pic_regs->pending & ~pic_regs->mask;
 
-  // handle the first one set
+  // FIXME loop while there are interrupts to service.
+  //   That will reduce our overhead.
 
+  // handle the first one set
   int i;
   int mask;
   for (i=0, mask=1; i < NVECTORS; i++, mask <<= 1){

Modified: gnuradio/branches/developers/matt/u2f/firmware/u2_init.c
===================================================================
--- gnuradio/branches/developers/matt/u2f/firmware/u2_init.c    2007-11-15 
01:45:08 UTC (rev 6913)
+++ gnuradio/branches/developers/matt/u2f/firmware/u2_init.c    2007-11-15 
02:09:56 UTC (rev 6914)
@@ -6,12 +6,14 @@
 #include "hal_io.h"
 #include "buffer_pool.h"
 #include "hal_uart.h"
+#include "i2c.h"
+#include "bool.h"
 
 /*
  * We ought to arrange for this to be called before main, but for now,
  * we require that the user's main call u2_init as the first thing...
  */
-int 
+bool
 u2_init(void)
 {
   // Set GPIOs to inputs
@@ -21,8 +23,7 @@
 
   hal_io_init();
 
-  // hal_puts("u2_init\n");
-
+  // init spi, so that we can switch over to the high-speed clock
   spi_init();
 
   // Set up AD9510
@@ -54,27 +55,17 @@
   //spi_transact(SPI_TXONLY, SPI_SS_AD9777, 0x00000301, 16, 0);  // PLL = 
   //spi_transact(SPI_TXONLY, SPI_SS_AD9777, 0x00000480, 16, 0);  // PLL on, 
automatic
 
-  // write DSP registers...
-#if 0
-  dsp_regs->i = 0x7FFF;
-  dsp_regs->q = 0x7FFF;
-  dsp_regs->freq = 0x12345678;
-  dsp_regs->scale_i = 512;
-  dsp_regs->scale_q = 123;
-#endif
 
   // Set up serdes
   //output_regs->serdes_ctrl = (SERDES_ENABLE | SERDES_LOOPEN | SERDES_RXEN);
   output_regs->serdes_ctrl = (SERDES_ENABLE | SERDES_RXEN);
 
-  // hal_puts("Setting up interrupt controller\n");
-  pic_init();
+  pic_init();  // progammable interrupt controller
+  bp_init();   // buffer pool
 
-  bp_init();
-
   hal_enable_ints();
 
-  return 1;
+  return true;
 }
 
 





reply via email to

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