Some uN_t had crept back in cc2530dk and sensinode.
Changed to uintN_t plus a bit of code formatting
This commit is contained in:
parent
9475737f4b
commit
4f1e251603
9 changed files with 21 additions and 32 deletions
|
@ -40,13 +40,8 @@
|
||||||
#define CC_CONF_FUNCTION_POINTER_KEYWORD __reentrant
|
#define CC_CONF_FUNCTION_POINTER_KEYWORD __reentrant
|
||||||
|
|
||||||
/* Generic types. */
|
/* Generic types. */
|
||||||
typedef unsigned char u8_t; /* 8 bit type */
|
|
||||||
typedef unsigned short u16_t; /* 16 bit type */
|
|
||||||
typedef unsigned long u32_t; /* 32 bit type */
|
|
||||||
typedef signed long s32_t; /* 32 bit type */
|
|
||||||
typedef unsigned short uip_stats_t;
|
typedef unsigned short uip_stats_t;
|
||||||
|
|
||||||
|
|
||||||
/* Time type. */
|
/* Time type. */
|
||||||
typedef unsigned short clock_time_t;
|
typedef unsigned short clock_time_t;
|
||||||
#define MAX_TICKS (~((clock_time_t)0) / 2)
|
#define MAX_TICKS (~((clock_time_t)0) / 2)
|
||||||
|
|
|
@ -40,10 +40,6 @@
|
||||||
#define CC_CONF_FUNCTION_POINTER_KEYWORD __reentrant
|
#define CC_CONF_FUNCTION_POINTER_KEYWORD __reentrant
|
||||||
|
|
||||||
/* Generic types. */
|
/* Generic types. */
|
||||||
typedef unsigned char u8_t; /* 8 bit type */
|
|
||||||
typedef unsigned short u16_t; /* 16 bit type */
|
|
||||||
typedef unsigned long u32_t; /* 32 bit type */
|
|
||||||
typedef signed long s32_t; /* 32 bit type */
|
|
||||||
typedef unsigned short uip_stats_t;
|
typedef unsigned short uip_stats_t;
|
||||||
|
|
||||||
/* Compiler configurations */
|
/* Compiler configurations */
|
||||||
|
|
|
@ -46,8 +46,8 @@
|
||||||
#define UIP_ICMP_BUF ((struct uip_icmp_hdr *)&uip_buf[uip_l2_l3_hdr_len])
|
#define UIP_ICMP_BUF ((struct uip_icmp_hdr *)&uip_buf[uip_l2_l3_hdr_len])
|
||||||
|
|
||||||
static struct etimer ping6_periodic_timer;
|
static struct etimer ping6_periodic_timer;
|
||||||
static u8_t count = 0;
|
static uint8_t count = 0;
|
||||||
static u16_t addr[8];
|
static uint16_t addr[8];
|
||||||
static uip_ipaddr_t dest_addr;
|
static uip_ipaddr_t dest_addr;
|
||||||
|
|
||||||
PROCESS(ping6_process, "PING6 process");
|
PROCESS(ping6_process, "PING6 process");
|
||||||
|
@ -74,8 +74,8 @@ ping6handler()
|
||||||
|
|
||||||
|
|
||||||
uip_len = UIP_ICMPH_LEN + UIP_ICMP6_ECHO_REQUEST_LEN + UIP_IPH_LEN + PING6_DATALEN;
|
uip_len = UIP_ICMPH_LEN + UIP_ICMP6_ECHO_REQUEST_LEN + UIP_IPH_LEN + PING6_DATALEN;
|
||||||
UIP_IP_BUF->len[0] = (u8_t)((uip_len - 40) >> 8);
|
UIP_IP_BUF->len[0] = (uint8_t)((uip_len - 40) >> 8);
|
||||||
UIP_IP_BUF->len[1] = (u8_t)((uip_len - 40) & 0x00FF);
|
UIP_IP_BUF->len[1] = (uint8_t)((uip_len - 40) & 0x00FF);
|
||||||
|
|
||||||
UIP_ICMP_BUF->icmpchksum = 0;
|
UIP_ICMP_BUF->icmpchksum = 0;
|
||||||
UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum();
|
UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum();
|
||||||
|
|
|
@ -19,7 +19,7 @@ PROCESS_THREAD(clock_test_process, ev, data)
|
||||||
static struct etimer et;
|
static struct etimer et;
|
||||||
static clock_time_t count, start_count, end_count, diff;
|
static clock_time_t count, start_count, end_count, diff;
|
||||||
static unsigned long sec;
|
static unsigned long sec;
|
||||||
static u8_t i;
|
static uint8_t i;
|
||||||
|
|
||||||
PROCESS_BEGIN();
|
PROCESS_BEGIN();
|
||||||
|
|
||||||
|
@ -41,8 +41,8 @@ PROCESS_THREAD(clock_test_process, ev, data)
|
||||||
PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et));
|
PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et));
|
||||||
etimer_reset(&et);
|
etimer_reset(&et);
|
||||||
|
|
||||||
count = clock_time();
|
count = clock_time();
|
||||||
printf("%u ticks\n", count);
|
printf("%u ticks\n", count);
|
||||||
|
|
||||||
leds_toggle(LEDS_RED);
|
leds_toggle(LEDS_RED);
|
||||||
i++;
|
i++;
|
||||||
|
@ -55,8 +55,8 @@ PROCESS_THREAD(clock_test_process, ev, data)
|
||||||
PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et));
|
PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et));
|
||||||
etimer_reset(&et);
|
etimer_reset(&et);
|
||||||
|
|
||||||
sec = clock_seconds();
|
sec = clock_seconds();
|
||||||
printf("%u seconds\n", (u16_t) sec);
|
printf("%u seconds\n", (uint16_t) sec);
|
||||||
|
|
||||||
leds_toggle(LEDS_GREEN);
|
leds_toggle(LEDS_GREEN);
|
||||||
i++;
|
i++;
|
||||||
|
|
|
@ -10,13 +10,13 @@
|
||||||
#define EVENT_POST_H_
|
#define EVENT_POST_H_
|
||||||
|
|
||||||
struct event_struct {
|
struct event_struct {
|
||||||
short s_val;
|
short s_val;
|
||||||
int i_val;
|
int i_val;
|
||||||
long l_val;
|
long l_val;
|
||||||
long long ll_val;
|
long long ll_val;
|
||||||
u8_t u8_val;
|
uint8_t u8_val;
|
||||||
u16_t u16_val;
|
uint16_t u16_val;
|
||||||
u32_t u32_val;
|
uint32_t u32_val;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* EVENT_POST_H_ */
|
#endif /* EVENT_POST_H_ */
|
||||||
|
|
|
@ -111,7 +111,7 @@ PROCESS_THREAD(clock_test_process, ev, data)
|
||||||
etimer_reset(&et);
|
etimer_reset(&et);
|
||||||
|
|
||||||
sec = clock_seconds();
|
sec = clock_seconds();
|
||||||
printf("%u seconds\n", (u16_t) sec);
|
printf("%u seconds\n", (uint16_t) sec);
|
||||||
|
|
||||||
leds_toggle(LEDS_GREEN);
|
leds_toggle(LEDS_GREEN);
|
||||||
i++;
|
i++;
|
||||||
|
|
|
@ -48,8 +48,8 @@
|
||||||
#define UIP_ICMP_BUF ((struct uip_icmp_hdr *)&uip_buf[uip_l2_l3_hdr_len])
|
#define UIP_ICMP_BUF ((struct uip_icmp_hdr *)&uip_buf[uip_l2_l3_hdr_len])
|
||||||
|
|
||||||
static struct etimer ping6_periodic_timer;
|
static struct etimer ping6_periodic_timer;
|
||||||
static u8_t count = 0;
|
static uint8_t count = 0;
|
||||||
static u16_t addr[8];
|
static uint16_t addr[8];
|
||||||
static uip_ipaddr_t dest_addr;
|
static uip_ipaddr_t dest_addr;
|
||||||
|
|
||||||
PROCESS(ping6_process, "PING6 process");
|
PROCESS(ping6_process, "PING6 process");
|
||||||
|
@ -76,8 +76,8 @@ ping6handler()
|
||||||
|
|
||||||
|
|
||||||
uip_len = UIP_ICMPH_LEN + UIP_ICMP6_ECHO_REQUEST_LEN + UIP_IPH_LEN + PING6_DATALEN;
|
uip_len = UIP_ICMPH_LEN + UIP_ICMP6_ECHO_REQUEST_LEN + UIP_IPH_LEN + PING6_DATALEN;
|
||||||
UIP_IP_BUF->len[0] = (u8_t)((uip_len - 40) >> 8);
|
UIP_IP_BUF->len[0] = (uint8_t)((uip_len - 40) >> 8);
|
||||||
UIP_IP_BUF->len[1] = (u8_t)((uip_len - 40) & 0x00FF);
|
UIP_IP_BUF->len[1] = (uint8_t)((uip_len - 40) & 0x00FF);
|
||||||
|
|
||||||
UIP_ICMP_BUF->icmpchksum = 0;
|
UIP_ICMP_BUF->icmpchksum = 0;
|
||||||
UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum();
|
UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum();
|
||||||
|
|
|
@ -71,7 +71,6 @@ extern uip_ds6_netif_t uip_ds6_if;
|
||||||
extern uip_ds6_route_t uip_ds6_routing_table[UIP_DS6_ROUTE_NB];
|
extern uip_ds6_route_t uip_ds6_routing_table[UIP_DS6_ROUTE_NB];
|
||||||
extern uip_ds6_nbr_t uip_ds6_nbr_cache[UIP_DS6_NBR_NB];
|
extern uip_ds6_nbr_t uip_ds6_nbr_cache[UIP_DS6_NBR_NB];
|
||||||
extern uip_ds6_defrt_t uip_ds6_defrt_list[UIP_DS6_DEFRT_NB];
|
extern uip_ds6_defrt_t uip_ds6_defrt_list[UIP_DS6_DEFRT_NB];
|
||||||
extern u16_t uip_len;
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static uint8_t
|
static uint8_t
|
||||||
process_request()
|
process_request()
|
||||||
|
|
|
@ -71,7 +71,6 @@ extern uip_ds6_netif_t uip_ds6_if;
|
||||||
extern uip_ds6_route_t uip_ds6_routing_table[UIP_DS6_ROUTE_NB];
|
extern uip_ds6_route_t uip_ds6_routing_table[UIP_DS6_ROUTE_NB];
|
||||||
extern uip_ds6_nbr_t uip_ds6_nbr_cache[UIP_DS6_NBR_NB];
|
extern uip_ds6_nbr_t uip_ds6_nbr_cache[UIP_DS6_NBR_NB];
|
||||||
extern uip_ds6_defrt_t uip_ds6_defrt_list[UIP_DS6_DEFRT_NB];
|
extern uip_ds6_defrt_t uip_ds6_defrt_list[UIP_DS6_DEFRT_NB];
|
||||||
extern u16_t uip_len;
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static uint8_t
|
static uint8_t
|
||||||
process_request()
|
process_request()
|
||||||
|
|
Loading…
Add table
Reference in a new issue