Commit graph

11 commits

Author SHA1 Message Date
Benoît Thébaudeau 9846216358 leds: Add the leds_set() function
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 <benoit.thebaudeau@advansee.com>
2014-01-07 13:03:14 +01:00
Benoît Thébaudeau 7f48057b9e leds: Fix the API
The leds API did not work in some cases. E.g. with the following sequence:
  leds_off(LEDS_ALL);
  leds_toggle(LEDS_GREEN);
  leds_off(LEDS_ALL);
the green LED was remaining on after the last call.

This was caused by the toggle feature made synonymous with the invert feature,
although it is unrelated. leds_toggle() is indeed supposed to toggle an LED,
while leds_invert() is supposed to change the active level of an LED. However,
all users of leds_invert() actually meant leds_toggle(), and the invert feature
does not make sense in this module because it is not handy due to successive
calls to leds_invert() changing the intended behavior, and hardware active
levels should be managed in leds_arch_set() (e.g. by XORing the passed value
with a hardware-specific constant before setting the output levels of the pins).

Consequently, this change:
 - removes the leds_invert() function,
 - makes leds_toggle() behave as expected relatively to leds_off() / leds_on(),
 - sanitizes the code in the leds module.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
2014-01-07 13:02:41 +01:00
Adam Dunkels 944537fccf Removed all old RCS tags in the Contiki source tree. Those RCS tags are not used any more, as we are now using git to manage the Contiki source tree 2012-10-26 15:54:49 +02:00
Fredrik Osterlind dd7cec737d removed obsolete leds_[color]() functions, replaced by leds_{on,off}()
allow LEDS_[COLOR] to be configured by platform-conf
2011-03-03 17:48:32 +01:00
adamdunkels e34e97cd6f Minor code style fixes 2009-02-24 21:30:20 +00:00
joxe 673d73bfa3 added energest on all parts of leds API and some cleanup 2008-09-29 11:35:28 +00:00
adamdunkels 1f005b6299 Moved energest.{c,h} from core/lib to core/sys: power profiling is a system mechanism, not a library 2008-07-03 23:36:30 +00:00
adamdunkels bba0485797 Experimental energy estimation code 2007-03-19 00:30:13 +00:00
nifi 5528198929 fixed leds invert 2006-10-09 14:38:23 +00:00
adamdunkels 022b1ba742 Made LEDS not count 2006-10-09 11:55:02 +00:00
adamdunkels c9e808d638 Import of the contiki-2.x development code from the SICS internal CVS server 2006-06-17 22:41:10 +00:00