diff options
Diffstat (limited to 'usrp2/firmware')
-rw-r--r-- | usrp2/firmware/lib/hal_io.c | 11 | ||||
-rw-r--r-- | usrp2/firmware/lib/hal_io.h | 1 |
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); /* |