Fixed compiler warning (with IAR compiler)

This commit is contained in:
Niclas Finne 2011-12-20 18:35:55 +01:00
parent 3daa822f89
commit 9ffcd53868
2 changed files with 9 additions and 12 deletions

View file

@ -29,14 +29,10 @@
* This file is part of the Configurable Sensor Network Application * This file is part of the Configurable Sensor Network Application
* Architecture for sensor nodes running the Contiki operating system. * Architecture for sensor nodes running the Contiki operating system.
* *
* $Id: leds-arch.c,v 1.1 2006/06/17 22:41:21 adamdunkels Exp $
*
* ----------------------------------------------------------------- * -----------------------------------------------------------------
* *
* Author : Adam Dunkels, Joakim Eriksson, Niclas Finne * Author : Adam Dunkels, Joakim Eriksson, Niclas Finne
* Created : 2005-11-03 * Created : 2005-11-03
* Updated : $Date: 2006/06/17 22:41:21 $
* $Revision: 1.1 $
*/ */
#include "contiki.h" #include "contiki.h"
@ -53,9 +49,11 @@ leds_arch_init(void)
unsigned char unsigned char
leds_arch_get(void) leds_arch_get(void)
{ {
return ((LEDS_PxOUT & LEDS_CONF_RED) ? 0 : LEDS_RED) unsigned char leds;
| ((LEDS_PxOUT & LEDS_CONF_GREEN) ? 0 : LEDS_GREEN) leds = LEDS_PxOUT;
| ((LEDS_PxOUT & LEDS_CONF_YELLOW) ? 0 : LEDS_YELLOW); return ((leds & LEDS_CONF_RED) ? 0 : LEDS_RED)
| ((leds & LEDS_CONF_GREEN) ? 0 : LEDS_GREEN)
| ((leds & LEDS_CONF_YELLOW) ? 0 : LEDS_YELLOW);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
void void

View file

@ -28,7 +28,6 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: leds-arch.c,v 1.1 2010/08/25 19:57:33 nifi Exp $
*/ */
/** /**
@ -43,8 +42,6 @@
#include "contiki-conf.h" #include "contiki-conf.h"
#include "dev/leds.h" #include "dev/leds.h"
#include <io.h>
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
void void
leds_arch_init(void) leds_arch_init(void)
@ -56,8 +53,10 @@ leds_arch_init(void)
unsigned char unsigned char
leds_arch_get(void) leds_arch_get(void)
{ {
return ((LEDS_PxOUT & LEDS_CONF_RED) ? 0 : LEDS_RED) unsigned char leds;
| ((LEDS_PxOUT & LEDS_CONF_GREEN) ? 0 : LEDS_GREEN); leds = LEDS_PxOUT;
return ((leds & LEDS_CONF_RED) ? 0 : LEDS_RED)
| ((leds & LEDS_CONF_GREEN) ? 0 : LEDS_GREEN);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
void void