fixed for compilation with IAR compiler
This commit is contained in:
parent
928bf6b6c1
commit
d8e54ca585
7 changed files with 27 additions and 7 deletions
|
@ -39,6 +39,7 @@
|
|||
*/
|
||||
|
||||
#include "contiki.h"
|
||||
#include "io.h"
|
||||
#include "dev/cc2420.h"
|
||||
#include "dev/cc2420-aes.h"
|
||||
#include "dev/spi.h"
|
||||
|
|
|
@ -41,8 +41,12 @@
|
|||
#if defined(__AVR__)
|
||||
#include <avr/io.h>
|
||||
#elif defined(__MSP430__)
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <io430.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "dev/leds.h"
|
||||
#include "dev/spi.h"
|
||||
|
|
|
@ -33,9 +33,9 @@
|
|||
#ifndef __ME_TABS_H__
|
||||
#define __ME_TABS_H__
|
||||
|
||||
const unsigned short me_encode_tab[256];
|
||||
const unsigned char me_decode_tab[256];
|
||||
const unsigned char me_valid_tab[256];
|
||||
extern const unsigned short me_encode_tab[256];
|
||||
extern const unsigned char me_decode_tab[256];
|
||||
extern const unsigned char me_valid_tab[256];
|
||||
|
||||
#endif /* __ME_TABS_H__ */
|
||||
|
||||
|
|
|
@ -142,6 +142,8 @@ remove_worst_parent(rpl_dag_t *dag, rpl_rank_t min_worst_rank)
|
|||
static int
|
||||
should_send_dao(rpl_dag_t *dag, rpl_dio_t *dio, rpl_parent_t *p)
|
||||
{
|
||||
/* if MOP is set to no downward routes no DAO should be sent */
|
||||
if(dag->mop == RPL_MOP_NO_DOWNWARD_ROUTES) return 0;
|
||||
return dio->dtsn > p->dtsn && p == dag->preferred_parent;
|
||||
}
|
||||
/************************************************************************/
|
||||
|
@ -352,7 +354,9 @@ rpl_select_parent(rpl_dag_t *dag)
|
|||
dag->of->update_metric_container(dag);
|
||||
rpl_set_default_route(dag, &best->addr);
|
||||
/* The DAO parent set changed - schedule a DAO transmission. */
|
||||
rpl_schedule_dao(dag);
|
||||
if(dag->mop != RPL_MOP_NO_DOWNWARD_ROUTES) {
|
||||
rpl_schedule_dao(dag);
|
||||
}
|
||||
rpl_reset_dio_timer(dag, 1);
|
||||
PRINTF("RPL: New preferred parent, rank changed from %u to %u\n",
|
||||
(unsigned)dag->rank, dag->of->calculate_rank(best, 0));
|
||||
|
|
|
@ -170,7 +170,12 @@
|
|||
#define RPL_MOP_NON_STORING 1
|
||||
#define RPL_MOP_STORING_NO_MULTICAST 2
|
||||
#define RPL_MOP_STORING_MULTICAST 3
|
||||
|
||||
#ifdef RPL_CONF_MOP
|
||||
#define RPL_MOP_DEFAULT RPL_CONF_MOP
|
||||
#else
|
||||
#define RPL_MOP_DEFAULT RPL_MOP_STORING_NO_MULTICAST
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The ETX in the metric container is expressed as a fixed-point value
|
||||
|
|
|
@ -571,7 +571,10 @@ compress_hdr_hc06(rimeaddr_t *rime_destaddr)
|
|||
iphc1 |= compress_addr_64(SICSLOWPAN_IPHC_SAM_BIT,
|
||||
&UIP_IP_BUF->srcipaddr, &uip_lladdr);
|
||||
/* No context found for this address */
|
||||
} else if(uip_is_addr_link_local(&UIP_IP_BUF->srcipaddr)) {
|
||||
} else if(uip_is_addr_link_local(&UIP_IP_BUF->srcipaddr) &&
|
||||
UIP_IP_BUF->destipaddr.u16[1] == 0 &&
|
||||
UIP_IP_BUF->destipaddr.u16[2] == 0 &&
|
||||
UIP_IP_BUF->destipaddr.u16[3] == 0) {
|
||||
iphc1 |= compress_addr_64(SICSLOWPAN_IPHC_SAM_BIT,
|
||||
&UIP_IP_BUF->srcipaddr, &uip_lladdr);
|
||||
} else {
|
||||
|
@ -619,7 +622,10 @@ compress_hdr_hc06(rimeaddr_t *rime_destaddr)
|
|||
iphc1 |= compress_addr_64(SICSLOWPAN_IPHC_DAM_BIT,
|
||||
&UIP_IP_BUF->destipaddr, (uip_lladdr_t *)rime_destaddr);
|
||||
/* No context found for this address */
|
||||
} else if(uip_is_addr_link_local(&UIP_IP_BUF->destipaddr)) {
|
||||
} else if(uip_is_addr_link_local(&UIP_IP_BUF->destipaddr) &&
|
||||
UIP_IP_BUF->destipaddr.u16[1] == 0 &&
|
||||
UIP_IP_BUF->destipaddr.u16[2] == 0 &&
|
||||
UIP_IP_BUF->destipaddr.u16[3] == 0) {
|
||||
iphc1 |= compress_addr_64(SICSLOWPAN_IPHC_DAM_BIT,
|
||||
&UIP_IP_BUF->destipaddr, (uip_lladdr_t *)rime_destaddr);
|
||||
} else {
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include "net/uip-ds6.h"
|
||||
#include "net/uip-packetqueue.h"
|
||||
|
||||
#define DEBUG DEBUG_NONE
|
||||
#define DEBUG DEBUG_ANNOTATE
|
||||
#include "net/uip-debug.h"
|
||||
|
||||
#ifdef UIP_CONF_DS6_NEIGHBOR_STATE_CHANGED
|
||||
|
|
Loading…
Reference in a new issue