diff options
Diffstat (limited to 'usrp2/firmware/lib/hal_io.c')
-rw-r--r-- | usrp2/firmware/lib/hal_io.c | 11 |
1 files changed, 11 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) { |