* Use literal constant.

* Better debug printf.
This commit is contained in:
bg- 2007-04-30 09:42:16 +00:00
parent e7d7e31bc9
commit f2ea90ba06

View file

@ -17,6 +17,7 @@
u8_t u8_t
cc2420_send_ip(void) cc2420_send_ip(void)
{ {
int ret;
struct hdr_802_15 h; struct hdr_802_15 h;
u8_t color = (cc2420_ack_received) ? LEDS_BLUE : LEDS_RED; u8_t color = (cc2420_ack_received) ? LEDS_BLUE : LEDS_RED;
@ -37,7 +38,7 @@ cc2420_send_ip(void)
else else
next_gw = &uip_draddr; /* Default router. */ next_gw = &uip_draddr; /* Default router. */
if (cc2420_check_remote(next_gw->u16[1]) == 1) if (cc2420_check_remote(next_gw->u16[1]) == REMOTE_YES)
h.dst = 0xffff; /* remote, use bcast */ h.dst = 0xffff; /* remote, use bcast */
else else
h.dst = next_gw->u16[1]; /* local or unknown, use ucast */ h.dst = next_gw->u16[1]; /* local or unknown, use ucast */
@ -47,8 +48,9 @@ cc2420_send_ip(void)
if (h.dst == 0xffff) if (h.dst == 0xffff)
h.fc0 &= ~FC0_REQ_ACK; h.fc0 &= ~FC0_REQ_ACK;
if (cc2420_send(&h, 10, &uip_buf[UIP_LLH_LEN], uip_len) < 0) { ret = cc2420_send(&h, 10, &uip_buf[UIP_LLH_LEN], uip_len);
printf("cc2420_send_ip failed uip_len=%d\n", uip_len); if (ret < 0) {
printf("cc2420_send_ip failed uip_len=%d ret=%d\n", uip_len, ret);
leds_toggle(color); leds_toggle(color);
return UIP_FW_TOOLARGE; return UIP_FW_TOOLARGE;
} }