[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r11239 - gnuradio/trunk/usrp2/firmware/lib
From: |
matt |
Subject: |
[Commit-gnuradio] r11239 - gnuradio/trunk/usrp2/firmware/lib |
Date: |
Fri, 19 Jun 2009 13:18:43 -0600 (MDT) |
Author: matt
Date: 2009-06-19 13:18:42 -0600 (Fri, 19 Jun 2009)
New Revision: 11239
Modified:
gnuradio/trunk/usrp2/firmware/lib/hal_io.c
gnuradio/trunk/usrp2/firmware/lib/hal_io.h
Log:
allow the choice of automatic (hardware) control of leds
Modified: gnuradio/trunk/usrp2/firmware/lib/hal_io.c
===================================================================
--- gnuradio/trunk/usrp2/firmware/lib/hal_io.c 2009-06-19 03:41:54 UTC (rev
11238)
+++ gnuradio/trunk/usrp2/firmware/lib/hal_io.c 2009-06-19 19:18:42 UTC (rev
11239)
@@ -160,6 +160,7 @@
*/
static unsigned long leds_shadow = 0;
+static unsigned long led_src_shadow = 0;
void
hal_set_leds(int value, int mask)
@@ -170,7 +171,17 @@
hal_restore_ints(ei);
}
+// Allow hardware control over leds
void
+hal_set_led_src(int value, int mask)
+{
+ int ei = hal_disable_ints();
+ led_src_shadow = (led_src_shadow & ~mask) | (value & mask);
+ output_regs->led_src = led_src_shadow;
+ hal_restore_ints(ei);
+}
+
+void
hal_toggle_leds(int mask)
{
int ei = hal_disable_ints();
Modified: gnuradio/trunk/usrp2/firmware/lib/hal_io.h
===================================================================
--- gnuradio/trunk/usrp2/firmware/lib/hal_io.h 2009-06-19 03:41:54 UTC (rev
11238)
+++ gnuradio/trunk/usrp2/firmware/lib/hal_io.h 2009-06-19 19:18:42 UTC (rev
11239)
@@ -92,6 +92,7 @@
*/
void hal_set_leds(int value, int mask);
+void hal_set_led_src(int value, int mask);
void hal_toggle_leds(int mask);
/*
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r11239 - gnuradio/trunk/usrp2/firmware/lib,
matt <=