mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
Corrects some leftover uncapitalized printfs which may cause some platforms
to crash.
This commit is contained in:
parent
8451a4198d
commit
071cfaf1cb
@ -215,6 +215,7 @@ static volatile uint8_t contikimac_keep_radio_on = 0;
|
||||
static volatile unsigned char we_are_sending = 0;
|
||||
static volatile unsigned char radio_is_on = 0;
|
||||
|
||||
#undef DEBUG
|
||||
#define DEBUG 0
|
||||
#if DEBUG
|
||||
#include <stdio.h>
|
||||
@ -304,7 +305,7 @@ schedule_powercycle(struct rtimer *t, rtimer_clock_t time)
|
||||
r = rtimer_set(t, RTIMER_TIME(t) + time, 1,
|
||||
(void (*)(struct rtimer *, void *))powercycle, NULL);
|
||||
if(r != RTIMER_OK) {
|
||||
printf("schedule_powercycle: could not set rtimer\n");
|
||||
PRINTF("schedule_powercycle: could not set rtimer\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -323,7 +324,7 @@ schedule_powercycle_fixed(struct rtimer *t, rtimer_clock_t fixed_time)
|
||||
r = rtimer_set(t, fixed_time, 1,
|
||||
(void (*)(struct rtimer *, void *))powercycle, NULL);
|
||||
if(r != RTIMER_OK) {
|
||||
printf("schedule_powercycle: could not set rtimer\n");
|
||||
PRINTF("schedule_powercycle: could not set rtimer\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -193,6 +193,7 @@ struct {
|
||||
|
||||
/* Debug definition: draw routing tree in Cooja. */
|
||||
#define DRAW_TREE 0
|
||||
#undef DEBUG
|
||||
#define DEBUG 0
|
||||
#if DEBUG
|
||||
#include <stdio.h>
|
||||
@ -310,7 +311,7 @@ update_parent(struct collect_conn *tc)
|
||||
bump_advertisement(tc);
|
||||
} else {
|
||||
if(DRAW_TREE) {
|
||||
printf("#A e=%d\n", collect_neighbor_link_estimate(best));
|
||||
PRINTF("#A e=%d\n", collect_neighbor_link_estimate(best));
|
||||
}
|
||||
if(collect_neighbor_rtmetric_link_estimate(best) +
|
||||
SIGNIFICANT_RTMETRIC_PARENT_CHANGE <
|
||||
@ -329,30 +330,30 @@ update_parent(struct collect_conn *tc)
|
||||
bump_advertisement(tc);
|
||||
|
||||
if(DRAW_TREE) {
|
||||
printf("#A e=%d\n", collect_neighbor_link_estimate(best));
|
||||
PRINTF("#A e=%d\n", collect_neighbor_link_estimate(best));
|
||||
/* {
|
||||
int i;
|
||||
int etx = 0;
|
||||
printf("#A l=");
|
||||
PRINTF("#A l=");
|
||||
for(i = 0; i < 8; i++) {
|
||||
printf("%d ", best->le.history[(best->le.historyptr - 1 - i) & 7]);
|
||||
PRINTF("%d ", best->le.history[(best->le.historyptr - 1 - i) & 7]);
|
||||
etx += current->le.history[i];
|
||||
}
|
||||
printf("\n");
|
||||
PRINTF("\n");
|
||||
}*/
|
||||
}
|
||||
} else {
|
||||
if(DRAW_TREE) {
|
||||
printf("#A e=%d\n", collect_neighbor_link_estimate(current));
|
||||
PRINTF("#A e=%d\n", collect_neighbor_link_estimate(current));
|
||||
/* {
|
||||
int i;
|
||||
int etx = 0;
|
||||
printf("#A l=");
|
||||
PRINTF("#A l=");
|
||||
for(i = 0; i < 8; i++) {
|
||||
printf("%d ", current->le.history[(current->le.historyptr - 1 - i) & 7]);
|
||||
PRINTF("%d ", current->le.history[(current->le.historyptr - 1 - i) & 7]);
|
||||
etx += current->le.history[i];
|
||||
}
|
||||
printf("\n");
|
||||
PRINTF("\n");
|
||||
}*/
|
||||
}
|
||||
}
|
||||
@ -360,16 +361,16 @@ update_parent(struct collect_conn *tc)
|
||||
if(DRAW_TREE) {
|
||||
if(!rimeaddr_cmp(&previous_parent, &tc->parent)) {
|
||||
if(!rimeaddr_cmp(&previous_parent, &rimeaddr_null)) {
|
||||
printf("#L %d 0\n", previous_parent.u8[0]);
|
||||
PRINTF("#L %d 0\n", previous_parent.u8[0]);
|
||||
}
|
||||
printf("#L %d 1\n", tc->parent.u8[0]);
|
||||
PRINTF("#L %d 1\n", tc->parent.u8[0]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* No parent. */
|
||||
if(!rimeaddr_cmp(&tc->parent, &rimeaddr_null)) {
|
||||
if(DRAW_TREE) {
|
||||
printf("#L %d 0\n", tc->parent.u8[0]);
|
||||
PRINTF("#L %d 0\n", tc->parent.u8[0]);
|
||||
}
|
||||
stats.routelost++;
|
||||
}
|
||||
@ -437,7 +438,7 @@ update_rtmetric(struct collect_conn *tc)
|
||||
}
|
||||
if(DRAW_TREE) {
|
||||
if(old_rtmetric != new_rtmetric) {
|
||||
printf("#A rt=%d,p=%d\n", tc->rtmetric, tc->parent.u8[0]);
|
||||
PRINTF("#A rt=%d,p=%d\n", tc->rtmetric, tc->parent.u8[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -772,7 +773,7 @@ handle_ack(struct collect_conn *tc)
|
||||
&tc->current_parent) &&
|
||||
packetbuf_attr(PACKETBUF_ATTR_PACKET_ID) == tc->seqno) {
|
||||
|
||||
/* printf("rtt %d / %d = %d.%02d\n",
|
||||
/* PRINTF("rtt %d / %d = %d.%02d\n",
|
||||
(int)(clock_time() - tc->send_time),
|
||||
(int)CLOCK_SECOND,
|
||||
(int)((clock_time() - tc->send_time) / CLOCK_SECOND),
|
||||
@ -945,7 +946,7 @@ node_packet_received(struct unicast_conn *c, const rimeaddr_t *from)
|
||||
/* If the queue is more than half filled, we add the CONGESTED
|
||||
flag to our outgoing acks. */
|
||||
if(DRAW_TREE) {
|
||||
printf("#A s=%d\n", packetqueue_len(&tc->send_queue));
|
||||
PRINTF("#A s=%d\n", packetqueue_len(&tc->send_queue));
|
||||
}
|
||||
if(packetqueue_len(&tc->send_queue) >= MAX_SENDING_QUEUE / 2) {
|
||||
ackflags |= ACK_FLAGS_CONGESTED;
|
||||
@ -1089,7 +1090,7 @@ timedout(struct collect_conn *tc)
|
||||
rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1], tc->transmissions,
|
||||
tc->current_parent.u8[0], tc->current_parent.u8[1],
|
||||
tc->max_rexmits);
|
||||
printf("%d.%d: timedout after %d retransmissions to %d.%d (max retransmissions %d): packet dropped\n",
|
||||
PRINTF("%d.%d: timedout after %d retransmissions to %d.%d (max retransmissions %d): packet dropped\n",
|
||||
rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1], tc->transmissions,
|
||||
tc->current_parent.u8[0], tc->current_parent.u8[1],
|
||||
tc->max_rexmits);
|
||||
@ -1394,7 +1395,7 @@ collect_set_sink(struct collect_conn *tc, int should_be_sink)
|
||||
bump_advertisement(tc);
|
||||
|
||||
if(DRAW_TREE) {
|
||||
printf("#A rt=0,p=0\n");
|
||||
PRINTF("#A rt=0,p=0\n");
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
@ -1455,7 +1456,7 @@ collect_send(struct collect_conn *tc, int rexmits)
|
||||
} else {
|
||||
PRINTF("%d.%d: drop originated packet: no queuebuf\n",
|
||||
rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1]);
|
||||
printf("%d.%d: drop originated packet: no queuebuf\n",
|
||||
PRINTF("%d.%d: drop originated packet: no queuebuf\n",
|
||||
rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1]);
|
||||
ret = 0;
|
||||
}
|
||||
@ -1491,7 +1492,7 @@ collect_send(struct collect_conn *tc, int rexmits)
|
||||
} else {
|
||||
PRINTF("%d.%d: drop originated packet: no queuebuf\n",
|
||||
rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1]);
|
||||
printf("%d.%d: drop originated packet: no queuebuf\n",
|
||||
PRINTF("%d.%d: drop originated packet: no queuebuf\n",
|
||||
rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1]);
|
||||
}*/
|
||||
}
|
||||
@ -1518,7 +1519,7 @@ collect_purge(struct collect_conn *tc)
|
||||
rimeaddr_copy(&tc->parent, &rimeaddr_null);
|
||||
update_rtmetric(tc);
|
||||
if(DRAW_TREE) {
|
||||
printf("#L %d 0\n", tc->parent.u8[0]);
|
||||
PRINTF("#L %d 0\n", tc->parent.u8[0]);
|
||||
}
|
||||
rimeaddr_copy(&tc->parent, &rimeaddr_null);
|
||||
}
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "net/uiplib.h"
|
||||
#include <string.h>
|
||||
|
||||
#undef DEBUG
|
||||
#define DEBUG DEBUG_NONE
|
||||
#include "net/uip-debug.h"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user