Converted u8_t to uint8_t and u16_t to uint16_t in the platforms directory.

Added "These names are deprecated, use C99 names" warnings the contiki-conf.h files that were missing it.
This commit is contained in:
Nicholas J Humfrey 2012-02-20 19:32:05 +00:00 committed by Mariano Alvira
parent a561d20828
commit 680225e99d
57 changed files with 274 additions and 250 deletions

View file

@ -69,18 +69,18 @@
#define cmd_len 8 #define cmd_len 8
#define data_len 20 #define data_len 20
static u8_t seqno; static uint8_t seqno;
uip_ipaddr_t ping_addr; uip_ipaddr_t ping_addr;
uip_ipaddr_t udp_addr; uip_ipaddr_t udp_addr;
static struct uip_udp_conn *udp_conn; static struct uip_udp_conn *udp_conn;
char udp_data[data_len]; char udp_data[data_len];
static struct{ static struct{
u8_t frame[cmd_len]; uint8_t frame[cmd_len];
u8_t ndx; uint8_t ndx;
u8_t len; uint8_t len;
u8_t cmd; uint8_t cmd;
u8_t done; uint8_t done;
} cmd; } cmd;
#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) #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); memset((void *)UIP_ICMP_BUF + UIP_ICMPH_LEN, 0, 4);
uip_len = UIP_ICMPH_LEN + UIP_ICMP6_ECHO_REQUEST_LEN + UIP_IPH_LEN; 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[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();
@ -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) raven_gui_loop(process_event_t ev, process_data_t data)
{ {
if(ev == tcpip_icmp6_event) { 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(raven_lcd_process, "Raven LCD interface process");
PROCESS_THREAD(raven_lcd_process, ev, data) PROCESS_THREAD(raven_lcd_process, ev, data)
{ {
u8_t error; uint8_t error;
PROCESS_BEGIN(); PROCESS_BEGIN();

View file

@ -76,17 +76,17 @@
#include <avr/sleep.h> #include <avr/sleep.h>
#include <dev/watchdog.h> #include <dev/watchdog.h>
static u8_t count = 0; static uint8_t count = 0;
static u8_t seqno; static uint8_t seqno;
uip_ipaddr_t dest_addr; uip_ipaddr_t dest_addr;
#define MAX_CMD_LEN 20 #define MAX_CMD_LEN 20
static struct{ static struct{
u8_t frame[MAX_CMD_LEN]; uint8_t frame[MAX_CMD_LEN];
u8_t ndx; uint8_t ndx;
u8_t len; uint8_t len;
u8_t cmd; uint8_t cmd;
u8_t done; uint8_t done;
} cmd; } cmd;
#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) #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_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();
@ -262,13 +262,13 @@ ISR(TIMER2_COMPA_vect)
#endif /* !AVR_CONF_USE32KCRYSTAL */ #endif /* !AVR_CONF_USE32KCRYSTAL */
#if DEBUGSERIAL #if DEBUGSERIAL
u8_t serialcount; uint8_t serialcount;
char dbuf[30]; char dbuf[30];
#endif #endif
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
extern uint16_t ledtimer; extern uint16_t ledtimer;
static u8_t static uint8_t
raven_gui_loop(process_event_t ev, process_data_t data) raven_gui_loop(process_event_t ev, process_data_t data)
{ {
uint8_t i,activeconnections,radio_state; uint8_t i,activeconnections,radio_state;

View file

@ -165,7 +165,7 @@ generate_file_stats(void *arg)
static const char httpd_cgi_filestat3[] HTTPD_STRING_ATTR = "%5u"; static const char httpd_cgi_filestat3[] HTTPD_STRING_ATTR = "%5u";
char tmp[20]; char tmp[20];
struct httpd_fsdata_file_noconst *f,fram; struct httpd_fsdata_file_noconst *f,fram;
u16_t i; uint16_t i;
unsigned short numprinted; unsigned short numprinted;
/* Transfer arg from whichever flash that contains the html file to RAM */ /* Transfer arg from whichever flash that contains the html file to RAM */

View file

@ -40,7 +40,7 @@
#include "httpd-fsdata.c" #include "httpd-fsdata.c"
#if HTTPD_FS_STATISTICS==2 #if HTTPD_FS_STATISTICS==2
u16_t httpd_filecount[HTTPD_FS_NUMFILES]; uint16_t httpd_filecount[HTTPD_FS_NUMFILES];
#endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
@ -50,18 +50,18 @@ httpd_fs_get_root()
return (void *)HTTPD_FS_ROOT; return (void *)HTTPD_FS_ROOT;
} }
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
u16_t uint16_t
httpd_fs_get_size() httpd_fs_get_size()
{ {
return HTTPD_FS_SIZE; return HTTPD_FS_SIZE;
} }
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
u16_t uint16_t
httpd_fs_open(const char *name, struct httpd_fs_file *file) httpd_fs_open(const char *name, struct httpd_fs_file *file)
{ {
#if HTTPD_FS_STATISTICS #if HTTPD_FS_STATISTICS
u16_t i = 0; uint16_t i = 0;
#endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */
struct httpd_fsdata_file_noconst *f,fram; struct httpd_fsdata_file_noconst *f,fram;
@ -103,7 +103,7 @@ void
httpd_fs_init(void) httpd_fs_init(void)
{ {
#if HTTPD_FS_STATISTICS && 0 //count will already be zero at boot #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++) { for(i = 0; i < HTTPD_FS_NUMFILES; i++) {
count[i] = 0; count[i] = 0;
} }
@ -111,11 +111,11 @@ httpd_fs_init(void)
} }
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
#if HTTPD_FS_STATISTICS && 0 //Not needed, httpd_fs_open returns count #if HTTPD_FS_STATISTICS && 0 //Not needed, httpd_fs_open returns count
u16_t uint16_t
httpd_fs_count(char *name) httpd_fs_count(char *name)
{ {
struct httpd_fsdata_file_noconst *f,fram; struct httpd_fsdata_file_noconst *f,fram;
u16_t i; uint16_t i;
i = 0; i = 0;
for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT; for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT;

View file

@ -41,7 +41,7 @@
#define HTTPD_FS_STATISTICS 2 //Puts count in RAM array #define HTTPD_FS_STATISTICS 2 //Puts count in RAM array
#if HTTPD_FS_STATISTICS==2 #if HTTPD_FS_STATISTICS==2
extern u16_t httpd_filecount[]; extern uint16_t httpd_filecount[];
#endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
@ -59,12 +59,12 @@ void httpd_fs_init(void);
/* Returns root of http files in program flash */ /* Returns root of http files in program flash */
void* httpd_fs_get_root(); void* httpd_fs_get_root();
/* Returns size of http files in any flash */ /* 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. /* Open a file in any flash and return statistics if enabled.
If file is allocated by caller it will be filled in. If file is allocated by caller it will be filled in.
If NULL, just file stats are returned. 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 #if COFFEE_FILES
/* Coffee file system can be static or dynamic. If static, new files /* Coffee file system can be static or dynamic. If static, new files

View file

@ -625,7 +625,7 @@ struct httpd_fsdata_file {
const char *data; //offset to coffee file data const char *data; //offset to coffee file data
const int len; //length of file data const int len; //length of file data
#if HTTPD_FS_STATISTICS == 1 //not enabled since list is in PROGMEM #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 #endif
} }
*/ */

View file

@ -43,7 +43,7 @@ struct httpd_fsdata_file {
const char *data; const char *data;
const int len; const int len;
#if HTTPD_FS_STATISTICS == 1 #if HTTPD_FS_STATISTICS == 1
u16_t count; uint16_t count;
#endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */
}; };
@ -53,7 +53,7 @@ struct httpd_fsdata_file_noconst {
char *data; char *data;
int len; int len;
#if HTTPD_FS_STATISTICS == 1 #if HTTPD_FS_STATISTICS == 1
u16_t count; uint16_t count;
#endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */
}; };

View file

@ -49,10 +49,12 @@
#endif #endif
#include <stdint.h> #include <stdint.h>
/* These names are deprecated, use C99 names. */
typedef int32_t s32_t; typedef int32_t s32_t;
typedef unsigned char u8_t; typedef unsigned char u8_t;
typedef unsigned short u16_t; typedef unsigned short u16_t;
typedef unsigned long u32_t; typedef unsigned long u32_t;
typedef unsigned short clock_time_t; typedef unsigned short clock_time_t;
typedef unsigned short uip_stats_t; typedef unsigned short uip_stats_t;
typedef unsigned long off_t; typedef unsigned long off_t;

View file

@ -69,18 +69,18 @@
#define cmd_len 8 #define cmd_len 8
#define data_len 20 #define data_len 20
static u8_t seqno; static uint8_t seqno;
uip_ipaddr_t ping_addr; uip_ipaddr_t ping_addr;
uip_ipaddr_t udp_addr; uip_ipaddr_t udp_addr;
static struct uip_udp_conn *udp_conn; static struct uip_udp_conn *udp_conn;
char udp_data[data_len]; char udp_data[data_len];
static struct{ static struct{
u8_t frame[cmd_len]; uint8_t frame[cmd_len];
u8_t ndx; uint8_t ndx;
u8_t len; uint8_t len;
u8_t cmd; uint8_t cmd;
u8_t done; uint8_t done;
} cmd; } cmd;
#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) #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); memset((void *)UIP_ICMP_BUF + UIP_ICMPH_LEN, 0, 4);
uip_len = UIP_ICMPH_LEN + UIP_ICMP6_ECHO_REQUEST_LEN + UIP_IPH_LEN; 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[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();
@ -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) raven_gui_loop(process_event_t ev, process_data_t data)
{ {
if(ev == tcpip_icmp6_event) { 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(raven_lcd_process, "Raven LCD interface process");
PROCESS_THREAD(raven_lcd_process, ev, data) PROCESS_THREAD(raven_lcd_process, ev, data)
{ {
u8_t error; uint8_t error;
PROCESS_BEGIN(); PROCESS_BEGIN();

View file

@ -79,17 +79,17 @@
#include <avr/sleep.h> #include <avr/sleep.h>
#include <dev/watchdog.h> #include <dev/watchdog.h>
static u8_t count = 0; static uint8_t count = 0;
static u8_t seqno; static uint8_t seqno;
uip_ipaddr_t dest_addr; uip_ipaddr_t dest_addr;
#define MAX_CMD_LEN 20 #define MAX_CMD_LEN 20
static struct{ static struct{
u8_t frame[MAX_CMD_LEN]; uint8_t frame[MAX_CMD_LEN];
u8_t ndx; uint8_t ndx;
u8_t len; uint8_t len;
u8_t cmd; uint8_t cmd;
u8_t done; uint8_t done;
} cmd; } cmd;
#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) #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_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();
@ -253,12 +253,12 @@ ISR(TIMER2_COMPA_vect)
#endif /* !AVR_CONF_USE32KCRYSTAL */ #endif /* !AVR_CONF_USE32KCRYSTAL */
#if DEBUGSERIAL #if DEBUGSERIAL
u8_t serialcount; uint8_t serialcount;
char dbuf[30]; char dbuf[30];
#endif #endif
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static u8_t static uint8_t
raven_gui_loop(process_event_t ev, process_data_t data) raven_gui_loop(process_event_t ev, process_data_t data)
{ {
uint8_t i,activeconnections,radio_state; uint8_t i,activeconnections,radio_state;

View file

@ -166,7 +166,7 @@ generate_file_stats(void *arg)
static const char httpd_cgi_filestat3[] HTTPD_STRING_ATTR = "%5u"; static const char httpd_cgi_filestat3[] HTTPD_STRING_ATTR = "%5u";
char tmp[20]; char tmp[20];
struct httpd_fsdata_file_noconst *f,fram; struct httpd_fsdata_file_noconst *f,fram;
u16_t i; uint16_t i;
unsigned short numprinted; unsigned short numprinted;
/* Transfer arg from whichever flash that contains the html file to RAM */ /* Transfer arg from whichever flash that contains the html file to RAM */

View file

@ -40,7 +40,7 @@
#include "httpd-fsdata.c" #include "httpd-fsdata.c"
#if HTTPD_FS_STATISTICS==2 #if HTTPD_FS_STATISTICS==2
u16_t httpd_filecount[HTTPD_FS_NUMFILES]; uint16_t httpd_filecount[HTTPD_FS_NUMFILES];
#endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
@ -50,18 +50,18 @@ httpd_fs_get_root()
return (void *)HTTPD_FS_ROOT; return (void *)HTTPD_FS_ROOT;
} }
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
u16_t uint16_t
httpd_fs_get_size() httpd_fs_get_size()
{ {
return HTTPD_FS_SIZE; return HTTPD_FS_SIZE;
} }
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
u16_t uint16_t
httpd_fs_open(const char *name, struct httpd_fs_file *file) httpd_fs_open(const char *name, struct httpd_fs_file *file)
{ {
#if HTTPD_FS_STATISTICS #if HTTPD_FS_STATISTICS
u16_t i = 0; uint16_t i = 0;
#endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */
struct httpd_fsdata_file_noconst *f,fram; struct httpd_fsdata_file_noconst *f,fram;
@ -103,7 +103,7 @@ void
httpd_fs_init(void) httpd_fs_init(void)
{ {
#if HTTPD_FS_STATISTICS && 0 //count will already be zero at boot #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++) { for(i = 0; i < HTTPD_FS_NUMFILES; i++) {
count[i] = 0; count[i] = 0;
} }
@ -111,11 +111,11 @@ httpd_fs_init(void)
} }
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
#if HTTPD_FS_STATISTICS && 0 //Not needed, httpd_fs_open returns count #if HTTPD_FS_STATISTICS && 0 //Not needed, httpd_fs_open returns count
u16_t uint16_t
httpd_fs_count(char *name) httpd_fs_count(char *name)
{ {
struct httpd_fsdata_file_noconst *f,fram; struct httpd_fsdata_file_noconst *f,fram;
u16_t i; uint16_t i;
i = 0; i = 0;
for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT; for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT;

View file

@ -41,7 +41,7 @@
#define HTTPD_FS_STATISTICS 2 //Puts count in RAM array #define HTTPD_FS_STATISTICS 2 //Puts count in RAM array
#if HTTPD_FS_STATISTICS==2 #if HTTPD_FS_STATISTICS==2
extern u16_t httpd_filecount[]; extern uint16_t httpd_filecount[];
#endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
@ -59,12 +59,12 @@ void httpd_fs_init(void);
/* Returns root of http files in program flash */ /* Returns root of http files in program flash */
void* httpd_fs_get_root(); void* httpd_fs_get_root();
/* Returns size of http files in any flash */ /* 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. /* Open a file in any flash and return statistics if enabled.
If file is allocated by caller it will be filled in. If file is allocated by caller it will be filled in.
If NULL, just file stats are returned. 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 #if COFFEE_FILES
/* Coffee file system can be static or dynamic. If static, new files /* Coffee file system can be static or dynamic. If static, new files

View file

@ -43,7 +43,7 @@ struct httpd_fsdata_file {
const char *data; const char *data;
const int len; const int len;
#if HTTPD_FS_STATISTICS == 1 #if HTTPD_FS_STATISTICS == 1
u16_t count; uint16_t count;
#endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */
}; };
@ -53,7 +53,7 @@ struct httpd_fsdata_file_noconst {
char *data; char *data;
int len; int len;
#if HTTPD_FS_STATISTICS == 1 #if HTTPD_FS_STATISTICS == 1
u16_t count; uint16_t count;
#endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */
}; };

View file

@ -56,10 +56,12 @@
#include <stdint.h> #include <stdint.h>
/* These names are deprecated, use C99 names. */
typedef int32_t s32_t; typedef int32_t s32_t;
typedef unsigned char u8_t; typedef unsigned char u8_t;
typedef unsigned short u16_t; typedef unsigned short u16_t;
typedef unsigned long u32_t; typedef unsigned long u32_t;
typedef unsigned short clock_time_t; typedef unsigned short clock_time_t;
typedef unsigned short uip_stats_t; typedef unsigned short uip_stats_t;
typedef unsigned long off_t; typedef unsigned long off_t;

View file

@ -58,6 +58,7 @@
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
/* These names are deprecated, use C99 names. */
typedef int32_t s32_t; typedef int32_t s32_t;
typedef unsigned char u8_t; typedef unsigned char u8_t;
typedef unsigned short u16_t; typedef unsigned short u16_t;

View file

@ -115,6 +115,8 @@ typedef int32_t s32_t;
typedef unsigned short clock_time_t; typedef unsigned short clock_time_t;
/* These names are deprecated, use C99 names. */
typedef unsigned char u8_t; typedef unsigned char u8_t;
typedef unsigned short u16_t; typedef unsigned short u16_t;
typedef unsigned long u32_t; typedef unsigned long u32_t;

View file

@ -107,7 +107,7 @@ init_lowlevel(void)
static struct etimer et; static struct etimer et;
PROCESS_THREAD(rcb_leds, ev, data) PROCESS_THREAD(rcb_leds, ev, data)
{ {
u8_t error; uint8_t error;
PROCESS_BEGIN(); PROCESS_BEGIN();

View file

@ -145,11 +145,13 @@
#include <stdint.h> #include <stdint.h>
typedef int32_t s32_t; /* These names are deprecated, use C99 names. */
typedef unsigned short clock_time_t; typedef unsigned short clock_time_t;
typedef unsigned char u8_t; typedef unsigned char u8_t;
typedef unsigned short u16_t; typedef unsigned short u16_t;
typedef unsigned long u32_t; typedef unsigned long u32_t;
typedef int32_t s32_t;
typedef unsigned short uip_stats_t; typedef unsigned short uip_stats_t;
typedef unsigned long off_t; typedef unsigned long off_t;

View file

@ -93,7 +93,7 @@ main(void)
#if (WITH_GUI && WITH_MOUSE) #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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0F, 0xE0, 0x00, 0x0F, 0xC0, 0x00, 0x0F, 0x00, 0x0F, 0xE0, 0x00, 0x0F, 0xC0, 0x00, 0x0F,
0x80, 0x00, 0x0F, 0xC0, 0x00, 0x0D, 0xE0, 0x00, 0x80, 0x00, 0x0F, 0xC0, 0x00, 0x0D, 0xE0, 0x00,
@ -104,7 +104,7 @@ main(void)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
memcpy((void*)0x0E00, mouse_sprite, sizeof(mouse_sprite)); memcpy((void*)0x0E00, mouse_sprite, sizeof(mouse_sprite));
*(u8_t*)0x07F8 = 0x0E00 / 64; *(uint8_t*)0x07F8 = 0x0E00 / 64;
VIC.spr0_color = COLOR_WHITE; VIC.spr0_color = COLOR_WHITE;
} }
#endif /* WITH_GUI && WITH_MOUSE */ #endif /* WITH_GUI && WITH_MOUSE */

View file

@ -91,7 +91,7 @@ main(void)
#if (WITH_GUI && WITH_MOUSE) #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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0F, 0xE0, 0x00, 0x0F, 0xC0, 0x00, 0x0F, 0x00, 0x0F, 0xE0, 0x00, 0x0F, 0xC0, 0x00, 0x0F,
0x80, 0x00, 0x0F, 0xC0, 0x00, 0x0D, 0xE0, 0x00, 0x80, 0x00, 0x0F, 0xC0, 0x00, 0x0D, 0xE0, 0x00,
@ -102,7 +102,7 @@ main(void)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
memcpy((void*)0x0340, mouse_sprite, sizeof(mouse_sprite)); memcpy((void*)0x0340, mouse_sprite, sizeof(mouse_sprite));
*(u8_t*)0x07F8 = 0x0340 / 64; *(uint8_t*)0x07F8 = 0x0340 / 64;
VIC.spr0_color = COLOR_WHITE; VIC.spr0_color = COLOR_WHITE;
} }
#endif /* WITH_GUI && WITH_MOUSE */ #endif /* WITH_GUI && WITH_MOUSE */

View file

@ -105,11 +105,13 @@
#define CCIF #define CCIF
#define CLIF #define CLIF
/* These names are deprecated, use C99 names. */
#include <inttypes.h> #include <inttypes.h>
typedef uint8_t u8_t; typedef uint8_t u8_t;
typedef uint16_t u16_t; typedef uint16_t u16_t;
typedef uint32_t u32_t; typedef uint32_t u32_t;
typedef int32_t s32_t; typedef int32_t s32_t;
typedef unsigned short uip_stats_t; typedef unsigned short uip_stats_t;
#define CLOCK_CONF_SECOND 1000L #define CLOCK_CONF_SECOND 1000L

View file

@ -100,7 +100,7 @@ static uint8_t is_gateway;
#if WITH_UIP6 #if WITH_UIP6
#include "net/uip.h" #include "net/uip.h"
#include "net/uip-ds6.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 */ #endif /* WITH_UIP6 */
PROCINIT(&etimer_process,&sensors_process); PROCINIT(&etimer_process,&sensors_process);

View file

@ -66,12 +66,12 @@ enum {
struct buf_packet { struct buf_packet {
struct buf_packet *next; struct buf_packet *next;
u8_t data[UIP_BUFSIZE]; uint8_t data[UIP_BUFSIZE];
int len; int len;
u8_t resends; uint8_t resends;
u8_t acked; uint8_t acked;
u8_t want_ack; uint8_t want_ack;
u16_t crc; uint16_t crc;
uip_ipaddr_t finaldest; uip_ipaddr_t finaldest;
struct etimer etimer; struct etimer etimer;
}; };
@ -87,21 +87,21 @@ static const struct radio_driver *radio;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static void receiver(const struct radio_driver *d); 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); void radio_uip_uaodv_init(const struct radio_driver *d);
int radio_uip_handle_ack(u8_t *buf, int len); int radio_uip_handle_ack(uint8_t *buf, int len);
u16_t radio_uip_calc_crc(u8_t *buf, int len); uint16_t radio_uip_calc_crc(uint8_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_buffer_outgoing_packet(uint8_t *buf, int len, uip_ipaddr_t *dest, int max_sends);
int radio_uip_is_ack(u8_t *buf, int len); int radio_uip_is_ack(uint8_t *buf, int len);
int radio_uip_uaodv_add_header(u8_t *buf, int len, uip_ipaddr_t *addr); int radio_uip_uaodv_add_header(uint8_t *buf, int len, uip_ipaddr_t *addr);
int radio_uip_uaodv_remove_header(u8_t *buf, int len); int radio_uip_uaodv_remove_header(uint8_t *buf, int len);
void radio_uip_uaodv_change_header(u8_t *buf, int len, uip_ipaddr_t *addr); void radio_uip_uaodv_change_header(uint8_t *buf, int len, uip_ipaddr_t *addr);
int radio_uip_uaodv_header_exists(u8_t *buf, int len); 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_is_broadcast(uip_ipaddr_t *addr);
int radio_uip_uaodv_fwd_is_broadcast(u8_t *buf, int len); int radio_uip_uaodv_fwd_is_broadcast(uint8_t *buf, int len);
int radio_uip_uaodv_fwd_is_me(u8_t *buf, int len); int radio_uip_uaodv_fwd_is_me(uint8_t *buf, int len);
int radio_uip_uaodv_dest_is_me(u8_t *buf, int len); int radio_uip_uaodv_dest_is_me(uint8_t *buf, int len);
int radio_uip_uaodv_dest_port(u8_t *buf, int len); int radio_uip_uaodv_dest_port(uint8_t *buf, int len);
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* Main process - handles (re)transmissions and acks */ /* Main process - handles (re)transmissions and acks */
@ -117,10 +117,10 @@ PROCESS_THREAD(radio_uip_process, ev, data)
if(ev == EVENT_SEND_ACK) { if(ev == EVENT_SEND_ACK) {
/* Prepare and send ack for given 16-bit CRC */ /* 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); memcpy(ackPacket, ACK_ID, ACK_ID_LENGTH);
ackPacket[ACK_CRC] = ((u16_t) data >> 8); ackPacket[ACK_CRC] = ((uint16_t) data >> 8);
ackPacket[ACK_CRC+1] = ((u16_t) data & 0xff); ackPacket[ACK_CRC+1] = ((uint16_t) data & 0xff);
radio->send(ackPacket, ACK_PACKET_LENGTH); radio->send(ackPacket, ACK_PACKET_LENGTH);
} else if(ev == PROCESS_EVENT_TIMER) { } else if(ev == PROCESS_EVENT_TIMER) {
@ -187,9 +187,9 @@ receiver(const struct radio_driver *d)
{ {
/* Send ack as soon as possible */ /* Send ack as soon as possible */
u16_t crc; uint16_t crc;
crc = radio_uip_calc_crc(&uip_buf[UIP_LLH_LEN], uip_len); 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 */ /* Strip header and receive packet */
@ -197,7 +197,7 @@ receiver(const struct radio_driver *d)
tcpip_input(); tcpip_input();
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
u8_t uint8_t
radio_uip_uaodv_send(void) radio_uip_uaodv_send(void)
{ {
struct uaodv_rt_entry *route; struct uaodv_rt_entry *route;
@ -261,10 +261,10 @@ radio_uip_uaodv_init(const struct radio_driver *d)
radio->on(); radio->on();
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
u16_t uint16_t
radio_uip_calc_crc(u8_t *buf, int len) radio_uip_calc_crc(uint8_t *buf, int len)
{ {
u16_t crcacc = 0xffff; uint16_t crcacc = 0xffff;
int counter; int counter;
/* TODO Not effective */ /* TODO Not effective */
@ -275,11 +275,11 @@ radio_uip_calc_crc(u8_t *buf, int len)
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
int 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; struct buf_packet *packet;
u16_t crc; uint16_t crc;
/* Calculate packet's unique CRC */ /* Calculate packet's unique CRC */
crc = radio_uip_calc_crc(&uip_buf[UIP_LLH_LEN], uip_len); 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 int
radio_uip_is_ack(u8_t *buf, int len) radio_uip_is_ack(uint8_t *buf, int len)
{ {
if (len != ACK_PACKET_LENGTH) if (len != ACK_PACKET_LENGTH)
return 0; return 0;
@ -333,12 +333,12 @@ radio_uip_is_ack(u8_t *buf, int len)
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
int int
radio_uip_handle_ack(u8_t *buf, int len) radio_uip_handle_ack(uint8_t *buf, int len)
{ {
struct buf_packet *packet; 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 */ /* Locate which packet was acknowledged */
for(packet = list_head(buf_packet_list); for(packet = list_head(buf_packet_list);
@ -355,9 +355,9 @@ radio_uip_handle_ack(u8_t *buf, int len)
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
int 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(tempbuf, buf, len);
memcpy(&buf[FWD_PACKET_LENGTH], tempbuf, len); memcpy(&buf[FWD_PACKET_LENGTH], tempbuf, len);
memcpy(buf, FWD_ID, FWD_ID_LENGTH); 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 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(tempbuf, &buf[FWD_PACKET_LENGTH], len);
memcpy(buf, tempbuf, len); memcpy(buf, tempbuf, len);
return len - FWD_PACKET_LENGTH; return len - FWD_PACKET_LENGTH;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
void 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); memcpy(&buf[FWD_NEXT_IP], addr, 4);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
int 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); return !memcmp(buf, FWD_ID, FWD_ID_LENGTH);
} }
@ -393,25 +393,25 @@ radio_uip_uaodv_is_broadcast(uip_ipaddr_t *addr)
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
int 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]); return radio_uip_uaodv_is_broadcast((uip_ipaddr_t*) &buf[FWD_NEXT_IP]);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
int 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); return !memcmp(&buf[FWD_NEXT_IP], &uip_hostaddr, 4);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
int 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); return !memcmp((&((struct uip_udpip_hdr *)buf)->destipaddr), &uip_hostaddr, 4);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
int 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)) if (len < sizeof(struct uip_udpip_hdr))
return -1; return -1;

View file

@ -40,7 +40,7 @@
void void
radio_uip_uaodv_init(const struct radio_driver *d); radio_uip_uaodv_init(const struct radio_driver *d);
u8_t uint8_t
radio_uip_uaodv_send(void); radio_uip_uaodv_send(void);
#endif /* __RADIO_UIP_UAODV_H__ */ #endif /* __RADIO_UIP_UAODV_H__ */

View file

@ -43,7 +43,7 @@ PROCESS_THREAD(test_cfs_process, ev, data)
{ {
static struct etimer et; static struct etimer et;
static int fd; static int fd;
static u16_t counter; static uint16_t counter;
static char buf[30]; static char buf[30];
PROCESS_BEGIN(); PROCESS_BEGIN();

View file

@ -38,7 +38,7 @@ PROCESS(test_ctimer_process, "Callback timer test process");
AUTOSTART_PROCESSES(&test_ctimer_process); AUTOSTART_PROCESSES(&test_ctimer_process);
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static struct ctimer ct; static struct ctimer ct;
static u16_t counter = 0; static uint16_t counter = 0;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static void static void
callback(void *ptr) callback(void *ptr)

View file

@ -40,7 +40,7 @@ AUTOSTART_PROCESSES(&test_etimer_process);
PROCESS_THREAD(test_etimer_process, ev, data) PROCESS_THREAD(test_etimer_process, ev, data)
{ {
static struct etimer et; static struct etimer et;
static u16_t counter = 0; static uint16_t counter = 0;
PROCESS_BEGIN(); PROCESS_BEGIN();

View file

@ -40,10 +40,10 @@ PROCESS(pinger, "Pinger");
static struct uip_udp_conn *conn; static struct uip_udp_conn *conn;
struct data { struct data {
u8_t dummy_data[20]; uint8_t dummy_data[20];
u16_t id; uint16_t id;
u16_t seqno; uint16_t seqno;
u8_t pingpong; uint8_t pingpong;
#define PING 0 #define PING 0
#define PONG 1 #define PONG 1
}; };

View file

@ -53,7 +53,7 @@ static void
sniffer_callback(const struct radio_driver *driver) sniffer_callback(const struct radio_driver *driver)
{ {
static char buf[40]; static char buf[40];
static u8_t packet[UIP_BUFSIZE]; static uint8_t packet[UIP_BUFSIZE];
static int len; static int len;
len = driver->read(packet, sizeof(packet)); len = driver->read(packet, sizeof(packet));
if(len > 0) { if(len > 0) {

View file

@ -106,10 +106,10 @@ cl_stop()
} }
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/* Writes a byte on the bus, returns the acknowledge bit. */ /* Writes a byte on the bus, returns the acknowledge bit. */
static u16_t static uint16_t
cl_writeOnBus(u8_t byte) cl_writeOnBus(uint8_t byte)
{ {
u16_t i, ack; uint16_t i, ack;
for(i=0;i<8;i++) { for(i=0;i<8;i++) {
if(byte & 0x80) SDA_HIGH; else SDA_LOW; if(byte & 0x80) SDA_HIGH; else SDA_LOW;
SCL_HIGH; SCL_HIGH;
@ -126,11 +126,11 @@ cl_writeOnBus(u8_t byte)
return ack; return ack;
} }
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
static u8_t static uint8_t
cl_readFromBus(u16_t ack) cl_readFromBus(uint16_t ack)
{ {
u16_t i; uint16_t i;
u8_t byte = 0; uint8_t byte = 0;
P5DIR &= 0xFE; /* P50(SDA) input */ P5DIR &= 0xFE; /* P50(SDA) input */
for(i=0;i<8;i++) { for(i=0;i<8;i++) {
byte = byte << 1; byte = byte << 1;
@ -145,10 +145,10 @@ cl_readFromBus(u16_t ack)
return byte; return byte;
} }
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
static u16_t static uint16_t
getReg16bit(u8_t acc, u16_t bitmask) getReg16bit(uint8_t acc, uint16_t bitmask)
{ {
u16_t config = 0; uint16_t config = 0;
do cl_start(); do cl_start();
while(!cl_writeOnBus(BUS_WRITE)); while(!cl_writeOnBus(BUS_WRITE));
cl_writeOnBus(acc); 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 */ /* Only first 8 bit of Configuration Status Register can be set */
static void static void
setCSReg(u8_t setting) setCSReg(uint8_t setting)
{ {
do cl_start(); do cl_start();
while(!cl_writeOnBus(BUS_WRITE)); while(!cl_writeOnBus(BUS_WRITE));
@ -192,7 +192,7 @@ System_startConversion(void)
static void static void
initClock(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 */ if(csr!=CSR_DEFAULT) setCSReg(CSR_DEFAULT); /* if desired config isnt in clock => set it */
/* IMPORTANT: Ensure quartz is generating 32768 Hz */ /* IMPORTANT: Ensure quartz is generating 32768 Hz */
/* (sometimes CH bit gets set when clock is read while reset) */ /* (sometimes CH bit gets set when clock is read while reset) */

View file

@ -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_getToggle(void){ return ((recvdata & 0x0800) >> 11); }
unsigned char recir_getError(void){ return ((recvdata & 0x2000) >> 13); } unsigned char recir_getError(void){ return ((recvdata & 0x2000) >> 13); }
u16_t uint16_t
ir_data(void) ir_data(void)
{ {
return recvdata; return recvdata;
} }
u8_t uint8_t
ir_poll(void) ir_poll(void)
{ {
if(recvdata & 0x1000) { if(recvdata & 0x1000) {

View file

@ -47,11 +47,11 @@ void ir_init(void);
void ir_send(unsigned short low12bits); void ir_send(unsigned short low12bits);
u8_t ir_poll(void); uint8_t ir_poll(void);
#define IR_NODATA 0 #define IR_NODATA 0
#define IR_DATA 1 #define IR_DATA 1
u16_t ir_data(void); uint16_t ir_data(void);
void ir_irq(void); void ir_irq(void);

View file

@ -58,10 +58,12 @@
#define CCIF #define CCIF
#define CLIF #define CLIF
/* These names are deprecated, use C99 names. */
typedef uint8_t u8_t; typedef uint8_t u8_t;
typedef uint16_t u16_t; typedef uint16_t u16_t;
typedef uint32_t u32_t; typedef uint32_t u32_t;
typedef int32_t s32_t; typedef int32_t s32_t;
typedef unsigned short uip_stats_t; typedef unsigned short uip_stats_t;

View file

@ -48,7 +48,7 @@
#if DEBUG #if DEBUG
#include <stdio.h> #include <stdio.h>
#define PRINTF(...) printf(__VA_ARGS__) #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]) #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 #else
#define PRINTF(...) #define PRINTF(...)

View file

@ -72,7 +72,7 @@
#if DEBUG #if DEBUG
#include <stdio.h> #include <stdio.h>
#define PRINTF(...) printf(__VA_ARGS__) #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]) #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 #else
#define PRINTF(...) #define PRINTF(...)
@ -96,7 +96,7 @@ set_rime_addr(void)
{ {
int i; int i;
union { union {
u8_t u8[8]; uint8_t u8[8];
}eui64; }eui64;
//rimeaddr_t lladdr; //rimeaddr_t lladdr;

View file

@ -57,12 +57,13 @@
#define CCIF #define CCIF
#define CLIF #define CLIF
/* These names are deprecated, use C99 names. */
typedef uint8_t u8_t; typedef uint8_t u8_t;
typedef uint16_t u16_t; typedef uint16_t u16_t;
typedef uint32_t u32_t; typedef uint32_t u32_t;
typedef int32_t s32_t; typedef int32_t s32_t;
typedef unsigned short uip_stats_t;
typedef unsigned short uip_stats_t;
//#define FIXED_NET_ADDRESS 1 //#define FIXED_NET_ADDRESS 1
//#define NET_ADDR_A 0x2001 //#define NET_ADDR_A 0x2001

View file

@ -71,7 +71,7 @@
#if DEBUG #if DEBUG
#include <stdio.h> #include <stdio.h>
#define PRINTF(...) printf(__VA_ARGS__) #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]) #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 #else
#define PRINTF(...) #define PRINTF(...)
@ -95,7 +95,7 @@ set_rime_addr(void)
{ {
int i; int i;
union { union {
u8_t u8[8]; uint8_t u8[8];
}eui64; }eui64;
//rimeaddr_t lladdr; //rimeaddr_t lladdr;

View file

@ -45,12 +45,15 @@
#define CCIF #define CCIF
#define CLIF #define CLIF
/* These names are deprecated, use C99 names. */
typedef uint8_t u8_t; typedef uint8_t u8_t;
typedef uint16_t u16_t; typedef uint16_t u16_t;
typedef uint32_t u32_t; typedef uint32_t u32_t;
typedef int32_t s32_t; typedef int32_t s32_t;
typedef unsigned short uip_stats_t; typedef unsigned short uip_stats_t;
#if UIP_CONF_IPV6 #if UIP_CONF_IPV6
/* The Windows build uses wpcap to connect to a host interface. It finds the interface by scanning for /* 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. * an address, which can be specified here and overridden with the command line.

View file

@ -55,10 +55,12 @@ int select_set_callback(int fd, const struct select_callback *callback);
#define CCIF #define CCIF
#define CLIF #define CLIF
/* These names are deprecated, use C99 names. */
typedef uint8_t u8_t; typedef uint8_t u8_t;
typedef uint16_t u16_t; typedef uint16_t u16_t;
typedef uint32_t u32_t; typedef uint32_t u32_t;
typedef int32_t s32_t; typedef int32_t s32_t;
typedef unsigned short uip_stats_t; typedef unsigned short uip_stats_t;
#define UIP_CONF_UDP 1 #define UIP_CONF_UDP 1

View file

@ -42,14 +42,14 @@
#include "ctk/libconio_arch-small.h" #include "ctk/libconio_arch-small.h"
#if HTTPD_FS_STATISTICS #if HTTPD_FS_STATISTICS
static u16_t count[HTTPD_FS_NUMFILES]; static uint16_t count[HTTPD_FS_NUMFILES];
#endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
static u8_t static uint8_t
httpd_fs_strcmp(const char *str1, const char *str2) httpd_fs_strcmp(const char *str1, const char *str2)
{ {
u8_t i; uint8_t i;
i = 0; i = 0;
loop: loop:
@ -71,7 +71,7 @@ int
httpd_fs_open(const char *name, struct httpd_fs_file *file) httpd_fs_open(const char *name, struct httpd_fs_file *file)
{ {
#if HTTPD_FS_STATISTICS #if HTTPD_FS_STATISTICS
u16_t i = 0; uint16_t i = 0;
#endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */
char* ch; char* ch;
struct httpd_fsdata_file_noconst *f; struct httpd_fsdata_file_noconst *f;
@ -101,7 +101,7 @@ void
httpd_fs_init(void) httpd_fs_init(void)
{ {
#if HTTPD_FS_STATISTICS #if HTTPD_FS_STATISTICS
u16_t i; uint16_t i;
for(i = 0; i < HTTPD_FS_NUMFILES; i++) { for(i = 0; i < HTTPD_FS_NUMFILES; i++) {
count[i] = 0; count[i] = 0;
} }
@ -109,11 +109,11 @@ httpd_fs_init(void)
} }
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
#if HTTPD_FS_STATISTICS #if HTTPD_FS_STATISTICS
u16_t uint16_t
httpd_fs_count(char *name) httpd_fs_count(char *name)
{ {
struct httpd_fsdata_file_noconst *f; struct httpd_fsdata_file_noconst *f;
u16_t i; uint16_t i;
i = 0; i = 0;
for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT; for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT;

View file

@ -50,7 +50,7 @@ int httpd_fs_open(const char *name, struct httpd_fs_file *file);
#ifdef HTTPD_FS_STATISTICS #ifdef HTTPD_FS_STATISTICS
#if HTTPD_FS_STATISTICS == 1 #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 */
#endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */

View file

@ -44,7 +44,7 @@ struct httpd_fsdata_file {
const int len; const int len;
#ifdef HTTPD_FS_STATISTICS #ifdef HTTPD_FS_STATISTICS
#if HTTPD_FS_STATISTICS == 1 #if HTTPD_FS_STATISTICS == 1
u16_t count; uint16_t count;
#endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */
#endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */
}; };
@ -56,7 +56,7 @@ struct httpd_fsdata_file_noconst {
int len; int len;
#ifdef HTTPD_FS_STATISTICS #ifdef HTTPD_FS_STATISTICS
#if HTTPD_FS_STATISTICS == 1 #if HTTPD_FS_STATISTICS == 1
u16_t count; uint16_t count;
#endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */
#endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */
}; };

View file

@ -46,7 +46,7 @@
#undef RS232_INTR #undef RS232_INTR
#ifdef 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); void rs232_arch_init(int (* callback)(unsigned char), unsigned long ubr);
#else #else
#include "dev/rs232.h" #include "dev/rs232.h"

View file

@ -49,57 +49,57 @@
/* /*
* Offset constants for assembler * Offset constants for assembler
*/ */
const u8_t off_widget_x = offsetof(struct ctk_widget, x); const uint8_t off_widget_x = offsetof(struct ctk_widget, x);
const u8_t off_widget_y = offsetof(struct ctk_widget, y); const uint8_t off_widget_y = offsetof(struct ctk_widget, y);
const u8_t off_widget_w = offsetof(struct ctk_widget, w); const uint8_t off_widget_w = offsetof(struct ctk_widget, w);
const u8_t off_widget_h = offsetof(struct ctk_widget, h); const uint8_t off_widget_h = offsetof(struct ctk_widget, h);
const u8_t off_widget_type = offsetof(struct ctk_widget, type); const uint8_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_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); 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); 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); 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); 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); 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); offsetof(struct ctk_widget_textentry, state);
#if CTK_CONF_HYPERLINK #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); offsetof(struct ctk_widget_hyperlink, text);
#endif /* CTK_CONF_HYPERLINK */ #endif /* CTK_CONF_HYPERLINK */
#if CTK_CONF_ICONS #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); 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); offsetof(struct ctk_widget_icon, textmap);
#endif /* CTK_CONF_ICONS */ #endif /* CTK_CONF_ICONS */
const u8_t off_window_x = offsetof(struct ctk_window, x); const uint8_t off_window_x = offsetof(struct ctk_window, x);
const u8_t off_window_y = offsetof(struct ctk_window, y); const uint8_t off_window_y = offsetof(struct ctk_window, y);
const u8_t off_window_h = offsetof(struct ctk_window, h); const uint8_t off_window_h = offsetof(struct ctk_window, h);
const u8_t off_window_w = offsetof(struct ctk_window, w); const uint8_t off_window_w = offsetof(struct ctk_window, w);
const u8_t off_window_inactive = offsetof(struct ctk_window, inactive); const uint8_t off_window_inactive = offsetof(struct ctk_window, inactive);
const u8_t off_window_active = offsetof(struct ctk_window, active); const uint8_t off_window_active = offsetof(struct ctk_window, active);
const u8_t off_window_next = offsetof(struct ctk_window, next); const uint8_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_focused = offsetof(struct ctk_window, focused);
#if CTK_CONF_MENUS #if CTK_CONF_MENUS
const u8_t off_menu_title = offsetof(struct ctk_menu, title); const uint8_t off_menu_title = offsetof(struct ctk_menu, title);
const u8_t off_menu_active = offsetof(struct ctk_menu, active); const uint8_t off_menu_active = offsetof(struct ctk_menu, active);
const u8_t off_menu_nitems = offsetof(struct ctk_menu, nitems); const uint8_t off_menu_nitems = offsetof(struct ctk_menu, nitems);
const u8_t off_menu_items = offsetof(struct ctk_menu, items); const uint8_t off_menu_items = offsetof(struct ctk_menu, items);
const u8_t off_menu_next = offsetof(struct ctk_menu, next); const uint8_t off_menu_next = offsetof(struct ctk_menu, next);
const u8_t off_menuitem_title = offsetof(struct ctk_menuitem, title); const uint8_t off_menuitem_title = offsetof(struct ctk_menuitem, title);
const u8_t size_menuitem = sizeof(struct ctk_menuitem); const uint8_t size_menuitem = sizeof(struct ctk_menuitem);
const u8_t off_menus_open = offsetof(struct ctk_menus, open); const uint8_t off_menus_open = offsetof(struct ctk_menus, open);
const u8_t off_menus_menus = offsetof(struct ctk_menus, menus); const uint8_t off_menus_menus = offsetof(struct ctk_menus, menus);
const u8_t off_menus_desktopmenu = offsetof(struct ctk_menus, desktopmenu); const uint8_t off_menus_desktopmenu = offsetof(struct ctk_menus, desktopmenu);
#endif #endif
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/

View file

@ -65,7 +65,7 @@ _rs232_arch_putc_next2:
.endif .endif
;; --------------------------------- ;; ---------------------------------
;; void rs232_writeb(u8_t c) ;; void rs232_writeb(uint8_t c)
;; Stack; retl reth c ;; Stack; retl reth c
;; AF__D_HL____ ;; AF__D_HL____
;; return void ;; return void

View file

@ -70,7 +70,7 @@
#if DEBUG #if DEBUG
#include <stdio.h> #include <stdio.h>
#define PRINTF(...) printf(__VA_ARGS__) #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]) #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 #else
#define PRINTF(...) #define PRINTF(...)

View file

@ -89,7 +89,7 @@ void rtimercycle(void) {rtimerflag=1;}
#if DEBUG #if DEBUG
#include <stdio.h> #include <stdio.h>
#define PRINTF(...) printf(__VA_ARGS__) #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]) #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 #else
#define PRINTF(...) #define PRINTF(...)

View file

@ -13,6 +13,8 @@
#define WITH_ASCII 1 #define WITH_ASCII 1
#define CLOCK_CONF_SECOND 100 #define CLOCK_CONF_SECOND 100
/* These names are deprecated, use C99 names. */
typedef uint8_t u8_t; typedef uint8_t u8_t;
typedef uint16_t u16_t; typedef uint16_t u16_t;
typedef uint32_t u32_t; typedef uint32_t u32_t;

View file

@ -65,6 +65,7 @@ unsigned long clock_seconds(void);
typedef unsigned short uip_stats_t; typedef unsigned short uip_stats_t;
/* These names are deprecated, use C99 names. */
typedef uint8_t u8_t; typedef uint8_t u8_t;
typedef int8_t s8_t; typedef int8_t s8_t;
typedef uint16_t u16_t; typedef uint16_t u16_t;

View file

@ -10,6 +10,8 @@
#define WITH_ASCII 1 #define WITH_ASCII 1
#define CLOCK_CONF_SECOND 100 #define CLOCK_CONF_SECOND 100
/* These names are deprecated, use C99 names. */
typedef uint8_t u8_t; typedef uint8_t u8_t;
typedef uint16_t u16_t; typedef uint16_t u16_t;
typedef uint32_t u32_t; typedef uint32_t u32_t;

View file

@ -46,8 +46,8 @@
#include "i2cmaster.h" #include "i2cmaster.h"
/* Callback pointers when interrupt occurs */ /* Callback pointers when interrupt occurs */
void (*accm_int1_cb)(u8_t reg); void (*accm_int1_cb)(uint8_t reg);
void (*accm_int2_cb)(u8_t reg); void (*accm_int2_cb)(uint8_t reg);
process_event_t int1_event, int2_event; process_event_t int1_event, int2_event;
@ -119,8 +119,8 @@ PROCESS(accmeter_process, "Accelerometer process");
*/ */
void void
accm_write_reg(u8_t reg, u8_t val) { accm_write_reg(uint8_t reg, uint8_t val) {
u8_t tx_buf[] = {reg, val}; uint8_t tx_buf[] = {reg, val};
i2c_transmitinit(ADXL345_ADDR); i2c_transmitinit(ADXL345_ADDR);
while (i2c_busy()); 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. */ The data is then written from second byte and increasing. */
void void
accm_write_stream(u8_t len, u8_t *data) { accm_write_stream(uint8_t len, uint8_t *data) {
i2c_transmitinit(ADXL345_ADDR); i2c_transmitinit(ADXL345_ADDR);
while (i2c_busy()); while (i2c_busy());
PRINTFDEBUG("I2C Ready to TX(stream)\n"); 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 returns the value of the read register
*/ */
u8_t uint8_t
accm_read_reg(u8_t reg) { accm_read_reg(uint8_t reg) {
u8_t retVal = 0; uint8_t retVal = 0;
u8_t rtx = reg; uint8_t rtx = reg;
PRINTFDEBUG("READ_REG 0x%02X\n", reg); PRINTFDEBUG("READ_REG 0x%02X\n", reg);
/* transmit the register to read */ /* transmit the register to read */
@ -187,8 +187,8 @@ accm_read_reg(u8_t reg) {
*/ */
void void
accm_read_stream(u8_t reg, u8_t len, u8_t *whereto) { accm_read_stream(uint8_t reg, uint8_t len, uint8_t *whereto) {
u8_t rtx = reg; uint8_t rtx = reg;
PRINTFDEBUG("READ_STR %u B from 0x%02X\n", len, reg); PRINTFDEBUG("READ_STR %u B from 0x%02X\n", len, reg);
/* transmit the register to start reading from */ /* 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 int16_t
accm_read_axis(enum ADXL345_AXIS axis){ accm_read_axis(enum ADXL345_AXIS axis){
int16_t rd = 0; int16_t rd = 0;
u8_t tmp[2]; uint8_t tmp[2];
if(axis > Z_AXIS){ if(axis > Z_AXIS){
return 0; return 0;
} }
@ -234,13 +234,13 @@ accm_read_axis(enum ADXL345_AXIS axis){
*/ */
void void
accm_set_grange(u8_t grange){ accm_set_grange(uint8_t grange){
if(grange > ADXL345_RANGE_16G) { if(grange > ADXL345_RANGE_16G) {
// invalid g-range. // invalid g-range.
PRINTFDEBUG("ADXL grange invalid: %u\n", grange); PRINTFDEBUG("ADXL grange invalid: %u\n", grange);
return; return;
} }
u8_t tempreg = 0; uint8_t tempreg = 0;
/* preserve the previous contents of the register */ /* preserve the previous contents of the register */
tempreg = (accm_read_reg(ADXL345_DATA_FORMAT) & 0xFC); // zero out the last two bits (grange) tempreg = (accm_read_reg(ADXL345_DATA_FORMAT) & 0xFC); // zero out the last two bits (grange)

View file

@ -79,7 +79,7 @@ void accm_init(void);
reg register to write to reg register to write to
val value to write 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. /* Write several registers from a stream.
args: 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. 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 The data is then written from the second byte and increasing. The address byte
is not included in length len. */ 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. /* Read one register.
args: args:
reg what register to read reg what register to read
returns the value of the read register 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. /* Read several registers in a stream.
args: args:
@ -103,7 +103,7 @@ u8_t accm_read_reg(u8_t reg);
len number of bytes to read len number of bytes to read
whereto pointer to where the data is saved 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. /* 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 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: Example:
accm_set_grange(ADXL345_RANGE_4G); 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). /* 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. */ This must come after accm_init() as the registers will otherwise be overwritten. */
void accm_set_irq(uint8_t int1, uint8_t int2); void accm_set_irq(uint8_t int1, uint8_t int2);
/* Macros for setting the pointers to callback functions from the interrupts. /* 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 flag register from the ADXL345. That way, several interrupts can be mapped to
the same pin and be read from the */ the same pin and be read from the */
#define ACCM_REGISTER_INT1_CB(ptr) accm_int1_cb = ptr; #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 #define ADXL345_SRATE_0_10 0x00 // 0.10 Hz, when I2C data rate >= 100 kHz
/* Callback pointers for the interrupts */ /* Callback pointers for the interrupts */
extern void (*accm_int1_cb)(u8_t reg); extern void (*accm_int1_cb)(uint8_t reg);
extern void (*accm_int2_cb)(u8_t reg); extern void (*accm_int2_cb)(uint8_t reg);
/* Interrupt 1 and 2 events; ADXL345 signals interrupt on INT1 or INT2 pins, /* 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. */ ISR is invoked and polls the accelerometer process which invokes the callbacks. */

View file

@ -59,7 +59,7 @@ volatile unsigned int i; // volatile to prevent optimization
// unsigned char prescale => SCL clock adjustment // unsigned char prescale => SCL clock adjustment
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
i2c_receiveinit(u8_t slave_address) { i2c_receiveinit(uint8_t slave_address) {
UCB1CTL1 = UCSWRST; // Enable SW reset UCB1CTL1 = UCSWRST; // Enable SW reset
UCB1CTL0 = UCMST + UCMODE_3 + UCSYNC; // I2C Master, synchronous mode UCB1CTL0 = UCMST + UCMODE_3 + UCSYNC; // I2C Master, synchronous mode
UCB1CTL1 = UCSSEL_2 | UCSWRST; // Use SMCLK, keep SW reset 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 // unsigned char prescale => SCL clock adjustment
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void void
i2c_transmitinit(u8_t slave_address) { i2c_transmitinit(uint8_t slave_address) {
UCB1CTL1 |= UCSWRST; // Enable SW reset UCB1CTL1 |= UCSWRST; // Enable SW reset
UCB1CTL0 |= (UCMST | UCMODE_3 | UCSYNC); // I2C Master, synchronous mode UCB1CTL0 |= (UCMST | UCMODE_3 | UCSYNC); // I2C Master, synchronous mode
UCB1CTL1 = UCSSEL_2 + UCSWRST; // Use SMCLK, keep SW reset 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: unsigned char rx_buf => receive data buffer
// OUT: int n_received => number of bytes read // OUT: int n_received => number of bytes read
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
static volatile u8_t rx_byte_tot = 0; static volatile uint8_t rx_byte_tot = 0;
u8_t uint8_t
i2c_receive_n(u8_t byte_ctr, u8_t *rx_buf) { i2c_receive_n(uint8_t byte_ctr, uint8_t *rx_buf) {
rx_byte_tot = byte_ctr; rx_byte_tot = byte_ctr;
rx_byte_ctr = byte_ctr; rx_byte_ctr = byte_ctr;
@ -136,7 +136,7 @@ i2c_receive_n(u8_t byte_ctr, u8_t *rx_buf) {
return 0; return 0;
#else #else
u8_t n_received = 0; uint8_t n_received = 0;
PRINTFDEBUG(" RX Interrupts: NO \n"); 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. // This function is used to check if there is communication in progress.
// //
// OUT: unsigned char => 0: I2C bus is idle, // OUT: unsigned char => 0: I2C bus is idle,
// 1: communication is in progress // 1: communication is in progress
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
u8_t uint8_t
i2c_busy(void) { i2c_busy(void) {
return (UCB1STAT & UCBBUSY); return (UCB1STAT & UCBBUSY);
} }
@ -191,9 +191,9 @@ i2c_enable(void) {
// IN: unsigned char byte_ctr => number of bytes to be transmitted // 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] // 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 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_tot = byte_ctr;
tx_byte_ctr = byte_ctr; tx_byte_ctr = byte_ctr;
tx_buf_ptr = tx_buf; tx_buf_ptr = tx_buf;

View file

@ -45,13 +45,13 @@
void i2c_enable(void); void i2c_enable(void);
void i2c_receiveinit(u8_t slave_address); void i2c_receiveinit(uint8_t slave_address);
u8_t i2c_receive_n(u8_t byte_ctr, u8_t *rx_buf); uint8_t i2c_receive_n(uint8_t byte_ctr, uint8_t *rx_buf);
void i2c_transmitinit(u8_t slave_address); void i2c_transmitinit(uint8_t slave_address);
void i2c_transmit_n(u8_t byte_ctr, u8_t *tx_buf); 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? //XXX Should these defines be in the contiki-conf.h to make it more platform-independent?
#define I2C_PxDIR P5DIR #define I2C_PxDIR P5DIR

View file

@ -97,12 +97,12 @@ tmp102_init (void)
*/ */
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[1] = (uint8_t) (val >> 8);
tx_buf[2] = (u8_t) (val & 0x00FF); tx_buf[2] = (uint8_t) (val & 0x00FF);
i2c_transmitinit (TMP102_ADDR); i2c_transmitinit (TMP102_ADDR);
while (i2c_busy ()); while (i2c_busy ());
@ -117,15 +117,15 @@ tmp102_write_reg (u8_t reg, u16_t val)
/* Read register. /* Read register.
args: args:
reg what register to read 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 uint16_t
tmp102_read_reg (u8_t reg) tmp102_read_reg (uint8_t reg)
{ {
u8_t buf[] = { 0x00, 0x00 }; uint8_t buf[] = { 0x00, 0x00 };
u16_t retVal = 0; uint16_t retVal = 0;
u8_t rtx = reg; uint8_t rtx = reg;
PRINTFDEBUG ("READ_REG 0x%02X\n", reg); PRINTFDEBUG ("READ_REG 0x%02X\n", reg);
// transmit the register to read // transmit the register to read
@ -140,7 +140,7 @@ tmp102_read_reg (u8_t reg)
i2c_receive_n (2, &buf[0]); i2c_receive_n (2, &buf[0]);
while (i2c_busy ()); while (i2c_busy ());
retVal = (u16_t) (buf[0] << 8 | (buf[1])); retVal = (uint16_t) (buf[0] << 8 | (buf[1]));
return retVal; 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 to make an interpretation of these 12 or 13-bit data, depending on configuration
*/ */
u16_t uint16_t
tmp102_read_temp_raw (void) tmp102_read_temp_raw (void)
{ {
u16_t rd = 0; uint16_t rd = 0;
rd = tmp102_read_reg (TMP102_TEMP); rd = tmp102_read_reg (TMP102_TEMP);

View file

@ -53,19 +53,19 @@ void tmp102_init(void);
reg register to write to reg register to write to
val value to write 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. /* Read one register.
args: args:
reg what register to read reg what register to read
returns the value of the read register 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 /* Read temperature in raw format
no args needed 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. /* Read only integer part of the temperature in 1deg. precision.
no args needed no args needed