diff --git a/platform/avr-atmega128rfa1/apps/raven-ipso/raven-ipso.c b/platform/avr-atmega128rfa1/apps/raven-ipso/raven-ipso.c index 1ba134848..4e82eb959 100644 --- a/platform/avr-atmega128rfa1/apps/raven-ipso/raven-ipso.c +++ b/platform/avr-atmega128rfa1/apps/raven-ipso/raven-ipso.c @@ -69,18 +69,18 @@ #define cmd_len 8 #define data_len 20 -static u8_t seqno; +static uint8_t seqno; uip_ipaddr_t ping_addr; uip_ipaddr_t udp_addr; static struct uip_udp_conn *udp_conn; char udp_data[data_len]; static struct{ - u8_t frame[cmd_len]; - u8_t ndx; - u8_t len; - u8_t cmd; - u8_t done; + uint8_t frame[cmd_len]; + uint8_t ndx; + uint8_t len; + uint8_t cmd; + uint8_t done; } cmd; #define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) @@ -114,8 +114,8 @@ raven_ping6(void) memset((void *)UIP_ICMP_BUF + UIP_ICMPH_LEN, 0, 4); uip_len = UIP_ICMPH_LEN + UIP_ICMP6_ECHO_REQUEST_LEN + UIP_IPH_LEN; - UIP_IP_BUF->len[0] = (u8_t)((uip_len - 40) >> 8); - UIP_IP_BUF->len[1] = (u8_t)((uip_len - 40) & 0x00FF); + UIP_IP_BUF->len[0] = (uint8_t)((uip_len - 40) >> 8); + UIP_IP_BUF->len[1] = (uint8_t)((uip_len - 40) & 0x00FF); UIP_ICMP_BUF->icmpchksum = 0; UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum(); @@ -140,7 +140,7 @@ send_frame(uint8_t cmd, uint8_t len, uint8_t *payload) } /*------------------------------------------------------------------*/ -static u8_t +static uint8_t raven_gui_loop(process_event_t ev, process_data_t data) { if(ev == tcpip_icmp6_event) { @@ -235,7 +235,7 @@ int raven_lcd_serial_input(unsigned char ch) PROCESS(raven_lcd_process, "Raven LCD interface process"); PROCESS_THREAD(raven_lcd_process, ev, data) { - u8_t error; + uint8_t error; PROCESS_BEGIN(); diff --git a/platform/avr-atmega128rfa1/apps/raven-lcd-interface/raven-lcd.c b/platform/avr-atmega128rfa1/apps/raven-lcd-interface/raven-lcd.c index 9fd7d7784..c4668f7d3 100644 --- a/platform/avr-atmega128rfa1/apps/raven-lcd-interface/raven-lcd.c +++ b/platform/avr-atmega128rfa1/apps/raven-lcd-interface/raven-lcd.c @@ -76,17 +76,17 @@ #include #include -static u8_t count = 0; -static u8_t seqno; +static uint8_t count = 0; +static uint8_t seqno; uip_ipaddr_t dest_addr; #define MAX_CMD_LEN 20 static struct{ - u8_t frame[MAX_CMD_LEN]; - u8_t ndx; - u8_t len; - u8_t cmd; - u8_t done; + uint8_t frame[MAX_CMD_LEN]; + uint8_t ndx; + uint8_t len; + uint8_t cmd; + uint8_t done; } cmd; #define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) @@ -138,8 +138,8 @@ seqno++; 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[1] = (u8_t)((uip_len - 40) & 0x00FF); + UIP_IP_BUF->len[0] = (uint8_t)((uip_len - 40) >> 8); + UIP_IP_BUF->len[1] = (uint8_t)((uip_len - 40) & 0x00FF); UIP_ICMP_BUF->icmpchksum = 0; UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum(); @@ -262,13 +262,13 @@ ISR(TIMER2_COMPA_vect) #endif /* !AVR_CONF_USE32KCRYSTAL */ #if DEBUGSERIAL -u8_t serialcount; +uint8_t serialcount; char dbuf[30]; #endif /*---------------------------------------------------------------------------*/ extern uint16_t ledtimer; -static u8_t +static uint8_t raven_gui_loop(process_event_t ev, process_data_t data) { uint8_t i,activeconnections,radio_state; diff --git a/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-cgi.c b/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-cgi.c index 78fd68626..36a47a661 100644 --- a/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-cgi.c +++ b/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-cgi.c @@ -165,7 +165,7 @@ generate_file_stats(void *arg) static const char httpd_cgi_filestat3[] HTTPD_STRING_ATTR = "%5u"; char tmp[20]; struct httpd_fsdata_file_noconst *f,fram; - u16_t i; + uint16_t i; unsigned short numprinted; /* Transfer arg from whichever flash that contains the html file to RAM */ diff --git a/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fs.c b/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fs.c index f33eec073..21b0d7cdc 100644 --- a/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fs.c +++ b/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fs.c @@ -40,7 +40,7 @@ #include "httpd-fsdata.c" #if HTTPD_FS_STATISTICS==2 -u16_t httpd_filecount[HTTPD_FS_NUMFILES]; +uint16_t httpd_filecount[HTTPD_FS_NUMFILES]; #endif /* HTTPD_FS_STATISTICS */ /*-----------------------------------------------------------------------------------*/ @@ -50,18 +50,18 @@ httpd_fs_get_root() return (void *)HTTPD_FS_ROOT; } /*-----------------------------------------------------------------------------------*/ -u16_t +uint16_t httpd_fs_get_size() { return HTTPD_FS_SIZE; } /*-----------------------------------------------------------------------------------*/ -u16_t +uint16_t httpd_fs_open(const char *name, struct httpd_fs_file *file) { #if HTTPD_FS_STATISTICS - u16_t i = 0; + uint16_t i = 0; #endif /* HTTPD_FS_STATISTICS */ struct httpd_fsdata_file_noconst *f,fram; @@ -103,7 +103,7 @@ void httpd_fs_init(void) { #if HTTPD_FS_STATISTICS && 0 //count will already be zero at boot - u16_t i; + uint16_t i; for(i = 0; i < HTTPD_FS_NUMFILES; i++) { count[i] = 0; } @@ -111,11 +111,11 @@ httpd_fs_init(void) } /*-----------------------------------------------------------------------------------*/ #if HTTPD_FS_STATISTICS && 0 //Not needed, httpd_fs_open returns count -u16_t +uint16_t httpd_fs_count(char *name) { struct httpd_fsdata_file_noconst *f,fram; - u16_t i; + uint16_t i; i = 0; for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT; diff --git a/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fs.h b/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fs.h index a40971b99..fc0893d55 100644 --- a/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fs.h +++ b/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fs.h @@ -41,7 +41,7 @@ #define HTTPD_FS_STATISTICS 2 //Puts count in RAM array #if HTTPD_FS_STATISTICS==2 -extern u16_t httpd_filecount[]; +extern uint16_t httpd_filecount[]; #endif /* HTTPD_FS_STATISTICS */ #include @@ -59,12 +59,12 @@ void httpd_fs_init(void); /* Returns root of http files in program flash */ void* httpd_fs_get_root(); /* Returns size of http files in any flash */ -u16_t httpd_fs_get_size(); +uint16_t httpd_fs_get_size(); /* Open a file in any flash and return statistics if enabled. If file is allocated by caller it will be filled in. If NULL, just file stats are returned. */ -u16_t httpd_fs_open(const char *name, struct httpd_fs_file *file); +uint16_t httpd_fs_open(const char *name, struct httpd_fs_file *file); #if COFFEE_FILES /* Coffee file system can be static or dynamic. If static, new files diff --git a/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fsdata.c b/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fsdata.c index 4480bb838..68d44b750 100644 --- a/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fsdata.c +++ b/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fsdata.c @@ -625,7 +625,7 @@ struct httpd_fsdata_file { const char *data; //offset to coffee file data const int len; //length of file data #if HTTPD_FS_STATISTICS == 1 //not enabled since list is in PROGMEM - u16_t count; //storage for file statistics + uint16_t count; //storage for file statistics #endif } */ diff --git a/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fsdata.h b/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fsdata.h index 9da15d820..f269ad75a 100644 --- a/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fsdata.h +++ b/platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fsdata.h @@ -43,7 +43,7 @@ struct httpd_fsdata_file { const char *data; const int len; #if HTTPD_FS_STATISTICS == 1 - u16_t count; + uint16_t count; #endif /* HTTPD_FS_STATISTICS */ }; @@ -53,7 +53,7 @@ struct httpd_fsdata_file_noconst { char *data; int len; #if HTTPD_FS_STATISTICS == 1 - u16_t count; + uint16_t count; #endif /* HTTPD_FS_STATISTICS */ }; diff --git a/platform/avr-atmega128rfa1/contiki-conf.h b/platform/avr-atmega128rfa1/contiki-conf.h index b5bb94ef3..5ca971204 100644 --- a/platform/avr-atmega128rfa1/contiki-conf.h +++ b/platform/avr-atmega128rfa1/contiki-conf.h @@ -49,10 +49,12 @@ #endif #include +/* These names are deprecated, use C99 names. */ typedef int32_t s32_t; typedef unsigned char u8_t; typedef unsigned short u16_t; typedef unsigned long u32_t; + typedef unsigned short clock_time_t; typedef unsigned short uip_stats_t; typedef unsigned long off_t; diff --git a/platform/avr-raven/apps/raven-ipso/raven-ipso.c b/platform/avr-raven/apps/raven-ipso/raven-ipso.c index 1ba134848..4e82eb959 100644 --- a/platform/avr-raven/apps/raven-ipso/raven-ipso.c +++ b/platform/avr-raven/apps/raven-ipso/raven-ipso.c @@ -69,18 +69,18 @@ #define cmd_len 8 #define data_len 20 -static u8_t seqno; +static uint8_t seqno; uip_ipaddr_t ping_addr; uip_ipaddr_t udp_addr; static struct uip_udp_conn *udp_conn; char udp_data[data_len]; static struct{ - u8_t frame[cmd_len]; - u8_t ndx; - u8_t len; - u8_t cmd; - u8_t done; + uint8_t frame[cmd_len]; + uint8_t ndx; + uint8_t len; + uint8_t cmd; + uint8_t done; } cmd; #define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) @@ -114,8 +114,8 @@ raven_ping6(void) memset((void *)UIP_ICMP_BUF + UIP_ICMPH_LEN, 0, 4); uip_len = UIP_ICMPH_LEN + UIP_ICMP6_ECHO_REQUEST_LEN + UIP_IPH_LEN; - UIP_IP_BUF->len[0] = (u8_t)((uip_len - 40) >> 8); - UIP_IP_BUF->len[1] = (u8_t)((uip_len - 40) & 0x00FF); + UIP_IP_BUF->len[0] = (uint8_t)((uip_len - 40) >> 8); + UIP_IP_BUF->len[1] = (uint8_t)((uip_len - 40) & 0x00FF); UIP_ICMP_BUF->icmpchksum = 0; UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum(); @@ -140,7 +140,7 @@ send_frame(uint8_t cmd, uint8_t len, uint8_t *payload) } /*------------------------------------------------------------------*/ -static u8_t +static uint8_t raven_gui_loop(process_event_t ev, process_data_t data) { if(ev == tcpip_icmp6_event) { @@ -235,7 +235,7 @@ int raven_lcd_serial_input(unsigned char ch) PROCESS(raven_lcd_process, "Raven LCD interface process"); PROCESS_THREAD(raven_lcd_process, ev, data) { - u8_t error; + uint8_t error; PROCESS_BEGIN(); diff --git a/platform/avr-raven/apps/raven-lcd-interface/raven-lcd.c b/platform/avr-raven/apps/raven-lcd-interface/raven-lcd.c index d2624760a..070e5db5f 100644 --- a/platform/avr-raven/apps/raven-lcd-interface/raven-lcd.c +++ b/platform/avr-raven/apps/raven-lcd-interface/raven-lcd.c @@ -79,17 +79,17 @@ #include #include -static u8_t count = 0; -static u8_t seqno; +static uint8_t count = 0; +static uint8_t seqno; uip_ipaddr_t dest_addr; #define MAX_CMD_LEN 20 static struct{ - u8_t frame[MAX_CMD_LEN]; - u8_t ndx; - u8_t len; - u8_t cmd; - u8_t done; + uint8_t frame[MAX_CMD_LEN]; + uint8_t ndx; + uint8_t len; + uint8_t cmd; + uint8_t done; } cmd; #define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) @@ -137,8 +137,8 @@ raven_ping6(void) 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[1] = (u8_t)((uip_len - 40) & 0x00FF); + UIP_IP_BUF->len[0] = (uint8_t)((uip_len - 40) >> 8); + UIP_IP_BUF->len[1] = (uint8_t)((uip_len - 40) & 0x00FF); UIP_ICMP_BUF->icmpchksum = 0; UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum(); @@ -253,12 +253,12 @@ ISR(TIMER2_COMPA_vect) #endif /* !AVR_CONF_USE32KCRYSTAL */ #if DEBUGSERIAL -u8_t serialcount; +uint8_t serialcount; char dbuf[30]; #endif /*---------------------------------------------------------------------------*/ -static u8_t +static uint8_t raven_gui_loop(process_event_t ev, process_data_t data) { uint8_t i,activeconnections,radio_state; diff --git a/platform/avr-raven/apps/raven-webserver/httpd-cgi.c b/platform/avr-raven/apps/raven-webserver/httpd-cgi.c index 3034775c8..f271c3738 100644 --- a/platform/avr-raven/apps/raven-webserver/httpd-cgi.c +++ b/platform/avr-raven/apps/raven-webserver/httpd-cgi.c @@ -166,7 +166,7 @@ generate_file_stats(void *arg) static const char httpd_cgi_filestat3[] HTTPD_STRING_ATTR = "%5u"; char tmp[20]; struct httpd_fsdata_file_noconst *f,fram; - u16_t i; + uint16_t i; unsigned short numprinted; /* Transfer arg from whichever flash that contains the html file to RAM */ diff --git a/platform/avr-raven/apps/raven-webserver/httpd-fs.c b/platform/avr-raven/apps/raven-webserver/httpd-fs.c index f33eec073..21b0d7cdc 100644 --- a/platform/avr-raven/apps/raven-webserver/httpd-fs.c +++ b/platform/avr-raven/apps/raven-webserver/httpd-fs.c @@ -40,7 +40,7 @@ #include "httpd-fsdata.c" #if HTTPD_FS_STATISTICS==2 -u16_t httpd_filecount[HTTPD_FS_NUMFILES]; +uint16_t httpd_filecount[HTTPD_FS_NUMFILES]; #endif /* HTTPD_FS_STATISTICS */ /*-----------------------------------------------------------------------------------*/ @@ -50,18 +50,18 @@ httpd_fs_get_root() return (void *)HTTPD_FS_ROOT; } /*-----------------------------------------------------------------------------------*/ -u16_t +uint16_t httpd_fs_get_size() { return HTTPD_FS_SIZE; } /*-----------------------------------------------------------------------------------*/ -u16_t +uint16_t httpd_fs_open(const char *name, struct httpd_fs_file *file) { #if HTTPD_FS_STATISTICS - u16_t i = 0; + uint16_t i = 0; #endif /* HTTPD_FS_STATISTICS */ struct httpd_fsdata_file_noconst *f,fram; @@ -103,7 +103,7 @@ void httpd_fs_init(void) { #if HTTPD_FS_STATISTICS && 0 //count will already be zero at boot - u16_t i; + uint16_t i; for(i = 0; i < HTTPD_FS_NUMFILES; i++) { count[i] = 0; } @@ -111,11 +111,11 @@ httpd_fs_init(void) } /*-----------------------------------------------------------------------------------*/ #if HTTPD_FS_STATISTICS && 0 //Not needed, httpd_fs_open returns count -u16_t +uint16_t httpd_fs_count(char *name) { struct httpd_fsdata_file_noconst *f,fram; - u16_t i; + uint16_t i; i = 0; for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT; diff --git a/platform/avr-raven/apps/raven-webserver/httpd-fs.h b/platform/avr-raven/apps/raven-webserver/httpd-fs.h index a40971b99..fc0893d55 100644 --- a/platform/avr-raven/apps/raven-webserver/httpd-fs.h +++ b/platform/avr-raven/apps/raven-webserver/httpd-fs.h @@ -41,7 +41,7 @@ #define HTTPD_FS_STATISTICS 2 //Puts count in RAM array #if HTTPD_FS_STATISTICS==2 -extern u16_t httpd_filecount[]; +extern uint16_t httpd_filecount[]; #endif /* HTTPD_FS_STATISTICS */ #include @@ -59,12 +59,12 @@ void httpd_fs_init(void); /* Returns root of http files in program flash */ void* httpd_fs_get_root(); /* Returns size of http files in any flash */ -u16_t httpd_fs_get_size(); +uint16_t httpd_fs_get_size(); /* Open a file in any flash and return statistics if enabled. If file is allocated by caller it will be filled in. If NULL, just file stats are returned. */ -u16_t httpd_fs_open(const char *name, struct httpd_fs_file *file); +uint16_t httpd_fs_open(const char *name, struct httpd_fs_file *file); #if COFFEE_FILES /* Coffee file system can be static or dynamic. If static, new files diff --git a/platform/avr-raven/apps/raven-webserver/httpd-fsdata.h b/platform/avr-raven/apps/raven-webserver/httpd-fsdata.h index 9da15d820..f269ad75a 100644 --- a/platform/avr-raven/apps/raven-webserver/httpd-fsdata.h +++ b/platform/avr-raven/apps/raven-webserver/httpd-fsdata.h @@ -43,7 +43,7 @@ struct httpd_fsdata_file { const char *data; const int len; #if HTTPD_FS_STATISTICS == 1 - u16_t count; + uint16_t count; #endif /* HTTPD_FS_STATISTICS */ }; @@ -53,7 +53,7 @@ struct httpd_fsdata_file_noconst { char *data; int len; #if HTTPD_FS_STATISTICS == 1 - u16_t count; + uint16_t count; #endif /* HTTPD_FS_STATISTICS */ }; diff --git a/platform/avr-raven/contiki-conf.h b/platform/avr-raven/contiki-conf.h index 4ddcbfe91..fe7616444 100644 --- a/platform/avr-raven/contiki-conf.h +++ b/platform/avr-raven/contiki-conf.h @@ -56,10 +56,12 @@ #include +/* These names are deprecated, use C99 names. */ typedef int32_t s32_t; typedef unsigned char u8_t; typedef unsigned short u16_t; typedef unsigned long u32_t; + typedef unsigned short clock_time_t; typedef unsigned short uip_stats_t; typedef unsigned long off_t; diff --git a/platform/avr-ravenusb/contiki-conf.h b/platform/avr-ravenusb/contiki-conf.h index 0e7911a24..e00c99d38 100644 --- a/platform/avr-ravenusb/contiki-conf.h +++ b/platform/avr-ravenusb/contiki-conf.h @@ -58,6 +58,7 @@ #include #include +/* These names are deprecated, use C99 names. */ typedef int32_t s32_t; typedef unsigned char u8_t; typedef unsigned short u16_t; diff --git a/platform/avr-rcb/contiki-conf.h b/platform/avr-rcb/contiki-conf.h index 849575b1a..c02fd0cc1 100644 --- a/platform/avr-rcb/contiki-conf.h +++ b/platform/avr-rcb/contiki-conf.h @@ -115,6 +115,8 @@ typedef int32_t s32_t; typedef unsigned short clock_time_t; + +/* These names are deprecated, use C99 names. */ typedef unsigned char u8_t; typedef unsigned short u16_t; typedef unsigned long u32_t; diff --git a/platform/avr-rcb/contiki-rcb-main.c b/platform/avr-rcb/contiki-rcb-main.c index 9c562bff8..24d3cd07e 100644 --- a/platform/avr-rcb/contiki-rcb-main.c +++ b/platform/avr-rcb/contiki-rcb-main.c @@ -107,7 +107,7 @@ init_lowlevel(void) static struct etimer et; PROCESS_THREAD(rcb_leds, ev, data) { - u8_t error; + uint8_t error; PROCESS_BEGIN(); diff --git a/platform/avr-zigbit/contiki-conf.h b/platform/avr-zigbit/contiki-conf.h index c9f67fe9f..53aa6bf23 100644 --- a/platform/avr-zigbit/contiki-conf.h +++ b/platform/avr-zigbit/contiki-conf.h @@ -145,11 +145,13 @@ #include -typedef int32_t s32_t; +/* These names are deprecated, use C99 names. */ typedef unsigned short clock_time_t; typedef unsigned char u8_t; typedef unsigned short u16_t; typedef unsigned long u32_t; +typedef int32_t s32_t; + typedef unsigned short uip_stats_t; typedef unsigned long off_t; diff --git a/platform/c128/contiki-main.c b/platform/c128/contiki-main.c index 84489c56e..7ce943dc8 100644 --- a/platform/c128/contiki-main.c +++ b/platform/c128/contiki-main.c @@ -93,7 +93,7 @@ main(void) #if (WITH_GUI && WITH_MOUSE) { - static const u8_t mouse_sprite[64] = { + static const uint8_t mouse_sprite[64] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xE0, 0x00, 0x0F, 0xC0, 0x00, 0x0F, 0x80, 0x00, 0x0F, 0xC0, 0x00, 0x0D, 0xE0, 0x00, @@ -104,7 +104,7 @@ main(void) 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; memcpy((void*)0x0E00, mouse_sprite, sizeof(mouse_sprite)); - *(u8_t*)0x07F8 = 0x0E00 / 64; + *(uint8_t*)0x07F8 = 0x0E00 / 64; VIC.spr0_color = COLOR_WHITE; } #endif /* WITH_GUI && WITH_MOUSE */ diff --git a/platform/c64/contiki-main.c b/platform/c64/contiki-main.c index db60af8a3..dee2a72cd 100644 --- a/platform/c64/contiki-main.c +++ b/platform/c64/contiki-main.c @@ -91,7 +91,7 @@ main(void) #if (WITH_GUI && WITH_MOUSE) { - static const u8_t mouse_sprite[64] = { + static const uint8_t mouse_sprite[64] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xE0, 0x00, 0x0F, 0xC0, 0x00, 0x0F, 0x80, 0x00, 0x0F, 0xC0, 0x00, 0x0D, 0xE0, 0x00, @@ -102,7 +102,7 @@ main(void) 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; memcpy((void*)0x0340, mouse_sprite, sizeof(mouse_sprite)); - *(u8_t*)0x07F8 = 0x0340 / 64; + *(uint8_t*)0x07F8 = 0x0340 / 64; VIC.spr0_color = COLOR_WHITE; } #endif /* WITH_GUI && WITH_MOUSE */ diff --git a/platform/cooja/contiki-conf.h b/platform/cooja/contiki-conf.h index ca289258c..cc6bd0896 100644 --- a/platform/cooja/contiki-conf.h +++ b/platform/cooja/contiki-conf.h @@ -105,11 +105,13 @@ #define CCIF #define CLIF +/* These names are deprecated, use C99 names. */ #include typedef uint8_t u8_t; typedef uint16_t u16_t; typedef uint32_t u32_t; typedef int32_t s32_t; + typedef unsigned short uip_stats_t; #define CLOCK_CONF_SECOND 1000L diff --git a/platform/cooja/contiki-cooja-main.c b/platform/cooja/contiki-cooja-main.c index a64482def..9cdec2b8b 100644 --- a/platform/cooja/contiki-cooja-main.c +++ b/platform/cooja/contiki-cooja-main.c @@ -100,7 +100,7 @@ static uint8_t is_gateway; #if WITH_UIP6 #include "net/uip.h" #include "net/uip-ds6.h" -#define PRINT6ADDR(addr) printf("%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15]) +#define PRINT6ADDR(addr) printf("%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15]) #endif /* WITH_UIP6 */ PROCINIT(&etimer_process,&sensors_process); diff --git a/platform/cooja/net/radio-uip-uaodv.c b/platform/cooja/net/radio-uip-uaodv.c index c4ca21491..1e4546fbd 100644 --- a/platform/cooja/net/radio-uip-uaodv.c +++ b/platform/cooja/net/radio-uip-uaodv.c @@ -66,12 +66,12 @@ enum { struct buf_packet { struct buf_packet *next; - u8_t data[UIP_BUFSIZE]; + uint8_t data[UIP_BUFSIZE]; int len; - u8_t resends; - u8_t acked; - u8_t want_ack; - u16_t crc; + uint8_t resends; + uint8_t acked; + uint8_t want_ack; + uint16_t crc; uip_ipaddr_t finaldest; struct etimer etimer; }; @@ -87,21 +87,21 @@ static const struct radio_driver *radio; /*---------------------------------------------------------------------------*/ static void receiver(const struct radio_driver *d); -u8_t radio_uip_uaodv_send(void); +uint8_t radio_uip_uaodv_send(void); void radio_uip_uaodv_init(const struct radio_driver *d); -int radio_uip_handle_ack(u8_t *buf, int len); -u16_t radio_uip_calc_crc(u8_t *buf, int len); -int radio_uip_buffer_outgoing_packet(u8_t *buf, int len, uip_ipaddr_t *dest, int max_sends); -int radio_uip_is_ack(u8_t *buf, int len); -int radio_uip_uaodv_add_header(u8_t *buf, int len, uip_ipaddr_t *addr); -int radio_uip_uaodv_remove_header(u8_t *buf, int len); -void radio_uip_uaodv_change_header(u8_t *buf, int len, uip_ipaddr_t *addr); -int radio_uip_uaodv_header_exists(u8_t *buf, int len); +int radio_uip_handle_ack(uint8_t *buf, int len); +uint16_t radio_uip_calc_crc(uint8_t *buf, int len); +int radio_uip_buffer_outgoing_packet(uint8_t *buf, int len, uip_ipaddr_t *dest, int max_sends); +int radio_uip_is_ack(uint8_t *buf, int len); +int radio_uip_uaodv_add_header(uint8_t *buf, int len, uip_ipaddr_t *addr); +int radio_uip_uaodv_remove_header(uint8_t *buf, int len); +void radio_uip_uaodv_change_header(uint8_t *buf, int len, uip_ipaddr_t *addr); +int radio_uip_uaodv_header_exists(uint8_t *buf, int len); int radio_uip_uaodv_is_broadcast(uip_ipaddr_t *addr); -int radio_uip_uaodv_fwd_is_broadcast(u8_t *buf, int len); -int radio_uip_uaodv_fwd_is_me(u8_t *buf, int len); -int radio_uip_uaodv_dest_is_me(u8_t *buf, int len); -int radio_uip_uaodv_dest_port(u8_t *buf, int len); +int radio_uip_uaodv_fwd_is_broadcast(uint8_t *buf, int len); +int radio_uip_uaodv_fwd_is_me(uint8_t *buf, int len); +int radio_uip_uaodv_dest_is_me(uint8_t *buf, int len); +int radio_uip_uaodv_dest_port(uint8_t *buf, int len); /*---------------------------------------------------------------------------*/ /* Main process - handles (re)transmissions and acks */ @@ -117,10 +117,10 @@ PROCESS_THREAD(radio_uip_process, ev, data) if(ev == EVENT_SEND_ACK) { /* Prepare and send ack for given 16-bit CRC */ - u8_t ackPacket[ACK_PACKET_LENGTH]; + uint8_t ackPacket[ACK_PACKET_LENGTH]; memcpy(ackPacket, ACK_ID, ACK_ID_LENGTH); - ackPacket[ACK_CRC] = ((u16_t) data >> 8); - ackPacket[ACK_CRC+1] = ((u16_t) data & 0xff); + ackPacket[ACK_CRC] = ((uint16_t) data >> 8); + ackPacket[ACK_CRC+1] = ((uint16_t) data & 0xff); radio->send(ackPacket, ACK_PACKET_LENGTH); } else if(ev == PROCESS_EVENT_TIMER) { @@ -187,9 +187,9 @@ receiver(const struct radio_driver *d) { /* Send ack as soon as possible */ - u16_t crc; + uint16_t crc; crc = radio_uip_calc_crc(&uip_buf[UIP_LLH_LEN], uip_len); - process_post(&radio_uip_process, EVENT_SEND_ACK, (void*) (u32_t) crc); + process_post(&radio_uip_process, EVENT_SEND_ACK, (void*) (uint32_t) crc); } /* Strip header and receive packet */ @@ -197,7 +197,7 @@ receiver(const struct radio_driver *d) tcpip_input(); } /*---------------------------------------------------------------------------*/ -u8_t +uint8_t radio_uip_uaodv_send(void) { struct uaodv_rt_entry *route; @@ -261,10 +261,10 @@ radio_uip_uaodv_init(const struct radio_driver *d) radio->on(); } /*---------------------------------------------------------------------------*/ -u16_t -radio_uip_calc_crc(u8_t *buf, int len) +uint16_t +radio_uip_calc_crc(uint8_t *buf, int len) { - u16_t crcacc = 0xffff; + uint16_t crcacc = 0xffff; int counter; /* TODO Not effective */ @@ -275,11 +275,11 @@ radio_uip_calc_crc(u8_t *buf, int len) } /*---------------------------------------------------------------------------*/ int -radio_uip_buffer_outgoing_packet(u8_t *buf, int len, uip_ipaddr_t *dest, int max_sends) +radio_uip_buffer_outgoing_packet(uint8_t *buf, int len, uip_ipaddr_t *dest, int max_sends) { struct buf_packet *packet; - u16_t crc; + uint16_t crc; /* Calculate packet's unique CRC */ crc = radio_uip_calc_crc(&uip_buf[UIP_LLH_LEN], uip_len); @@ -323,7 +323,7 @@ radio_uip_buffer_outgoing_packet(u8_t *buf, int len, uip_ipaddr_t *dest, int max } /*---------------------------------------------------------------------------*/ int -radio_uip_is_ack(u8_t *buf, int len) +radio_uip_is_ack(uint8_t *buf, int len) { if (len != ACK_PACKET_LENGTH) return 0; @@ -333,12 +333,12 @@ radio_uip_is_ack(u8_t *buf, int len) } /*---------------------------------------------------------------------------*/ int -radio_uip_handle_ack(u8_t *buf, int len) +radio_uip_handle_ack(uint8_t *buf, int len) { struct buf_packet *packet; - u16_t ackCRC; + uint16_t ackCRC; - ackCRC = (u16_t) (buf[ACK_CRC] << 8) + (u16_t) (0xff&buf[ACK_CRC+1]); + ackCRC = (uint16_t) (buf[ACK_CRC] << 8) + (uint16_t) (0xff&buf[ACK_CRC+1]); /* Locate which packet was acknowledged */ for(packet = list_head(buf_packet_list); @@ -355,9 +355,9 @@ radio_uip_handle_ack(u8_t *buf, int len) } /*---------------------------------------------------------------------------*/ int -radio_uip_uaodv_add_header(u8_t *buf, int len, uip_ipaddr_t *addr) +radio_uip_uaodv_add_header(uint8_t *buf, int len, uip_ipaddr_t *addr) { - u8_t tempbuf[len]; + uint8_t tempbuf[len]; memcpy(tempbuf, buf, len); memcpy(&buf[FWD_PACKET_LENGTH], tempbuf, len); memcpy(buf, FWD_ID, FWD_ID_LENGTH); @@ -366,22 +366,22 @@ radio_uip_uaodv_add_header(u8_t *buf, int len, uip_ipaddr_t *addr) } /*---------------------------------------------------------------------------*/ int -radio_uip_uaodv_remove_header(u8_t *buf, int len) +radio_uip_uaodv_remove_header(uint8_t *buf, int len) { - u8_t tempbuf[len]; + uint8_t tempbuf[len]; memcpy(tempbuf, &buf[FWD_PACKET_LENGTH], len); memcpy(buf, tempbuf, len); return len - FWD_PACKET_LENGTH; } /*---------------------------------------------------------------------------*/ void -radio_uip_uaodv_change_header(u8_t *buf, int len, uip_ipaddr_t *addr) +radio_uip_uaodv_change_header(uint8_t *buf, int len, uip_ipaddr_t *addr) { memcpy(&buf[FWD_NEXT_IP], addr, 4); } /*---------------------------------------------------------------------------*/ int -radio_uip_uaodv_header_exists(u8_t *buf, int len) +radio_uip_uaodv_header_exists(uint8_t *buf, int len) { return !memcmp(buf, FWD_ID, FWD_ID_LENGTH); } @@ -393,25 +393,25 @@ radio_uip_uaodv_is_broadcast(uip_ipaddr_t *addr) } /*---------------------------------------------------------------------------*/ int -radio_uip_uaodv_fwd_is_broadcast(u8_t *buf, int len) +radio_uip_uaodv_fwd_is_broadcast(uint8_t *buf, int len) { return radio_uip_uaodv_is_broadcast((uip_ipaddr_t*) &buf[FWD_NEXT_IP]); } /*---------------------------------------------------------------------------*/ int -radio_uip_uaodv_fwd_is_me(u8_t *buf, int len) +radio_uip_uaodv_fwd_is_me(uint8_t *buf, int len) { return !memcmp(&buf[FWD_NEXT_IP], &uip_hostaddr, 4); } /*---------------------------------------------------------------------------*/ int -radio_uip_uaodv_dest_is_me(u8_t *buf, int len) +radio_uip_uaodv_dest_is_me(uint8_t *buf, int len) { return !memcmp((&((struct uip_udpip_hdr *)buf)->destipaddr), &uip_hostaddr, 4); } /*---------------------------------------------------------------------------*/ int -radio_uip_uaodv_dest_port(u8_t *buf, int len) +radio_uip_uaodv_dest_port(uint8_t *buf, int len) { if (len < sizeof(struct uip_udpip_hdr)) return -1; diff --git a/platform/cooja/net/radio-uip-uaodv.h b/platform/cooja/net/radio-uip-uaodv.h index 53faa8645..3aa3ace1c 100644 --- a/platform/cooja/net/radio-uip-uaodv.h +++ b/platform/cooja/net/radio-uip-uaodv.h @@ -40,7 +40,7 @@ void radio_uip_uaodv_init(const struct radio_driver *d); -u8_t +uint8_t radio_uip_uaodv_send(void); #endif /* __RADIO_UIP_UAODV_H__ */ diff --git a/platform/cooja/testapps/testcfs.c b/platform/cooja/testapps/testcfs.c index c2a51b807..d0248a58c 100644 --- a/platform/cooja/testapps/testcfs.c +++ b/platform/cooja/testapps/testcfs.c @@ -43,7 +43,7 @@ PROCESS_THREAD(test_cfs_process, ev, data) { static struct etimer et; static int fd; - static u16_t counter; + static uint16_t counter; static char buf[30]; PROCESS_BEGIN(); diff --git a/platform/cooja/testapps/testctimer.c b/platform/cooja/testapps/testctimer.c index ed98e8209..2929775cf 100644 --- a/platform/cooja/testapps/testctimer.c +++ b/platform/cooja/testapps/testctimer.c @@ -38,7 +38,7 @@ PROCESS(test_ctimer_process, "Callback timer test process"); AUTOSTART_PROCESSES(&test_ctimer_process); /*---------------------------------------------------------------------------*/ static struct ctimer ct; -static u16_t counter = 0; +static uint16_t counter = 0; /*---------------------------------------------------------------------------*/ static void callback(void *ptr) diff --git a/platform/cooja/testapps/testetimer.c b/platform/cooja/testapps/testetimer.c index 1672649ff..a1e28a553 100644 --- a/platform/cooja/testapps/testetimer.c +++ b/platform/cooja/testapps/testetimer.c @@ -40,7 +40,7 @@ AUTOSTART_PROCESSES(&test_etimer_process); PROCESS_THREAD(test_etimer_process, ev, data) { static struct etimer et; - static u16_t counter = 0; + static uint16_t counter = 0; PROCESS_BEGIN(); diff --git a/platform/esb/apps/pinger.c b/platform/esb/apps/pinger.c index f2402d4f6..1dd920585 100644 --- a/platform/esb/apps/pinger.c +++ b/platform/esb/apps/pinger.c @@ -40,10 +40,10 @@ PROCESS(pinger, "Pinger"); static struct uip_udp_conn *conn; struct data { - u8_t dummy_data[20]; - u16_t id; - u16_t seqno; - u8_t pingpong; + uint8_t dummy_data[20]; + uint16_t id; + uint16_t seqno; + uint8_t pingpong; #define PING 0 #define PONG 1 }; diff --git a/platform/esb/apps/radio-sniffer.c b/platform/esb/apps/radio-sniffer.c index 510709a0d..41d7c85ec 100644 --- a/platform/esb/apps/radio-sniffer.c +++ b/platform/esb/apps/radio-sniffer.c @@ -53,7 +53,7 @@ static void sniffer_callback(const struct radio_driver *driver) { static char buf[40]; - static u8_t packet[UIP_BUFSIZE]; + static uint8_t packet[UIP_BUFSIZE]; static int len; len = driver->read(packet, sizeof(packet)); if(len > 0) { diff --git a/platform/esb/dev/ds1629.c b/platform/esb/dev/ds1629.c index 3950d7678..ce922ecc4 100644 --- a/platform/esb/dev/ds1629.c +++ b/platform/esb/dev/ds1629.c @@ -106,10 +106,10 @@ cl_stop() } /*--------------------------------------------------------------------------*/ /* Writes a byte on the bus, returns the acknowledge bit. */ -static u16_t -cl_writeOnBus(u8_t byte) +static uint16_t +cl_writeOnBus(uint8_t byte) { - u16_t i, ack; + uint16_t i, ack; for(i=0;i<8;i++) { if(byte & 0x80) SDA_HIGH; else SDA_LOW; SCL_HIGH; @@ -126,11 +126,11 @@ cl_writeOnBus(u8_t byte) return ack; } /*--------------------------------------------------------------------------*/ -static u8_t -cl_readFromBus(u16_t ack) +static uint8_t +cl_readFromBus(uint16_t ack) { - u16_t i; - u8_t byte = 0; + uint16_t i; + uint8_t byte = 0; P5DIR &= 0xFE; /* P50(SDA) input */ for(i=0;i<8;i++) { byte = byte << 1; @@ -145,10 +145,10 @@ cl_readFromBus(u16_t ack) return byte; } /*--------------------------------------------------------------------------*/ -static u16_t -getReg16bit(u8_t acc, u16_t bitmask) +static uint16_t +getReg16bit(uint8_t acc, uint16_t bitmask) { - u16_t config = 0; + uint16_t config = 0; do cl_start(); while(!cl_writeOnBus(BUS_WRITE)); cl_writeOnBus(acc); @@ -166,7 +166,7 @@ getReg16bit(u8_t acc, u16_t bitmask) /*--------------------------------------------------------------------------*/ /* Only first 8 bit of Configuration Status Register can be set */ static void -setCSReg(u8_t setting) +setCSReg(uint8_t setting) { do cl_start(); while(!cl_writeOnBus(BUS_WRITE)); @@ -192,7 +192,7 @@ System_startConversion(void) static void initClock(void) { - u8_t csr = getReg16bit(ACC_CSR,0xFF00) >> 8; + uint8_t csr = getReg16bit(ACC_CSR,0xFF00) >> 8; if(csr!=CSR_DEFAULT) setCSReg(CSR_DEFAULT); /* if desired config isnt in clock => set it */ /* IMPORTANT: Ensure quartz is generating 32768 Hz */ /* (sometimes CH bit gets set when clock is read while reset) */ diff --git a/platform/esb/dev/ir.c b/platform/esb/dev/ir.c index 11bede1fa..5a5bdefb1 100644 --- a/platform/esb/dev/ir.c +++ b/platform/esb/dev/ir.c @@ -175,13 +175,13 @@ unsigned char recir_getAddress(void){ return ((recvdata & 0x07C0) >> 6); } unsigned char recir_getToggle(void){ return ((recvdata & 0x0800) >> 11); } unsigned char recir_getError(void){ return ((recvdata & 0x2000) >> 13); } -u16_t +uint16_t ir_data(void) { return recvdata; } -u8_t +uint8_t ir_poll(void) { if(recvdata & 0x1000) { diff --git a/platform/esb/dev/ir.h b/platform/esb/dev/ir.h index 1aef513f9..12c56be96 100644 --- a/platform/esb/dev/ir.h +++ b/platform/esb/dev/ir.h @@ -47,11 +47,11 @@ void ir_init(void); void ir_send(unsigned short low12bits); -u8_t ir_poll(void); +uint8_t ir_poll(void); #define IR_NODATA 0 #define IR_DATA 1 -u16_t ir_data(void); +uint16_t ir_data(void); void ir_irq(void); diff --git a/platform/mb851/contiki-conf.h b/platform/mb851/contiki-conf.h index a39d0d04a..333b3e729 100644 --- a/platform/mb851/contiki-conf.h +++ b/platform/mb851/contiki-conf.h @@ -58,10 +58,12 @@ #define CCIF #define CLIF +/* These names are deprecated, use C99 names. */ typedef uint8_t u8_t; typedef uint16_t u16_t; typedef uint32_t u32_t; typedef int32_t s32_t; + typedef unsigned short uip_stats_t; diff --git a/platform/mb851/contiki-init-net.c b/platform/mb851/contiki-init-net.c index 4d81f9c58..500ad6f09 100644 --- a/platform/mb851/contiki-init-net.c +++ b/platform/mb851/contiki-init-net.c @@ -48,7 +48,7 @@ #if DEBUG #include #define PRINTF(...) printf(__VA_ARGS__) -#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15]) +#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15]) #define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x ",lladdr.u8[0], lladdr.u8[1], lladdr.u8[2], lladdr.u8[3],lladdr.u8[4], lladdr.u8[5], lladdr.u8[6], lladdr.u8[7]) #else #define PRINTF(...) diff --git a/platform/mb851/contiki-main.c b/platform/mb851/contiki-main.c index 916e3952c..7189caec6 100644 --- a/platform/mb851/contiki-main.c +++ b/platform/mb851/contiki-main.c @@ -72,7 +72,7 @@ #if DEBUG #include #define PRINTF(...) printf(__VA_ARGS__) -#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15]) +#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15]) #define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x ",lladdr.u8[0], lladdr.u8[1], lladdr.u8[2], lladdr.u8[3],lladdr.u8[4], lladdr.u8[5], lladdr.u8[6], lladdr.u8[7]) #else #define PRINTF(...) @@ -96,7 +96,7 @@ set_rime_addr(void) { int i; union { - u8_t u8[8]; + uint8_t u8[8]; }eui64; //rimeaddr_t lladdr; diff --git a/platform/mbxxx/contiki-conf.h b/platform/mbxxx/contiki-conf.h index 03155b492..4dfba9020 100644 --- a/platform/mbxxx/contiki-conf.h +++ b/platform/mbxxx/contiki-conf.h @@ -57,12 +57,13 @@ #define CCIF #define CLIF +/* These names are deprecated, use C99 names. */ typedef uint8_t u8_t; typedef uint16_t u16_t; typedef uint32_t u32_t; typedef int32_t s32_t; -typedef unsigned short uip_stats_t; +typedef unsigned short uip_stats_t; //#define FIXED_NET_ADDRESS 1 //#define NET_ADDR_A 0x2001 diff --git a/platform/mbxxx/contiki-main.c b/platform/mbxxx/contiki-main.c index 33bb39748..6c9c88ba1 100644 --- a/platform/mbxxx/contiki-main.c +++ b/platform/mbxxx/contiki-main.c @@ -71,7 +71,7 @@ #if DEBUG #include #define PRINTF(...) printf(__VA_ARGS__) -#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15]) +#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15]) #define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x ",lladdr.u8[0], lladdr.u8[1], lladdr.u8[2], lladdr.u8[3],lladdr.u8[4], lladdr.u8[5], lladdr.u8[6], lladdr.u8[7]) #else #define PRINTF(...) @@ -95,7 +95,7 @@ set_rime_addr(void) { int i; union { - u8_t u8[8]; + uint8_t u8[8]; }eui64; //rimeaddr_t lladdr; diff --git a/platform/minimal-net/contiki-conf.h b/platform/minimal-net/contiki-conf.h index 2483e8b5a..8ae127a4b 100644 --- a/platform/minimal-net/contiki-conf.h +++ b/platform/minimal-net/contiki-conf.h @@ -45,12 +45,15 @@ #define CCIF #define CLIF +/* These names are deprecated, use C99 names. */ typedef uint8_t u8_t; typedef uint16_t u16_t; typedef uint32_t u32_t; typedef int32_t s32_t; + typedef unsigned short uip_stats_t; + #if UIP_CONF_IPV6 /* The Windows build uses wpcap to connect to a host interface. It finds the interface by scanning for * an address, which can be specified here and overridden with the command line. diff --git a/platform/native/contiki-conf.h b/platform/native/contiki-conf.h index a388ab8d5..036b05e66 100644 --- a/platform/native/contiki-conf.h +++ b/platform/native/contiki-conf.h @@ -55,10 +55,12 @@ int select_set_callback(int fd, const struct select_callback *callback); #define CCIF #define CLIF +/* These names are deprecated, use C99 names. */ typedef uint8_t u8_t; typedef uint16_t u16_t; typedef uint32_t u32_t; typedef int32_t s32_t; + typedef unsigned short uip_stats_t; #define UIP_CONF_UDP 1 diff --git a/platform/pc-6001/apps/webserver-mini/httpd-fs.c b/platform/pc-6001/apps/webserver-mini/httpd-fs.c index a1c5e1cad..8b05717ed 100644 --- a/platform/pc-6001/apps/webserver-mini/httpd-fs.c +++ b/platform/pc-6001/apps/webserver-mini/httpd-fs.c @@ -42,14 +42,14 @@ #include "ctk/libconio_arch-small.h" #if HTTPD_FS_STATISTICS -static u16_t count[HTTPD_FS_NUMFILES]; +static uint16_t count[HTTPD_FS_NUMFILES]; #endif /* HTTPD_FS_STATISTICS */ /*-----------------------------------------------------------------------------------*/ -static u8_t +static uint8_t httpd_fs_strcmp(const char *str1, const char *str2) { - u8_t i; + uint8_t i; i = 0; loop: @@ -71,7 +71,7 @@ int httpd_fs_open(const char *name, struct httpd_fs_file *file) { #if HTTPD_FS_STATISTICS - u16_t i = 0; + uint16_t i = 0; #endif /* HTTPD_FS_STATISTICS */ char* ch; struct httpd_fsdata_file_noconst *f; @@ -101,7 +101,7 @@ void httpd_fs_init(void) { #if HTTPD_FS_STATISTICS - u16_t i; + uint16_t i; for(i = 0; i < HTTPD_FS_NUMFILES; i++) { count[i] = 0; } @@ -109,11 +109,11 @@ httpd_fs_init(void) } /*-----------------------------------------------------------------------------------*/ #if HTTPD_FS_STATISTICS -u16_t +uint16_t httpd_fs_count(char *name) { struct httpd_fsdata_file_noconst *f; - u16_t i; + uint16_t i; i = 0; for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT; diff --git a/platform/pc-6001/apps/webserver-mini/httpd-fs.h b/platform/pc-6001/apps/webserver-mini/httpd-fs.h index 8252c2482..7ec27c032 100644 --- a/platform/pc-6001/apps/webserver-mini/httpd-fs.h +++ b/platform/pc-6001/apps/webserver-mini/httpd-fs.h @@ -50,7 +50,7 @@ int httpd_fs_open(const char *name, struct httpd_fs_file *file); #ifdef HTTPD_FS_STATISTICS #if HTTPD_FS_STATISTICS == 1 -u16_t httpd_fs_count(char *name); +uint16_t httpd_fs_count(char *name); #endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */ diff --git a/platform/pc-6001/apps/webserver-mini/httpd-fsdata.h b/platform/pc-6001/apps/webserver-mini/httpd-fsdata.h index 02e418459..e4cc902c9 100644 --- a/platform/pc-6001/apps/webserver-mini/httpd-fsdata.h +++ b/platform/pc-6001/apps/webserver-mini/httpd-fsdata.h @@ -44,7 +44,7 @@ struct httpd_fsdata_file { const int len; #ifdef HTTPD_FS_STATISTICS #if HTTPD_FS_STATISTICS == 1 - u16_t count; + uint16_t count; #endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */ }; @@ -56,7 +56,7 @@ struct httpd_fsdata_file_noconst { int len; #ifdef HTTPD_FS_STATISTICS #if HTTPD_FS_STATISTICS == 1 - u16_t count; + uint16_t count; #endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */ }; diff --git a/platform/pc-6001/contiki-serial-main.c b/platform/pc-6001/contiki-serial-main.c index a3e05df16..bfd5cedbd 100644 --- a/platform/pc-6001/contiki-serial-main.c +++ b/platform/pc-6001/contiki-serial-main.c @@ -46,7 +46,7 @@ #undef RS232_INTR #ifdef RS232_INTR -void rs232_arch_writeb(u8_t ch); +void rs232_arch_writeb(uint8_t ch); void rs232_arch_init(int (* callback)(unsigned char), unsigned long ubr); #else #include "dev/rs232.h" diff --git a/platform/pc-6001/ctk/ctk-conio_arch.c b/platform/pc-6001/ctk/ctk-conio_arch.c index b02941444..4db83b76e 100644 --- a/platform/pc-6001/ctk/ctk-conio_arch.c +++ b/platform/pc-6001/ctk/ctk-conio_arch.c @@ -49,57 +49,57 @@ /* * Offset constants for assembler */ -const u8_t off_widget_x = offsetof(struct ctk_widget, x); -const u8_t off_widget_y = offsetof(struct ctk_widget, y); -const u8_t off_widget_w = offsetof(struct ctk_widget, w); -const u8_t off_widget_h = offsetof(struct ctk_widget, h); -const u8_t off_widget_type = offsetof(struct ctk_widget, type); -const u8_t off_widget_window = offsetof(struct ctk_widget, window); +const uint8_t off_widget_x = offsetof(struct ctk_widget, x); +const uint8_t off_widget_y = offsetof(struct ctk_widget, y); +const uint8_t off_widget_w = offsetof(struct ctk_widget, w); +const uint8_t off_widget_h = offsetof(struct ctk_widget, h); +const uint8_t off_widget_type = offsetof(struct ctk_widget, type); +const uint8_t off_widget_window = offsetof(struct ctk_widget, window); -const u8_t off_widget_label_text = offsetof(struct ctk_widget, widget) + +const uint8_t off_widget_label_text = offsetof(struct ctk_widget, widget) + offsetof(struct ctk_widget_label, text); -const u8_t off_widget_button_text = offsetof(struct ctk_widget, widget) + +const uint8_t off_widget_button_text = offsetof(struct ctk_widget, widget) + offsetof(struct ctk_widget_button, text); -const u8_t off_widget_textentry_text = offsetof(struct ctk_widget, widget) + +const uint8_t off_widget_textentry_text = offsetof(struct ctk_widget, widget) + offsetof(struct ctk_widget_textentry, text); -const u8_t off_widget_textentry_xpos = offsetof(struct ctk_widget, widget) + +const uint8_t off_widget_textentry_xpos = offsetof(struct ctk_widget, widget) + offsetof(struct ctk_widget_textentry, xpos); -const u8_t off_widget_textentry_ypos = offsetof(struct ctk_widget, widget) + +const uint8_t off_widget_textentry_ypos = offsetof(struct ctk_widget, widget) + offsetof(struct ctk_widget_textentry, ypos); -const u8_t off_widget_textentry_state = offsetof(struct ctk_widget, widget) + +const uint8_t off_widget_textentry_state = offsetof(struct ctk_widget, widget) + offsetof(struct ctk_widget_textentry, state); #if CTK_CONF_HYPERLINK -const u8_t off_widget_hyperlink_text = offsetof(struct ctk_widget, widget) + +const uint8_t off_widget_hyperlink_text = offsetof(struct ctk_widget, widget) + offsetof(struct ctk_widget_hyperlink, text); #endif /* CTK_CONF_HYPERLINK */ #if CTK_CONF_ICONS -const u8_t off_widget_icon_title = offsetof(struct ctk_widget, widget) + +const uint8_t off_widget_icon_title = offsetof(struct ctk_widget, widget) + offsetof(struct ctk_widget_icon, title); -const u8_t off_widget_icon_textmap = offsetof(struct ctk_widget, widget) + +const uint8_t off_widget_icon_textmap = offsetof(struct ctk_widget, widget) + offsetof(struct ctk_widget_icon, textmap); #endif /* CTK_CONF_ICONS */ -const u8_t off_window_x = offsetof(struct ctk_window, x); -const u8_t off_window_y = offsetof(struct ctk_window, y); -const u8_t off_window_h = offsetof(struct ctk_window, h); -const u8_t off_window_w = offsetof(struct ctk_window, w); -const u8_t off_window_inactive = offsetof(struct ctk_window, inactive); -const u8_t off_window_active = offsetof(struct ctk_window, active); -const u8_t off_window_next = offsetof(struct ctk_window, next); -const u8_t off_window_focused = offsetof(struct ctk_window, focused); +const uint8_t off_window_x = offsetof(struct ctk_window, x); +const uint8_t off_window_y = offsetof(struct ctk_window, y); +const uint8_t off_window_h = offsetof(struct ctk_window, h); +const uint8_t off_window_w = offsetof(struct ctk_window, w); +const uint8_t off_window_inactive = offsetof(struct ctk_window, inactive); +const uint8_t off_window_active = offsetof(struct ctk_window, active); +const uint8_t off_window_next = offsetof(struct ctk_window, next); +const uint8_t off_window_focused = offsetof(struct ctk_window, focused); #if CTK_CONF_MENUS -const u8_t off_menu_title = offsetof(struct ctk_menu, title); -const u8_t off_menu_active = offsetof(struct ctk_menu, active); -const u8_t off_menu_nitems = offsetof(struct ctk_menu, nitems); -const u8_t off_menu_items = offsetof(struct ctk_menu, items); -const u8_t off_menu_next = offsetof(struct ctk_menu, next); -const u8_t off_menuitem_title = offsetof(struct ctk_menuitem, title); -const u8_t size_menuitem = sizeof(struct ctk_menuitem); -const u8_t off_menus_open = offsetof(struct ctk_menus, open); -const u8_t off_menus_menus = offsetof(struct ctk_menus, menus); -const u8_t off_menus_desktopmenu = offsetof(struct ctk_menus, desktopmenu); +const uint8_t off_menu_title = offsetof(struct ctk_menu, title); +const uint8_t off_menu_active = offsetof(struct ctk_menu, active); +const uint8_t off_menu_nitems = offsetof(struct ctk_menu, nitems); +const uint8_t off_menu_items = offsetof(struct ctk_menu, items); +const uint8_t off_menu_next = offsetof(struct ctk_menu, next); +const uint8_t off_menuitem_title = offsetof(struct ctk_menuitem, title); +const uint8_t size_menuitem = sizeof(struct ctk_menuitem); +const uint8_t off_menus_open = offsetof(struct ctk_menus, open); +const uint8_t off_menus_menus = offsetof(struct ctk_menus, menus); +const uint8_t off_menus_desktopmenu = offsetof(struct ctk_menus, desktopmenu); #endif /*---------------------------------------------------------------------------*/ diff --git a/platform/pc-6001/dev/rs232-asm.S b/platform/pc-6001/dev/rs232-asm.S index ff91e01e2..1cdfd0183 100644 --- a/platform/pc-6001/dev/rs232-asm.S +++ b/platform/pc-6001/dev/rs232-asm.S @@ -65,7 +65,7 @@ _rs232_arch_putc_next2: .endif ;; --------------------------------- - ;; void rs232_writeb(u8_t c) + ;; void rs232_writeb(uint8_t c) ;; Stack; retl reth c ;; AF__D_HL____ ;; return void diff --git a/platform/redbee-dev/contiki-mc1322x-main.c b/platform/redbee-dev/contiki-mc1322x-main.c index 021ca6c22..b62d7f084 100644 --- a/platform/redbee-dev/contiki-mc1322x-main.c +++ b/platform/redbee-dev/contiki-mc1322x-main.c @@ -70,7 +70,7 @@ #if DEBUG #include #define PRINTF(...) printf(__VA_ARGS__) -#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15]) +#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15]) #define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5]) #else #define PRINTF(...) diff --git a/platform/redbee-econotag/contiki-mc1322x-main.c b/platform/redbee-econotag/contiki-mc1322x-main.c index 75fdd3d87..82f9f48b4 100644 --- a/platform/redbee-econotag/contiki-mc1322x-main.c +++ b/platform/redbee-econotag/contiki-mc1322x-main.c @@ -89,7 +89,7 @@ void rtimercycle(void) {rtimerflag=1;} #if DEBUG #include #define PRINTF(...) printf(__VA_ARGS__) -#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15]) +#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15]) #define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5]) #else #define PRINTF(...) diff --git a/platform/stepper-robot/contiki-conf.h b/platform/stepper-robot/contiki-conf.h index 50115db28..c457801af 100644 --- a/platform/stepper-robot/contiki-conf.h +++ b/platform/stepper-robot/contiki-conf.h @@ -13,6 +13,8 @@ #define WITH_ASCII 1 #define CLOCK_CONF_SECOND 100 + +/* These names are deprecated, use C99 names. */ typedef uint8_t u8_t; typedef uint16_t u16_t; typedef uint32_t u32_t; diff --git a/platform/stk500/contiki-conf.h b/platform/stk500/contiki-conf.h index ca0b85295..c0b26336b 100644 --- a/platform/stk500/contiki-conf.h +++ b/platform/stk500/contiki-conf.h @@ -65,6 +65,7 @@ unsigned long clock_seconds(void); typedef unsigned short uip_stats_t; +/* These names are deprecated, use C99 names. */ typedef uint8_t u8_t; typedef int8_t s8_t; typedef uint16_t u16_t; diff --git a/platform/stm32test/contiki-conf.h b/platform/stm32test/contiki-conf.h index b68fbd551..ee1ad8677 100644 --- a/platform/stm32test/contiki-conf.h +++ b/platform/stm32test/contiki-conf.h @@ -10,6 +10,8 @@ #define WITH_ASCII 1 #define CLOCK_CONF_SECOND 100 + +/* These names are deprecated, use C99 names. */ typedef uint8_t u8_t; typedef uint16_t u16_t; typedef uint32_t u32_t; diff --git a/platform/z1/dev/adxl345.c b/platform/z1/dev/adxl345.c index 3cd86f6e3..c19ad0031 100644 --- a/platform/z1/dev/adxl345.c +++ b/platform/z1/dev/adxl345.c @@ -46,8 +46,8 @@ #include "i2cmaster.h" /* Callback pointers when interrupt occurs */ -void (*accm_int1_cb)(u8_t reg); -void (*accm_int2_cb)(u8_t reg); +void (*accm_int1_cb)(uint8_t reg); +void (*accm_int2_cb)(uint8_t reg); process_event_t int1_event, int2_event; @@ -119,8 +119,8 @@ PROCESS(accmeter_process, "Accelerometer process"); */ void -accm_write_reg(u8_t reg, u8_t val) { - u8_t tx_buf[] = {reg, val}; +accm_write_reg(uint8_t reg, uint8_t val) { + uint8_t tx_buf[] = {reg, val}; i2c_transmitinit(ADXL345_ADDR); while (i2c_busy()); @@ -140,7 +140,7 @@ accm_write_reg(u8_t reg, u8_t val) { The data is then written from second byte and increasing. */ void -accm_write_stream(u8_t len, u8_t *data) { +accm_write_stream(uint8_t len, uint8_t *data) { i2c_transmitinit(ADXL345_ADDR); while (i2c_busy()); PRINTFDEBUG("I2C Ready to TX(stream)\n"); @@ -157,10 +157,10 @@ accm_write_stream(u8_t len, u8_t *data) { returns the value of the read register */ -u8_t -accm_read_reg(u8_t reg) { - u8_t retVal = 0; - u8_t rtx = reg; +uint8_t +accm_read_reg(uint8_t reg) { + uint8_t retVal = 0; + uint8_t rtx = reg; PRINTFDEBUG("READ_REG 0x%02X\n", reg); /* transmit the register to read */ @@ -187,8 +187,8 @@ accm_read_reg(u8_t reg) { */ void -accm_read_stream(u8_t reg, u8_t len, u8_t *whereto) { - u8_t rtx = reg; +accm_read_stream(uint8_t reg, uint8_t len, uint8_t *whereto) { + uint8_t rtx = reg; PRINTFDEBUG("READ_STR %u B from 0x%02X\n", len, reg); /* transmit the register to start reading from */ @@ -213,7 +213,7 @@ accm_read_stream(u8_t reg, u8_t len, u8_t *whereto) { int16_t accm_read_axis(enum ADXL345_AXIS axis){ int16_t rd = 0; - u8_t tmp[2]; + uint8_t tmp[2]; if(axis > Z_AXIS){ return 0; } @@ -234,13 +234,13 @@ accm_read_axis(enum ADXL345_AXIS axis){ */ void -accm_set_grange(u8_t grange){ +accm_set_grange(uint8_t grange){ if(grange > ADXL345_RANGE_16G) { // invalid g-range. PRINTFDEBUG("ADXL grange invalid: %u\n", grange); return; } - u8_t tempreg = 0; + uint8_t tempreg = 0; /* preserve the previous contents of the register */ tempreg = (accm_read_reg(ADXL345_DATA_FORMAT) & 0xFC); // zero out the last two bits (grange) diff --git a/platform/z1/dev/adxl345.h b/platform/z1/dev/adxl345.h index 8da72cf5c..c0cc6e7f6 100644 --- a/platform/z1/dev/adxl345.h +++ b/platform/z1/dev/adxl345.h @@ -79,7 +79,7 @@ void accm_init(void); reg register to write to val value to write */ -void accm_write_reg(u8_t reg, u8_t val); +void accm_write_reg(uint8_t reg, uint8_t val); /* Write several registers from a stream. args: @@ -88,14 +88,14 @@ void accm_write_reg(u8_t reg, u8_t val); First byte in stream must be the register address to begin writing to. The data is then written from the second byte and increasing. The address byte is not included in length len. */ -void accm_write_stream(u8_t len, u8_t *data); +void accm_write_stream(uint8_t len, uint8_t *data); /* Read one register. args: reg what register to read returns the value of the read register */ -u8_t accm_read_reg(u8_t reg); +uint8_t accm_read_reg(uint8_t reg); /* Read several registers in a stream. args: @@ -103,7 +103,7 @@ u8_t accm_read_reg(u8_t reg); len number of bytes to read whereto pointer to where the data is saved */ -void accm_read_stream(u8_t reg, u8_t len, u8_t *whereto); +void accm_read_stream(uint8_t reg, uint8_t len, uint8_t *whereto); /* Read an axis of the accelerometer (x, y or z). Return value is a signed 10 bit int. The resolution of the acceleration measurement can be increased up to 13 bit, but @@ -120,14 +120,14 @@ int16_t accm_read_axis(enum ADXL345_AXIS axis); Example: accm_set_grange(ADXL345_RANGE_4G); */ -void accm_set_grange(u8_t grange); +void accm_set_grange(uint8_t grange); /* Map interrupt (FF, tap, dbltap etc) to interrupt pin (IRQ_INT1, IRQ_INT2). This must come after accm_init() as the registers will otherwise be overwritten. */ void accm_set_irq(uint8_t int1, uint8_t int2); /* Macros for setting the pointers to callback functions from the interrupts. - The function will be called with an u8_t as parameter, containing the interrupt + The function will be called with an uint8_t as parameter, containing the interrupt flag register from the ADXL345. That way, several interrupts can be mapped to the same pin and be read from the */ #define ACCM_REGISTER_INT1_CB(ptr) accm_int1_cb = ptr; @@ -278,8 +278,8 @@ void accm_set_irq(uint8_t int1, uint8_t int2); #define ADXL345_SRATE_0_10 0x00 // 0.10 Hz, when I2C data rate >= 100 kHz /* Callback pointers for the interrupts */ -extern void (*accm_int1_cb)(u8_t reg); -extern void (*accm_int2_cb)(u8_t reg); +extern void (*accm_int1_cb)(uint8_t reg); +extern void (*accm_int2_cb)(uint8_t reg); /* Interrupt 1 and 2 events; ADXL345 signals interrupt on INT1 or INT2 pins, ISR is invoked and polls the accelerometer process which invokes the callbacks. */ diff --git a/platform/z1/dev/i2cmaster.c b/platform/z1/dev/i2cmaster.c index 14f43f8dc..54871467a 100644 --- a/platform/z1/dev/i2cmaster.c +++ b/platform/z1/dev/i2cmaster.c @@ -59,7 +59,7 @@ volatile unsigned int i; // volatile to prevent optimization // unsigned char prescale => SCL clock adjustment //----------------------------------------------------------------------------- void -i2c_receiveinit(u8_t slave_address) { +i2c_receiveinit(uint8_t slave_address) { UCB1CTL1 = UCSWRST; // Enable SW reset UCB1CTL0 = UCMST + UCMODE_3 + UCSYNC; // I2C Master, synchronous mode UCB1CTL1 = UCSSEL_2 | UCSWRST; // Use SMCLK, keep SW reset @@ -86,7 +86,7 @@ i2c_receiveinit(u8_t slave_address) { // unsigned char prescale => SCL clock adjustment //------------------------------------------------------------------------------ void -i2c_transmitinit(u8_t slave_address) { +i2c_transmitinit(uint8_t slave_address) { UCB1CTL1 |= UCSWRST; // Enable SW reset UCB1CTL0 |= (UCMST | UCMODE_3 | UCSYNC); // I2C Master, synchronous mode UCB1CTL1 = UCSSEL_2 + UCSWRST; // Use SMCLK, keep SW reset @@ -107,9 +107,9 @@ i2c_transmitinit(u8_t slave_address) { // OUT: unsigned char rx_buf => receive data buffer // OUT: int n_received => number of bytes read //------------------------------------------------------------------------------ -static volatile u8_t rx_byte_tot = 0; -u8_t -i2c_receive_n(u8_t byte_ctr, u8_t *rx_buf) { +static volatile uint8_t rx_byte_tot = 0; +uint8_t +i2c_receive_n(uint8_t byte_ctr, uint8_t *rx_buf) { rx_byte_tot = byte_ctr; rx_byte_ctr = byte_ctr; @@ -136,7 +136,7 @@ i2c_receive_n(u8_t byte_ctr, u8_t *rx_buf) { return 0; #else - u8_t n_received = 0; + uint8_t n_received = 0; PRINTFDEBUG(" RX Interrupts: NO \n"); @@ -157,14 +157,14 @@ i2c_receive_n(u8_t byte_ctr, u8_t *rx_buf) { //------------------------------------------------------------------------------ -// u8_t i2c_busy() +// uint8_t i2c_busy() // // This function is used to check if there is communication in progress. // // OUT: unsigned char => 0: I2C bus is idle, // 1: communication is in progress //------------------------------------------------------------------------------ -u8_t +uint8_t i2c_busy(void) { return (UCB1STAT & UCBBUSY); } @@ -191,9 +191,9 @@ i2c_enable(void) { // IN: unsigned char byte_ctr => number of bytes to be transmitted // unsigned char *tx_buf => Content to transmit. Read and transmitted from [0] to [byte_ctr] //------------------------------------------------------------------------------ -static volatile u8_t tx_byte_tot = 0; +static volatile uint8_t tx_byte_tot = 0; void -i2c_transmit_n(u8_t byte_ctr, u8_t *tx_buf) { +i2c_transmit_n(uint8_t byte_ctr, uint8_t *tx_buf) { tx_byte_tot = byte_ctr; tx_byte_ctr = byte_ctr; tx_buf_ptr = tx_buf; diff --git a/platform/z1/dev/i2cmaster.h b/platform/z1/dev/i2cmaster.h index beccf3f5f..192e99ea1 100644 --- a/platform/z1/dev/i2cmaster.h +++ b/platform/z1/dev/i2cmaster.h @@ -45,13 +45,13 @@ void i2c_enable(void); -void i2c_receiveinit(u8_t slave_address); -u8_t i2c_receive_n(u8_t byte_ctr, u8_t *rx_buf); +void i2c_receiveinit(uint8_t slave_address); +uint8_t i2c_receive_n(uint8_t byte_ctr, uint8_t *rx_buf); -void i2c_transmitinit(u8_t slave_address); -void i2c_transmit_n(u8_t byte_ctr, u8_t *tx_buf); +void i2c_transmitinit(uint8_t slave_address); +void i2c_transmit_n(uint8_t byte_ctr, uint8_t *tx_buf); -u8_t i2c_busy(void); +uint8_t i2c_busy(void); //XXX Should these defines be in the contiki-conf.h to make it more platform-independent? #define I2C_PxDIR P5DIR diff --git a/platform/z1/dev/tmp102.c b/platform/z1/dev/tmp102.c index 9bf4691d2..59d6b6de7 100644 --- a/platform/z1/dev/tmp102.c +++ b/platform/z1/dev/tmp102.c @@ -97,12 +97,12 @@ tmp102_init (void) */ void -tmp102_write_reg (u8_t reg, u16_t val) +tmp102_write_reg (uint8_t reg, uint16_t val) { - u8_t tx_buf[] = { reg, 0x00, 0x00 }; + uint8_t tx_buf[] = { reg, 0x00, 0x00 }; - tx_buf[1] = (u8_t) (val >> 8); - tx_buf[2] = (u8_t) (val & 0x00FF); + tx_buf[1] = (uint8_t) (val >> 8); + tx_buf[2] = (uint8_t) (val & 0x00FF); i2c_transmitinit (TMP102_ADDR); while (i2c_busy ()); @@ -117,15 +117,15 @@ tmp102_write_reg (u8_t reg, u16_t val) /* Read register. args: reg what register to read - returns the value of the read register type u16_t + returns the value of the read register type uint16_t */ -u16_t -tmp102_read_reg (u8_t reg) +uint16_t +tmp102_read_reg (uint8_t reg) { - u8_t buf[] = { 0x00, 0x00 }; - u16_t retVal = 0; - u8_t rtx = reg; + uint8_t buf[] = { 0x00, 0x00 }; + uint16_t retVal = 0; + uint8_t rtx = reg; PRINTFDEBUG ("READ_REG 0x%02X\n", reg); // transmit the register to read @@ -140,7 +140,7 @@ tmp102_read_reg (u8_t reg) i2c_receive_n (2, &buf[0]); while (i2c_busy ()); - retVal = (u16_t) (buf[0] << 8 | (buf[1])); + retVal = (uint16_t) (buf[0] << 8 | (buf[1])); return retVal; } @@ -150,10 +150,10 @@ tmp102_read_reg (u8_t reg) to make an interpretation of these 12 or 13-bit data, depending on configuration */ -u16_t +uint16_t tmp102_read_temp_raw (void) { - u16_t rd = 0; + uint16_t rd = 0; rd = tmp102_read_reg (TMP102_TEMP); diff --git a/platform/z1/dev/tmp102.h b/platform/z1/dev/tmp102.h index db6fd5112..3265e976d 100644 --- a/platform/z1/dev/tmp102.h +++ b/platform/z1/dev/tmp102.h @@ -53,19 +53,19 @@ void tmp102_init(void); reg register to write to val value to write */ -void tmp102_write_reg(u8_t reg, u16_t val); +void tmp102_write_reg(uint8_t reg, uint16_t val); /* Read one register. args: reg what register to read returns the value of the read register */ -u16_t tmp102_read_reg(u8_t reg); +uint16_t tmp102_read_reg(uint8_t reg); /* Read temperature in raw format no args needed */ -u16_t tmp102_read_temp_raw(); +uint16_t tmp102_read_temp_raw(); /* Read only integer part of the temperature in 1deg. precision. no args needed