mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
minor code style cleanup
This commit is contained in:
parent
933fff4c89
commit
9ee6406824
@ -26,14 +26,14 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: battery-sensor.c,v 1.5 2010/01/14 17:39:35 nifi Exp $
|
||||
* $Id: battery-sensor.c,v 1.6 2010/02/08 00:00:45 nifi Exp $
|
||||
*
|
||||
* -----------------------------------------------------------------
|
||||
*
|
||||
* Author : Adam Dunkels, Joakim Eriksson, Niclas Finne
|
||||
* Created : 2005-11-01
|
||||
* Updated : $Date: 2010/01/14 17:39:35 $
|
||||
* $Revision: 1.5 $
|
||||
* Updated : $Date: 2010/02/08 00:00:45 $
|
||||
* $Revision: 1.6 $
|
||||
*/
|
||||
|
||||
#include "dev/battery-sensor.h"
|
||||
@ -60,12 +60,12 @@ value(int type)
|
||||
static int
|
||||
configure(int type, int value)
|
||||
{
|
||||
switch (type) {
|
||||
switch(type) {
|
||||
case SENSORS_HW_INIT:
|
||||
battery_value = 0;
|
||||
return 1;
|
||||
case SENSORS_ACTIVE:
|
||||
if (value) {
|
||||
if(value) {
|
||||
if(!irq_adc12_active(6)) {
|
||||
irq_adc12_activate(6, (INCH_4 + SREF_0), irq);
|
||||
}
|
||||
@ -80,7 +80,7 @@ configure(int type, int value)
|
||||
static int
|
||||
status(int type)
|
||||
{
|
||||
switch (type) {
|
||||
switch(type) {
|
||||
case SENSORS_ACTIVE:
|
||||
case SENSORS_READY:
|
||||
return irq_adc12_active(6);
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* @(#)$Id: button-sensor.c,v 1.4 2010/01/14 17:39:35 nifi Exp $
|
||||
* @(#)$Id: button-sensor.c,v 1.5 2010/02/08 00:00:45 nifi Exp $
|
||||
*/
|
||||
|
||||
#include "dev/button-sensor.h"
|
||||
@ -68,14 +68,14 @@ value(int type)
|
||||
static int
|
||||
configure(int type, int value)
|
||||
{
|
||||
switch (type) {
|
||||
switch(type) {
|
||||
case SENSORS_HW_INIT:
|
||||
BUTTON_IRQ_EDGE_SELECTD();
|
||||
BUTTON_SELECT();
|
||||
BUTTON_MAKE_INPUT();
|
||||
return 1;
|
||||
case SENSORS_ACTIVE:
|
||||
if (value) {
|
||||
if(value) {
|
||||
if(!BUTTON_IRQ_ENABLED()) {
|
||||
timer_set(&debouncetimer, 0);
|
||||
BUTTON_ENABLE_IRQ();
|
||||
@ -91,7 +91,7 @@ configure(int type, int value)
|
||||
static int
|
||||
status(int type)
|
||||
{
|
||||
switch (type) {
|
||||
switch(type) {
|
||||
case SENSORS_ACTIVE:
|
||||
case SENSORS_READY:
|
||||
return BUTTON_IRQ_ENABLED();
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* @(#)$Id: ctsrts-sensor.c,v 1.3 2010/01/14 20:03:27 nifi Exp $
|
||||
* @(#)$Id: ctsrts-sensor.c,v 1.4 2010/02/08 00:00:45 nifi Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -83,7 +83,7 @@ value(int type)
|
||||
static int
|
||||
configure(int type, int value)
|
||||
{
|
||||
switch (type) {
|
||||
switch(type) {
|
||||
case SENSORS_HW_INIT:
|
||||
RS232RTS_SELECT();
|
||||
RS232RTS_MAKE_OUTPUT();
|
||||
@ -92,7 +92,7 @@ configure(int type, int value)
|
||||
RS232CTS_MAKE_INPUT();
|
||||
return 1;
|
||||
case SENSORS_ACTIVE:
|
||||
if (value) {
|
||||
if(value) {
|
||||
if(!RS232CTS_IRQ_ENABLED()) {
|
||||
|
||||
/*
|
||||
@ -120,7 +120,7 @@ configure(int type, int value)
|
||||
static int
|
||||
status(int type)
|
||||
{
|
||||
switch (type) {
|
||||
switch(type) {
|
||||
case SENSORS_ACTIVE:
|
||||
case SENSORS_READY:
|
||||
return RS232CTS_IRQ_ENABLED();
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* @(#)$Id: pir-sensor.c,v 1.3 2010/01/14 17:39:35 nifi Exp $
|
||||
* @(#)$Id: pir-sensor.c,v 1.4 2010/02/08 00:00:45 nifi Exp $
|
||||
*/
|
||||
|
||||
#include "dev/pir-sensor.h"
|
||||
@ -61,14 +61,14 @@ value(int type)
|
||||
static int
|
||||
configure(int type, int value)
|
||||
{
|
||||
switch (type) {
|
||||
switch(type) {
|
||||
case SENSORS_HW_INIT:
|
||||
pir = 0;
|
||||
PIR_SELECT();
|
||||
PIR_MAKE_INPUT();
|
||||
return 1;
|
||||
case SENSORS_ACTIVE:
|
||||
if (value) {
|
||||
if(value) {
|
||||
if(!PIR_IRQ_ENABLED()) {
|
||||
irq_port1_activate(PIR_IRQ(), irq);
|
||||
PIR_ENABLE_IRQ();
|
||||
@ -85,7 +85,7 @@ configure(int type, int value)
|
||||
static int
|
||||
status(int type)
|
||||
{
|
||||
switch (type) {
|
||||
switch(type) {
|
||||
case SENSORS_ACTIVE:
|
||||
case SENSORS_READY:
|
||||
return PIR_IRQ_ENABLED();
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* @(#)$Id: radio-sensor.c,v 1.4 2010/01/14 17:39:35 nifi Exp $
|
||||
* @(#)$Id: radio-sensor.c,v 1.5 2010/02/08 00:00:45 nifi Exp $
|
||||
*/
|
||||
|
||||
#include "dev/radio-sensor.h"
|
||||
@ -62,13 +62,13 @@ value(int type)
|
||||
static int
|
||||
configure(int type, int value)
|
||||
{
|
||||
switch (type) {
|
||||
switch(type) {
|
||||
case SENSORS_HW_INIT:
|
||||
/* Initialization of ADC12 done by irq */
|
||||
radio_sensor_signal = 0;
|
||||
return 1;
|
||||
case SENSORS_ACTIVE:
|
||||
if (value) {
|
||||
if(value) {
|
||||
if(!irq_adc12_active(5)) {
|
||||
irq_adc12_activate(5, (INCH_5 + SREF_0), irq);
|
||||
}
|
||||
@ -84,7 +84,7 @@ configure(int type, int value)
|
||||
static int
|
||||
status(int type)
|
||||
{
|
||||
switch (type) {
|
||||
switch(type) {
|
||||
case SENSORS_ACTIVE:
|
||||
case SENSORS_READY:
|
||||
return irq_adc12_active(5);
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* @(#)$Id: sound-sensor.c,v 1.4 2010/01/14 17:39:35 nifi Exp $
|
||||
* @(#)$Id: sound-sensor.c,v 1.5 2010/02/08 00:00:45 nifi Exp $
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include "dev/sound-sensor.h"
|
||||
@ -67,27 +67,27 @@ irq(void)
|
||||
}
|
||||
}
|
||||
|
||||
/* if (micdiff > MIC_MIN_SENS) { */
|
||||
/* if(micdiff > MIC_MIN_SENS) { */
|
||||
/* sensors_changed(&sound_sensor); */
|
||||
/* } */
|
||||
|
||||
/* if (micdiff > (avgmax >> 2)) { */
|
||||
/* if (micdiff % 10 == 0) beep_beep(10); */
|
||||
/* if(micdiff > (avgmax >> 2)) { */
|
||||
/* if(micdiff % 10 == 0) beep_beep(10); */
|
||||
/* // Subtract a little... */
|
||||
/* micdiff = micdiff - (micdiff >> 4); */
|
||||
/* } */
|
||||
|
||||
/* if (micmax < micdiff) { */
|
||||
/* if(micmax < micdiff) { */
|
||||
/* micmax = micdiff; */
|
||||
/* } */
|
||||
|
||||
/* if (micdiff > 2000) { */
|
||||
/* if(micdiff > 2000) { */
|
||||
/* leds_on(LEDS_GREEN); */
|
||||
/* } */
|
||||
/* if (micdiff > 3000) { */
|
||||
/* if(micdiff > 3000) { */
|
||||
/* leds_on(LEDS_YELLOW); */
|
||||
/* } */
|
||||
/* if (micdiff > 4000) { */
|
||||
/* if(micdiff > 4000) { */
|
||||
/* leds_on(LEDS_RED); */
|
||||
/* } */
|
||||
|
||||
@ -108,14 +108,14 @@ value(int type)
|
||||
static int
|
||||
configure(int type, int value)
|
||||
{
|
||||
switch (type) {
|
||||
switch(type) {
|
||||
case SENSORS_HW_INIT:
|
||||
/* Initialization of ADC12 done by irq */
|
||||
mode = 0;
|
||||
buffer_size = 0;
|
||||
return 1;
|
||||
case SENSORS_ACTIVE:
|
||||
if (value) {
|
||||
if(value) {
|
||||
if(!irq_adc12_active(4)) {
|
||||
sound = micdiff = micmax = 0;
|
||||
mode = 0;
|
||||
@ -136,7 +136,7 @@ configure(int type, int value)
|
||||
static int
|
||||
status(int type)
|
||||
{
|
||||
switch (type) {
|
||||
switch(type) {
|
||||
case SENSORS_ACTIVE:
|
||||
return irq_adc12_active(4);
|
||||
case SENSORS_READY:
|
||||
|
@ -26,14 +26,14 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: temperature-sensor.c,v 1.2 2010/01/14 17:39:35 nifi Exp $
|
||||
* $Id: temperature-sensor.c,v 1.3 2010/02/08 00:00:45 nifi Exp $
|
||||
*
|
||||
* -----------------------------------------------------------------
|
||||
*
|
||||
* Author : Adam Dunkels, Joakim Eriksson, Niclas Finne
|
||||
* Created : 2005-11-01
|
||||
* Updated : $Date: 2010/01/14 17:39:35 $
|
||||
* $Revision: 1.2 $
|
||||
* Updated : $Date: 2010/02/08 00:00:45 $
|
||||
* $Revision: 1.3 $
|
||||
*/
|
||||
|
||||
#include "dev/temperature-sensor.h"
|
||||
@ -57,13 +57,13 @@ value(int type)
|
||||
static int
|
||||
configure(int type, int value)
|
||||
{
|
||||
switch (type) {
|
||||
switch(type) {
|
||||
case SENSORS_HW_INIT:
|
||||
active = 0;
|
||||
ds1629_init();
|
||||
return 1;
|
||||
case SENSORS_ACTIVE:
|
||||
if (value) {
|
||||
if(value) {
|
||||
if(!active) {
|
||||
active = 1;
|
||||
ds1629_start();
|
||||
@ -79,7 +79,7 @@ configure(int type, int value)
|
||||
static int
|
||||
status(int type)
|
||||
{
|
||||
switch (type) {
|
||||
switch(type) {
|
||||
case SENSORS_ACTIVE:
|
||||
case SENSORS_READY:
|
||||
return active;
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* @(#)$Id: vib-sensor.c,v 1.4 2010/01/14 17:39:35 nifi Exp $
|
||||
* @(#)$Id: vib-sensor.c,v 1.5 2010/02/08 00:00:45 nifi Exp $
|
||||
*/
|
||||
|
||||
#include "dev/vib-sensor.h"
|
||||
@ -61,14 +61,14 @@ value(int type)
|
||||
static int
|
||||
configure(int type, int value)
|
||||
{
|
||||
switch (type) {
|
||||
switch(type) {
|
||||
case SENSORS_HW_INIT:
|
||||
vib = 0;
|
||||
VIB_SELECT();
|
||||
VIB_MAKE_INPUT();
|
||||
return 1;
|
||||
case SENSORS_ACTIVE:
|
||||
if (value) {
|
||||
if(value) {
|
||||
if(!VIB_IRQ_ENABLED()) {
|
||||
irq_port1_activate(VIB_IRQ(), irq);
|
||||
VIB_ENABLE_IRQ();
|
||||
@ -85,7 +85,7 @@ configure(int type, int value)
|
||||
static int
|
||||
status(int type)
|
||||
{
|
||||
switch (type) {
|
||||
switch(type) {
|
||||
case SENSORS_ACTIVE:
|
||||
case SENSORS_READY:
|
||||
return VIB_IRQ_ENABLED();
|
||||
|
Loading…
Reference in New Issue
Block a user