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

This commit is contained in:
Nicholas J Humfrey 2012-02-20 19:20:03 +00:00 committed by Mariano Alvira
parent efab964451
commit a561d20828
17 changed files with 66 additions and 66 deletions

View File

@ -64,7 +64,7 @@
#define DEBUG 0
#if DEBUG
#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(...)

View File

@ -95,7 +95,7 @@
#define DEBUG 0
#if DEBUG
#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(...)

View File

@ -12,7 +12,7 @@
#if DEBUG
#include <stdio.h>
#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(...)

View File

@ -138,7 +138,7 @@ PROCESS_THREAD(wget_process, ev, data)
}
/*---------------------------------------------------------------------------*/
void
webclient_datahandler(char *data, u16_t len)
webclient_datahandler(char *data, uint16_t len)
{
if(len == 0) {
#if STATS

View File

@ -176,10 +176,10 @@ make_neighbor(void *arg)
char ipaddr_str[41];
uip_ip6addr(&ipaddr, NET_ADDR_A, NET_ADDR_B, NET_ADDR_C, NET_ADDR_D,
(u16_t)(((u16_t)(n->addr.u8[0]^0x02))<<8 | (u16_t)n->addr.u8[1]),
((u16_t)(n->addr.u8[2]))<<8 | (u16_t)n->addr.u8[3],
(u16_t)(n->addr.u8[4])<<8 | n->addr.u8[5],
(u16_t)(n->addr.u8[6])<<8 | n->addr.u8[7]);
(uint16_t)(((uint16_t)(n->addr.u8[0]^0x02))<<8 | (uint16_t)n->addr.u8[1]),
((uint16_t)(n->addr.u8[2]))<<8 | (uint16_t)n->addr.u8[3],
(uint16_t)(n->addr.u8[4])<<8 | n->addr.u8[5],
(uint16_t)(n->addr.u8[6])<<8 | n->addr.u8[7]);
httpd_sprint_ip6(ipaddr, ipaddr_str);
return snprintf((char *)uip_appdata, uip_mss(),
@ -200,10 +200,10 @@ make_neighbor(void *arg)
*/
return snprintf((char *)uip_appdata, uip_mss(),
"<li><a id=node name='%x:%x:%x:%x'>%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X</a>\r\n",
(u16_t)(((u16_t)(n->addr.u8[0]^0x02))<<8 | (u16_t)n->addr.u8[1]),
((u16_t)(n->addr.u8[2]))<<8 | (u16_t)n->addr.u8[3],
(u16_t)(n->addr.u8[4])<<8 | n->addr.u8[5],
(u16_t)(n->addr.u8[6])<<8 | n->addr.u8[7],
(uint16_t)(((uint16_t)(n->addr.u8[0]^0x02))<<8 | (uint16_t)n->addr.u8[1]),
((uint16_t)(n->addr.u8[2]))<<8 | (uint16_t)n->addr.u8[3],
(uint16_t)(n->addr.u8[4])<<8 | n->addr.u8[5],
(uint16_t)(n->addr.u8[6])<<8 | n->addr.u8[7],
n->addr.u8[0],
n->addr.u8[1],
n->addr.u8[2],

View File

@ -41,14 +41,14 @@
#include "httpd-fsdata.c"
#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:
@ -70,7 +70,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 */
struct httpd_fsdata_file_noconst *f;
@ -98,7 +98,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;
}
@ -106,11 +106,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;

View File

@ -11,13 +11,13 @@
uip_buf_t uip_aligned_buf;
u16_t uip_len;
uint16_t uip_len;
struct uip_stats uip_stat;
uip_lladdr_t uip_lladdr;
static u8_t (* output)(uip_lladdr_t *);
static uint8_t (* output)(uip_lladdr_t *);
extern void mac_LowpanToEthernet(void);
void tcpip_input( void )
{
@ -25,18 +25,18 @@ void tcpip_input( void )
mac_LowpanToEthernet();
}
u8_t tcpip_output(uip_lladdr_t * lladdr){
uint8_t tcpip_output(uip_lladdr_t * lladdr){
if(output != NULL) {
return output(lladdr);
}
return 0;
}
//Called from sicslowpan.c
void tcpip_set_outputfunc(u8_t (* f)(uip_lladdr_t *)) {
void tcpip_set_outputfunc(uint8_t (* f)(uip_lladdr_t *)) {
output = f;
}
u16_t uip_htons(u16_t val) { return UIP_HTONS(val);}
uint16_t uip_htons(uint16_t val) { return UIP_HTONS(val);}
#if THEOLDWAY
@ -73,12 +73,12 @@ uip_ds6_set_addr_iid(uip_ipaddr_t * ipaddr, uip_lladdr_t * lladdr)
/********** UIP.c ****************/
static u16_t
chksum(u16_t sum, const u8_t *data, u16_t len)
static uint16_t
chksum(uint16_t sum, const uint8_t *data, uint16_t len)
{
u16_t t;
const u8_t *dataptr;
const u8_t *last_byte;
uint16_t t;
const uint8_t *dataptr;
const uint8_t *last_byte;
dataptr = data;
last_byte = data + len - 1;
@ -104,19 +104,19 @@ chksum(u16_t sum, const u8_t *data, u16_t len)
return sum;
}
static u16_t
upper_layer_chksum(u8_t proto)
static uint16_t
upper_layer_chksum(uint8_t proto)
{
u16_t upper_layer_len;
u16_t sum;
uint16_t upper_layer_len;
uint16_t sum;
upper_layer_len = (((u16_t)(UIP_IP_BUF->len[0]) << 8) + UIP_IP_BUF->len[1]) ;
upper_layer_len = (((uint16_t)(UIP_IP_BUF->len[0]) << 8) + UIP_IP_BUF->len[1]) ;
/* First sum pseudoheader. */
/* IP protocol and length fields. This addition cannot carry. */
sum = upper_layer_len + proto;
/* Sum IP source and destination addresses. */
sum = chksum(sum, (u8_t *)&UIP_IP_BUF->srcipaddr, 2 * sizeof(uip_ipaddr_t));
sum = chksum(sum, (uint8_t *)&UIP_IP_BUF->srcipaddr, 2 * sizeof(uip_ipaddr_t));
/* Sum TCP header and data. */
sum = chksum(sum, &uip_buf[UIP_IPH_LEN + UIP_LLH_LEN],
@ -126,7 +126,7 @@ upper_layer_chksum(u8_t proto)
}
/*---------------------------------------------------------------------------*/
u16_t
uint16_t
uip_icmp6chksum(void)
{
return upper_layer_chksum(UIP_PROTO_ICMP6);

View File

@ -10,7 +10,7 @@
#if DEBUG
#include <stdio.h>
#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(...)
@ -77,7 +77,7 @@ send_data(void)
static void
handle_incoming_data()
{
PRINTF("Incoming packet size: %u \n", (u16_t)uip_datalen());
PRINTF("Incoming packet size: %u \n", (uint16_t)uip_datalen());
if (init_buffer(COAP_DATA_BUFF_SIZE)) {
if (uip_newdata()) {
coap_packet_t* response = (coap_packet_t*)allocate_buffer(sizeof(coap_packet_t));

View File

@ -22,7 +22,7 @@
#if DEBUG
#include <stdio.h>
#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(...)

View File

@ -19,7 +19,7 @@ PROCESS_THREAD(clock_test_process, ev, data)
static struct etimer et;
static clock_time_t count, start_count, end_count, diff;
static unsigned long sec;
static u8_t i;
static uint8_t i;
PROCESS_BEGIN();
@ -56,7 +56,7 @@ PROCESS_THREAD(clock_test_process, ev, data)
etimer_reset(&et);
sec = clock_seconds();
printf("%u seconds\n", (u16_t) sec);
printf("%u seconds\n", (uint16_t) sec);
leds_toggle(LEDS_GREEN);
i++;

View File

@ -41,14 +41,14 @@
#include "httpd-fsdata.c"
#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:
@ -70,7 +70,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 */
struct httpd_fsdata_file_noconst *f;
@ -98,7 +98,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;
}
@ -106,11 +106,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;

View File

@ -436,7 +436,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
}
*/

View File

@ -40,7 +40,7 @@
#include "contiki-net.h"
void tapdev_init(void);
u8_t tapdev_send(void);
u16_t tapdev_poll(void);
uint8_t tapdev_send(void);
uint16_t tapdev_poll(void);
void tapdev_do_send(void);
#endif /* __TAPDEV_H__ */

View File

@ -75,10 +75,10 @@ static unsigned long lasttime;
#define IPBUF ((struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN])
static void do_send(void);
u8_t tapdev_send(void);
uint8_t tapdev_send(void);
u16_t
uint16_t
tapdev_poll(void)
{
fd_set fdset;
@ -174,8 +174,8 @@ do_send(void)
}
/*---------------------------------------------------------------------------*/
#define DEBUG_PRINTF(...) printf(__VA_ARGS__)
#define DEBUG_PRINT6ADDR(addr) DEBUG_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])
u8_t
#define DEBUG_PRINT6ADDR(addr) DEBUG_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])
uint8_t
tapdev_send(void)
{
struct uip_neighbor_addr *addr;

View File

@ -236,7 +236,7 @@ webclient_connected(void)
* has arrived.
*/
void
webclient_datahandler(char *data, u16_t len)
webclient_datahandler(char *data, uint16_t len)
{
static unsigned long dload_bytes;
int ret;

View File

@ -107,7 +107,7 @@ PROCESS_THREAD(wget_process, ev, data)
}
/*---------------------------------------------------------------------------*/
void
webclient_datahandler(char *data, u16_t len)
webclient_datahandler(char *data, uint16_t len)
{
if(len == 0) {
#if STATS

View File

@ -99,24 +99,24 @@ print_int(uint16_t reg){
/* accelerometer free fall detection callback */
void
accm_ff_cb(u8_t reg){
accm_ff_cb(uint8_t reg){
L_ON(LEDS_B);
process_post(&led_process, ledOff_event, NULL);
printf("~~[%u] Freefall detected! (0x%02X) -- ", ((u16_t) clock_time())/128, reg);
printf("~~[%u] Freefall detected! (0x%02X) -- ", ((uint16_t) clock_time())/128, reg);
print_int(reg);
}
/*---------------------------------------------------------------------------*/
/* accelerometer tap and double tap detection callback */
void
accm_tap_cb(u8_t reg){
accm_tap_cb(uint8_t reg){
process_post(&led_process, ledOff_event, NULL);
if(reg & ADXL345_INT_DOUBLETAP){
L_ON(LEDS_G);
printf("~~[%u] DoubleTap detected! (0x%02X) -- ", ((u16_t) clock_time())/128, reg);
printf("~~[%u] DoubleTap detected! (0x%02X) -- ", ((uint16_t) clock_time())/128, reg);
} else {
L_ON(LEDS_R);
printf("~~[%u] Tap detected! (0x%02X) -- ", ((u16_t) clock_time())/128, reg);
printf("~~[%u] Tap detected! (0x%02X) -- ", ((uint16_t) clock_time())/128, reg);
}
print_int(reg);
}
@ -145,11 +145,11 @@ PROCESS_THREAD(led_process, ev, data) {
printf("Port1: %s\n", char2bin(P1IN));
*/
/*
static u8_t b[9];
static uint8_t b[9];
static u8_t
*char2bin(u8_t x) {
u8_t z;
static uint8_t
*char2bin(uint8_t x) {
uint8_t z;
b[8] = '\0';
for (z = 0; z < 8; z++) {
b[7-z] = (x & (1 << z)) ? '1' : '0';