Skip to content

Commit

Permalink
DOS EOL and indentation fixes (core/ apps/ cpu/)
Browse files Browse the repository at this point in the history
- Removed some DOS EOLs
- Changed some tabs to spaces
- Removed some trailing whitespaces

Part of Pull Request contiki-os#6
  • Loading branch information
g-oikonomou committed Oct 30, 2012
1 parent 6c8fbd2 commit 713c2e5
Show file tree
Hide file tree
Showing 6 changed files with 266 additions and 266 deletions.
68 changes: 34 additions & 34 deletions apps/collect-view/collect-view-z1.c
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
#include "collect-view.h"
#include "dev/cc2420.h"
#include "dev/leds.h"
#include "dev/i2cmaster.h"
#include "dev/tmp102.h"

#include "collect-view-z1.h"

/*---------------------------------------------------------------------------*/
static uint16_t
get_temp()
{
/* XXX Fix me: check /examples/z1/test-tmp102.c for correct conversion */
return (uint16_t)tmp102_read_temp_raw();
}
/*---------------------------------------------------------------------------*/
void
collect_view_arch_read_sensors(struct collect_view_data_msg *msg)
{
static int initialized = 0;

if(!initialized) {
tmp102_init();
initialized = 1;
}

msg->sensors[BATTERY_VOLTAGE_SENSOR] = 0;
msg->sensors[BATTERY_INDICATOR] = 0;
msg->sensors[LIGHT1_SENSOR] = 0;
msg->sensors[LIGHT2_SENSOR] = 0;
msg->sensors[TEMP_SENSOR] = get_temp();
msg->sensors[HUMIDITY_SENSOR] = 0;
}
/*---------------------------------------------------------------------------*/
#include "collect-view.h"
#include "dev/cc2420.h"
#include "dev/leds.h"
#include "dev/i2cmaster.h"
#include "dev/tmp102.h"

#include "collect-view-z1.h"

/*---------------------------------------------------------------------------*/
static uint16_t
get_temp()
{
/* XXX Fix me: check /examples/z1/test-tmp102.c for correct conversion */
return (uint16_t)tmp102_read_temp_raw();
}
/*---------------------------------------------------------------------------*/
void
collect_view_arch_read_sensors(struct collect_view_data_msg *msg)
{
static int initialized = 0;

if(!initialized) {
tmp102_init();
initialized = 1;
}

msg->sensors[BATTERY_VOLTAGE_SENSOR] = 0;
msg->sensors[BATTERY_INDICATOR] = 0;
msg->sensors[LIGHT1_SENSOR] = 0;
msg->sensors[LIGHT2_SENSOR] = 0;
msg->sensors[TEMP_SENSOR] = get_temp();
msg->sensors[HUMIDITY_SENSOR] = 0;
}
/*---------------------------------------------------------------------------*/
2 changes: 1 addition & 1 deletion core/net/mac/contikimac.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr, struct rdc_buf_

len = 0;


{
rtimer_clock_t wt;
rtimer_clock_t txtime;
Expand Down
28 changes: 14 additions & 14 deletions core/net/mac/lpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ input_packet(void)
{
struct lpp_hdr hdr;
clock_time_t reception_time;
int ret;
int ret;

reception_time = clock_time();

Expand Down Expand Up @@ -845,7 +845,7 @@ input_packet(void)
if(i->broadcast_flag == BROADCAST_FLAG_NONE ||
i->broadcast_flag == BROADCAST_FLAG_SEND) {
i->num_transmissions = 1;
ret = NETSTACK_RADIO.send(queuebuf_dataptr(i->packet),
ret = NETSTACK_RADIO.send(queuebuf_dataptr(i->packet),
queuebuf_datalen(i->packet));
sent = 1;
PRINTF("%d.%d: got a probe from %d.%d, sent packet to %d.%d\n",
Expand All @@ -860,7 +860,7 @@ input_packet(void)
}
#else /* WITH_PENDING_BROADCAST */
i->num_transmissions = 1;
ret = NETSTACK_RADIO.send(queuebuf_dataptr(i->packet),
ret = NETSTACK_RADIO.send(queuebuf_dataptr(i->packet),
queuebuf_datalen(i->packet));
PRINTF("%d.%d: got a probe from %d.%d, sent packet to %d.%d\n",
rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1],
Expand All @@ -879,23 +879,23 @@ input_packet(void)
neighbors, and are dequeued by the dutycycling function
instead, after the appropriate time. */
if(!rimeaddr_cmp(receiver, &rimeaddr_null)) {
#if RDC_CONF_HARDWARE_ACK
if(ret == RADIO_TX_OK) {
remove_queued_packet(i, 1);
} else {
remove_queued_packet(i, 0);
}
#else
#if RDC_CONF_HARDWARE_ACK

if(ret == RADIO_TX_OK) {
remove_queued_packet(i, 1);
} else {
remove_queued_packet(i, 0);
}
#else
if(detect_ack()) {
remove_queued_packet(i, 1);
} else {
remove_queued_packet(i, 0);
}

#endif /* RDC_CONF_HARDWARE_ACK */


#endif /* RDC_CONF_HARDWARE_ACK */


#if WITH_PROBE_AFTER_TRANSMISSION
/* Send a probe packet to catch any reply from the other node. */
restart_dutycycle(PROBE_AFTER_TRANSMISSION_TIME);
Expand Down
40 changes: 20 additions & 20 deletions core/net/mac/xmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ send_packet(void)
rtimer_clock_t t;
rtimer_clock_t encounter_time = 0;
int strobes;
int ret;
int ret;
#if 0
struct xmac_hdr *hdr;
#endif
Expand Down Expand Up @@ -641,19 +641,19 @@ send_packet(void)

if(is_broadcast) {
#if WITH_STROBE_BROADCAST
ret = NETSTACK_RADIO.send(strobe, strobe_len);
ret = NETSTACK_RADIO.send(strobe, strobe_len);
#else
/* restore the packet to send */
queuebuf_to_packetbuf(packet);
ret = NETSTACK_RADIO.send(packetbuf_hdrptr(), packetbuf_totlen());
ret = NETSTACK_RADIO.send(packetbuf_hdrptr(), packetbuf_totlen());
#endif
off();
} else {
#if 0
rtimer_clock_t wt;
#endif
on();
ret = NETSTACK_RADIO.send(strobe, strobe_len);
ret = NETSTACK_RADIO.send(strobe, strobe_len);
#if 0
/* Turn off the radio for a while to let the other side
respond. We don't need to keep our radio on when we know
Expand All @@ -662,20 +662,20 @@ send_packet(void)
wt = RTIMER_NOW();
while(RTIMER_CLOCK_LT(RTIMER_NOW(), wt + WAIT_TIME_BEFORE_STROBE_ACK));
#endif /* 0 */
#if RDC_CONF_HARDWARE_ACK
if(ret == RADIO_TX_OK) {
got_strobe_ack = 1;
} else {
off();
}
#else
#if RDC_CONF_HARDWARE_ACK
if(ret == RADIO_TX_OK) {
got_strobe_ack = 1;
} else {
off();
}
#else
if(detect_ack()) {
got_strobe_ack = 1;
} else {
off();
}
#endif /* RDC_CONF_HARDWARE_ACK */

#endif /* RDC_CONF_HARDWARE_ACK */

}
}
}
Expand All @@ -702,18 +702,18 @@ send_packet(void)

/* Send the data packet. */
if((is_broadcast || got_strobe_ack || is_streaming) && collisions == 0) {
ret = NETSTACK_RADIO.send(packetbuf_hdrptr(), packetbuf_totlen());
ret = NETSTACK_RADIO.send(packetbuf_hdrptr(), packetbuf_totlen());

if(!is_broadcast) {
#if RDC_CONF_HARDWARE_ACK
if(ret == RADIO_TX_OK) {
got_ack = 1;
}
#else
#if RDC_CONF_HARDWARE_ACK
if(ret == RADIO_TX_OK) {
got_ack = 1;
}
#else
if(detect_ack()) {
got_ack = 1;
}
#endif /* RDC_CONF_HARDWARE_ACK */
#endif /* RDC_CONF_HARDWARE_ACK */
}
}
off();
Expand Down
Loading

0 comments on commit 713c2e5

Please sign in to comment.