Use leds_toggle rather than leds_(on|off).

This commit is contained in:
bg- 2006-10-10 18:25:36 +00:00
parent bc8016543a
commit 2c85f3b19f
2 changed files with 10 additions and 10 deletions

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)$Id: dhclient.c,v 1.3 2006/08/17 15:42:42 bg- Exp $ * @(#)$Id: dhclient.c,v 1.4 2006/10/10 18:25:36 bg- Exp $
*/ */
/* /*
@ -101,7 +101,7 @@ main(int argc, char **argv)
leds_toggle(LEDS_RED | LEDS_GREEN | LEDS_BLUE); leds_toggle(LEDS_RED | LEDS_GREEN | LEDS_BLUE);
slip_arch_init(); /* Must come before first printf */ slip_arch_init(); /* Must come before first printf */
printf("Starting %s " printf("Starting %s "
"($Id: dhclient.c,v 1.3 2006/08/17 15:42:42 bg- Exp $)\n", __FILE__); "($Id: dhclient.c,v 1.4 2006/10/10 18:25:36 bg- Exp $)\n", __FILE__);
ds2411_init(); ds2411_init();
sensors_light_init(); sensors_light_init();
cc2420_init(); cc2420_init();
@ -197,7 +197,7 @@ PROCESS_THREAD(dhclient_process, ev, data)
printf("dhclient_process starting\n"); printf("dhclient_process starting\n");
leds_on(LEDS_GREEN); leds_toggle(LEDS_GREEN);
uip_setipid(rand()); uip_setipid(rand());
@ -234,7 +234,7 @@ dhcpc_configured(const struct dhcpc_state *s)
printf("dhcp reconfigure %d.%d.%d.%d\n", ip2quad(&s->ipaddr)); printf("dhcp reconfigure %d.%d.%d.%d\n", ip2quad(&s->ipaddr));
else { else {
printf("dhcpc_configured %d.%d.%d.%d\n", ip2quad(&s->ipaddr)); printf("dhcpc_configured %d.%d.%d.%d\n", ip2quad(&s->ipaddr));
leds_off(LEDS_GREEN); leds_toggle(LEDS_GREEN);
is_configured = 1; is_configured = 1;
process_start(&uaodv_process, NULL); process_start(&uaodv_process, NULL);
} }
@ -262,7 +262,7 @@ void
dhcpc_unconfigured(const struct dhcpc_state *s) dhcpc_unconfigured(const struct dhcpc_state *s)
{ {
printf("dhcpc_unconfigured\n"); printf("dhcpc_unconfigured\n");
leds_on(LEDS_GREEN); leds_toggle(LEDS_GREEN);
is_configured = 0; is_configured = 0;
process_exit(&uaodv_process); process_exit(&uaodv_process);

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)$Id: ssd.c,v 1.1 2006/10/10 08:30:48 bg- Exp $ * @(#)$Id: ssd.c,v 1.2 2006/10/10 18:25:36 bg- Exp $
*/ */
#include <stdio.h> #include <stdio.h>
@ -89,7 +89,7 @@ main(int argc, char **argv)
leds_toggle(LEDS_RED | LEDS_GREEN | LEDS_BLUE); leds_toggle(LEDS_RED | LEDS_GREEN | LEDS_BLUE);
slip_arch_init(); /* Must come before first printf */ slip_arch_init(); /* Must come before first printf */
printf("Starting %s " printf("Starting %s "
"($Id: ssd.c,v 1.1 2006/10/10 08:30:48 bg- Exp $)\n", __FILE__); "($Id: ssd.c,v 1.2 2006/10/10 18:25:36 bg- Exp $)\n", __FILE__);
ds2411_init(); ds2411_init();
sensors_light_init(); sensors_light_init();
cc2420_init(); cc2420_init();
@ -160,7 +160,7 @@ PROCESS_THREAD(dhclient_process, ev, data)
printf("dhclient_process starting\n"); printf("dhclient_process starting\n");
leds_on(LEDS_GREEN); leds_toggle(LEDS_GREEN);
uip_setipid(rand()); uip_setipid(rand());
@ -199,7 +199,7 @@ dhcpc_configured(const struct dhcpc_state *s)
printf("dhcp reconfigure %d.%d.%d.%d\n", ip2quad(&s->ipaddr)); printf("dhcp reconfigure %d.%d.%d.%d\n", ip2quad(&s->ipaddr));
else { else {
printf("dhcpc_configured %d.%d.%d.%d\n", ip2quad(&s->ipaddr)); printf("dhcpc_configured %d.%d.%d.%d\n", ip2quad(&s->ipaddr));
leds_off(LEDS_GREEN); leds_toggle(LEDS_GREEN);
dhcp_is_conf = 1; dhcp_is_conf = 1;
process_start(&uaodv_process, NULL); process_start(&uaodv_process, NULL);
} }
@ -231,7 +231,7 @@ void
dhcpc_unconfigured(const struct dhcpc_state *s) dhcpc_unconfigured(const struct dhcpc_state *s)
{ {
printf("dhcpc_unconfigured\n"); printf("dhcpc_unconfigured\n");
leds_on(LEDS_GREEN); leds_toggle(LEDS_GREEN);
dhcp_is_conf = 0; dhcp_is_conf = 0;
process_exit(&uaodv_process); process_exit(&uaodv_process);