summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatt2009-06-19 19:18:42 +0000
committermatt2009-06-19 19:18:42 +0000
commit8a145afaab9a79eda76d0a3a6bcb420cc7c994bc (patch)
tree1e276619cdce21e2b0009ccc98b8b3cc9cb1d6ef
parent806433ed142f6fc05f193911c5204739e022e9bf (diff)
downloadgnuradio-8a145afaab9a79eda76d0a3a6bcb420cc7c994bc.tar.gz
gnuradio-8a145afaab9a79eda76d0a3a6bcb420cc7c994bc.tar.bz2
gnuradio-8a145afaab9a79eda76d0a3a6bcb420cc7c994bc.zip
allow the choice of automatic (hardware) control of leds
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@11239 221aa14e-8319-0410-a670-987f0aec2ac5
-rw-r--r--usrp2/firmware/lib/hal_io.c11
-rw-r--r--usrp2/firmware/lib/hal_io.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/usrp2/firmware/lib/hal_io.c b/usrp2/firmware/lib/hal_io.c
index 541906825..6cb7649f3 100644
--- a/usrp2/firmware/lib/hal_io.c
+++ b/usrp2/firmware/lib/hal_io.c
@@ -160,6 +160,7 @@ hal_gpio_read(int bank)
*/
static unsigned long leds_shadow = 0;
+static unsigned long led_src_shadow = 0;
void
hal_set_leds(int value, int mask)
@@ -170,6 +171,16 @@ hal_set_leds(int value, int mask)
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)
{
diff --git a/usrp2/firmware/lib/hal_io.h b/usrp2/firmware/lib/hal_io.h
index a49750a6d..b6ae35b73 100644
--- a/usrp2/firmware/lib/hal_io.h
+++ b/usrp2/firmware/lib/hal_io.h
@@ -92,6 +92,7 @@ int hal_gpio_read(int bank);
*/
void hal_set_leds(int value, int mask);
+void hal_set_led_src(int value, int mask);
void hal_toggle_leds(int mask);
/*