From db60afb2fb26953364aa26193ec37802f136e91e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Mon, 6 Jan 2014 21:53:10 +0100 Subject: [PATCH] leds: Add the leds_set() function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The leds_set() function is added on top of leds_arch_set() in order to have a means of displaying a pattern on a set of LEDs, while keeping the ENERGEST information up to date, which would be missing with a direct call to leds_arch_set(). Signed-off-by: Benoît Thébaudeau --- core/dev/leds.c | 6 ++++++ core/dev/leds.h | 1 + 2 files changed, 7 insertions(+) diff --git a/core/dev/leds.c b/core/dev/leds.c index 1f8dcfa34..9e9c181e4 100644 --- a/core/dev/leds.c +++ b/core/dev/leds.c @@ -90,6 +90,12 @@ leds_get(void) { } /*---------------------------------------------------------------------------*/ void +leds_set(unsigned char ledv) +{ + show_leds(ledv); +} +/*---------------------------------------------------------------------------*/ +void leds_on(unsigned char ledv) { unsigned char changed; diff --git a/core/dev/leds.h b/core/dev/leds.h index b3f2adf70..7264a8dfe 100644 --- a/core/dev/leds.h +++ b/core/dev/leds.h @@ -80,6 +80,7 @@ void leds_blink(void); * Returns the current status of all leds (respects invert) */ unsigned char leds_get(void); +void leds_set(unsigned char leds); void leds_on(unsigned char leds); void leds_off(unsigned char leds); void leds_toggle(unsigned char leds);