From 984621635838b6018d23a3e2e740368322ff1bdc 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 10e7a51a9..c815e100d 100644 --- a/core/dev/leds.c +++ b/core/dev/leds.c @@ -94,6 +94,12 @@ leds_get(void) { } /*---------------------------------------------------------------------------*/ void +leds_set(unsigned char ledv) +{ + show_leds(ledv); +} +/*---------------------------------------------------------------------------*/ +void leds_on(unsigned char ledv) { show_leds(leds | ledv); diff --git a/core/dev/leds.h b/core/dev/leds.h index 333ed4288..73f63356c 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 */ 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);