Converted u8_t to uint8_t and u16_t to uint16_t in the cpu directory.
This commit is contained in:
parent
372de7d08a
commit
1cda3da17e
|
@ -44,7 +44,7 @@
|
||||||
#if CTK_CONF_MOUSE_SUPPORT
|
#if CTK_CONF_MOUSE_SUPPORT
|
||||||
|
|
||||||
static struct mouse_pos pos;
|
static struct mouse_pos pos;
|
||||||
static u8_t okay;
|
static uint8_t okay;
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
|
|
|
@ -77,7 +77,7 @@ AUTOSTART_PROCESSES(&dhcp_process);
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
static char *
|
static char *
|
||||||
makebyte(u8_t byte, char *str)
|
makebyte(uint8_t byte, char *str)
|
||||||
{
|
{
|
||||||
if(byte >= 100) {
|
if(byte >= 100) {
|
||||||
*str++ = (byte / 100 ) % 10 + '0';
|
*str++ = (byte / 100 ) % 10 + '0';
|
||||||
|
|
|
@ -48,7 +48,7 @@ static char * CC_FASTCALL
|
||||||
ipaddrtoa(uip_ipaddr_t *ipaddr, char *buffer)
|
ipaddrtoa(uip_ipaddr_t *ipaddr, char *buffer)
|
||||||
{
|
{
|
||||||
char *ptr = buffer;
|
char *ptr = buffer;
|
||||||
u8_t i;
|
uint8_t i;
|
||||||
|
|
||||||
for(i = 0; i < 4; ++i) {
|
for(i = 0; i < 4; ++i) {
|
||||||
*ptr = '.';
|
*ptr = '.';
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
PROCESS(ethernet_process, "Ethernet driver");
|
PROCESS(ethernet_process, "Ethernet driver");
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
u8_t
|
uint8_t
|
||||||
ethernet_output(void)
|
ethernet_output(void)
|
||||||
{
|
{
|
||||||
uip_arp_out();
|
uip_arp_out();
|
||||||
|
|
|
@ -37,12 +37,12 @@
|
||||||
#include "contiki.h"
|
#include "contiki.h"
|
||||||
|
|
||||||
struct ethernet_config {
|
struct ethernet_config {
|
||||||
u16_t addr;
|
uint16_t addr;
|
||||||
char name[12+1];
|
char name[12+1];
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCESS_NAME(ethernet_process);
|
PROCESS_NAME(ethernet_process);
|
||||||
|
|
||||||
u8_t ethernet_output(void);
|
uint8_t ethernet_output(void);
|
||||||
|
|
||||||
#endif /* __ETHERNET_DRV_H__ */
|
#endif /* __ETHERNET_DRV_H__ */
|
||||||
|
|
|
@ -46,11 +46,11 @@
|
||||||
struct {
|
struct {
|
||||||
char signature[4];
|
char signature[4];
|
||||||
struct uip_eth_addr ethernet_address;
|
struct uip_eth_addr ethernet_address;
|
||||||
u8_t *buffer;
|
uint8_t *buffer;
|
||||||
u16_t buffer_size;
|
uint16_t buffer_size;
|
||||||
void __fastcall__ (* init)(u16_t reg);
|
void __fastcall__ (* init)(uint16_t reg);
|
||||||
u16_t (* poll)(void);
|
uint16_t (* poll)(void);
|
||||||
void __fastcall__ (* send)(u16_t len);
|
void __fastcall__ (* send)(uint16_t len);
|
||||||
void (* exit)(void);
|
void (* exit)(void);
|
||||||
} *module;
|
} *module;
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ ethernet_init(struct ethernet_config *config)
|
||||||
#ifndef ETHERNET
|
#ifndef ETHERNET
|
||||||
|
|
||||||
struct mod_ctrl module_control = {cfs_read};
|
struct mod_ctrl module_control = {cfs_read};
|
||||||
u8_t byte;
|
uint8_t byte;
|
||||||
|
|
||||||
module_control.callerdata = cfs_open(config->name, CFS_READ);
|
module_control.callerdata = cfs_open(config->name, CFS_READ);
|
||||||
if(module_control.callerdata < 0) {
|
if(module_control.callerdata < 0) {
|
||||||
|
@ -103,7 +103,7 @@ ethernet_init(struct ethernet_config *config)
|
||||||
uip_setethaddr(module->ethernet_address);
|
uip_setethaddr(module->ethernet_address);
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
u16_t
|
uint16_t
|
||||||
ethernet_poll(void)
|
ethernet_poll(void)
|
||||||
{
|
{
|
||||||
return module->poll();
|
return module->poll();
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#define __ETHERNET_H__
|
#define __ETHERNET_H__
|
||||||
|
|
||||||
void CC_FASTCALL ethernet_init(struct ethernet_config *config);
|
void CC_FASTCALL ethernet_init(struct ethernet_config *config);
|
||||||
u16_t ethernet_poll(void);
|
uint16_t ethernet_poll(void);
|
||||||
void ethernet_send(void);
|
void ethernet_send(void);
|
||||||
void ethernet_exit(void);
|
void ethernet_exit(void);
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
#pragma optimize(push, off)
|
#pragma optimize(push, off)
|
||||||
void
|
void
|
||||||
uip_add32(u8_t *op32, u16_t op16)
|
uip_add32(uint8_t *op32, uint16_t op16)
|
||||||
{
|
{
|
||||||
asm("ldy #3");
|
asm("ldy #3");
|
||||||
asm("jsr ldaxysp");
|
asm("jsr ldaxysp");
|
||||||
|
@ -71,12 +71,12 @@ uip_add32(u8_t *op32, u16_t op16)
|
||||||
}
|
}
|
||||||
#pragma optimize(pop)
|
#pragma optimize(pop)
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
static u16_t chksum_ptr, chksum_len, chksum_tmp;
|
static uint16_t chksum_ptr, chksum_len, chksum_tmp;
|
||||||
static u8_t chksum_protocol;
|
static uint8_t chksum_protocol;
|
||||||
static u16_t chksum(void);
|
static uint16_t chksum(void);
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
#pragma optimize(push, off)
|
#pragma optimize(push, off)
|
||||||
u16_t
|
uint16_t
|
||||||
chksum(void) {
|
chksum(void) {
|
||||||
|
|
||||||
asm("lda #0");
|
asm("lda #0");
|
||||||
|
@ -172,14 +172,14 @@ chksum(void) {
|
||||||
}
|
}
|
||||||
#pragma optimize(pop)
|
#pragma optimize(pop)
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
u16_t
|
uint16_t
|
||||||
uip_chksum(u16_t *buf, u16_t len)
|
uip_chksum(uint16_t *buf, uint16_t len)
|
||||||
{
|
{
|
||||||
/* unsigned long sum;
|
/* unsigned long sum;
|
||||||
|
|
||||||
sum = 0;
|
sum = 0;
|
||||||
|
|
||||||
chksum_ptr = (u16_t)buf;
|
chksum_ptr = (uint16_t)buf;
|
||||||
while(len >= 256) {
|
while(len >= 256) {
|
||||||
chksum_len = 256;
|
chksum_len = 256;
|
||||||
sum += chksum();
|
sum += chksum();
|
||||||
|
@ -199,28 +199,28 @@ uip_chksum(u16_t *buf, u16_t len)
|
||||||
return sum;*/
|
return sum;*/
|
||||||
|
|
||||||
chksum_len = len;
|
chksum_len = len;
|
||||||
chksum_ptr = (u16_t)buf;
|
chksum_ptr = (uint16_t)buf;
|
||||||
return chksum();
|
return chksum();
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
u16_t
|
uint16_t
|
||||||
uip_ipchksum(void)
|
uip_ipchksum(void)
|
||||||
{
|
{
|
||||||
chksum_ptr = (u16_t)uip_buf + UIP_LLH_LEN;
|
chksum_ptr = (uint16_t)uip_buf + UIP_LLH_LEN;
|
||||||
chksum_len = UIP_IPH_LEN;
|
chksum_len = UIP_IPH_LEN;
|
||||||
return chksum();
|
return chksum();
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
#pragma optimize(push, off)
|
#pragma optimize(push, off)
|
||||||
static u16_t
|
static uint16_t
|
||||||
transport_chksum(u8_t protocol)
|
transport_chksum(uint8_t protocol)
|
||||||
{
|
{
|
||||||
chksum_protocol = protocol;
|
chksum_protocol = protocol;
|
||||||
chksum_ptr = (u16_t)&uip_buf[UIP_LLH_LEN + UIP_IPH_LEN];
|
chksum_ptr = (uint16_t)&uip_buf[UIP_LLH_LEN + UIP_IPH_LEN];
|
||||||
chksum_len = UIP_TCPH_LEN;
|
chksum_len = UIP_TCPH_LEN;
|
||||||
chksum_tmp = chksum();
|
chksum_tmp = chksum();
|
||||||
|
|
||||||
chksum_ptr = (u16_t)uip_appdata;
|
chksum_ptr = (uint16_t)uip_appdata;
|
||||||
asm("lda _uip_aligned_buf+3+%b", UIP_LLH_LEN);
|
asm("lda _uip_aligned_buf+3+%b", UIP_LLH_LEN);
|
||||||
asm("sec");
|
asm("sec");
|
||||||
asm("sbc #%b", UIP_IPTCPH_LEN);
|
asm("sbc #%b", UIP_IPTCPH_LEN);
|
||||||
|
@ -313,16 +313,16 @@ transport_chksum(u8_t protocol)
|
||||||
#pragma optimize(pop)
|
#pragma optimize(pop)
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
u16_t
|
uint16_t
|
||||||
uip_tcpchksum(void)
|
uip_tcpchksum(void)
|
||||||
{
|
{
|
||||||
return transport_chksum(IP_PROTO_TCP);
|
return transport_chksum(IP_PROTO_TCP);
|
||||||
#if 0
|
#if 0
|
||||||
chksum_ptr = (u16_t)&uip_buf[UIP_LLH_LEN + UIP_IPH_LEN];
|
chksum_ptr = (uint16_t)&uip_buf[UIP_LLH_LEN + UIP_IPH_LEN];
|
||||||
chksum_len = UIP_TCPH_LEN;
|
chksum_len = UIP_TCPH_LEN;
|
||||||
chksum_tmp = chksum();
|
chksum_tmp = chksum();
|
||||||
|
|
||||||
chksum_ptr = (u16_t)uip_appdata;
|
chksum_ptr = (uint16_t)uip_appdata;
|
||||||
asm("lda _uip_buf+3+%b", UIP_LLH_LEN);
|
asm("lda _uip_buf+3+%b", UIP_LLH_LEN);
|
||||||
asm("sec");
|
asm("sec");
|
||||||
asm("sbc #%b", UIP_IPTCPH_LEN);
|
asm("sbc #%b", UIP_IPTCPH_LEN);
|
||||||
|
@ -416,16 +416,16 @@ uip_tcpchksum(void)
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
#if UIP_UDP_CHECKSUMS
|
#if UIP_UDP_CHECKSUMS
|
||||||
u16_t
|
uint16_t
|
||||||
uip_udpchksum(void)
|
uip_udpchksum(void)
|
||||||
{
|
{
|
||||||
return transport_chksum(IP_PROTO_UDP);
|
return transport_chksum(IP_PROTO_UDP);
|
||||||
#if 0
|
#if 0
|
||||||
chksum_ptr = (u16_t)&uip_buf[20 + UIP_LLH_LEN];
|
chksum_ptr = (uint16_t)&uip_buf[20 + UIP_LLH_LEN];
|
||||||
chksum_len = 20;
|
chksum_len = 20;
|
||||||
chksum_tmp = chksum();
|
chksum_tmp = chksum();
|
||||||
|
|
||||||
chksum_ptr = (u16_t)uip_appdata;
|
chksum_ptr = (uint16_t)uip_appdata;
|
||||||
asm("lda _uip_buf+3+%b", UIP_LLH_LEN);
|
asm("lda _uip_buf+3+%b", UIP_LLH_LEN);
|
||||||
asm("sec");
|
asm("sec");
|
||||||
asm("sbc #40");
|
asm("sbc #40");
|
||||||
|
|
|
@ -106,18 +106,18 @@ static const char *err_msgs[] =
|
||||||
#define UDPDATASIZE 32
|
#define UDPDATASIZE 32
|
||||||
|
|
||||||
struct codeprop_udphdr {
|
struct codeprop_udphdr {
|
||||||
u16_t id;
|
uint16_t id;
|
||||||
u16_t type;
|
uint16_t type;
|
||||||
#define TYPE_DATA 0x0001
|
#define TYPE_DATA 0x0001
|
||||||
#define TYPE_NACK 0x0002
|
#define TYPE_NACK 0x0002
|
||||||
u16_t addr;
|
uint16_t addr;
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
u8_t data[UDPDATASIZE];
|
uint8_t data[UDPDATASIZE];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct codeprop_tcphdr {
|
struct codeprop_tcphdr {
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
u16_t pad;
|
uint16_t pad;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void uipcall(void *state);
|
static void uipcall(void *state);
|
||||||
|
@ -125,19 +125,19 @@ static void uipcall(void *state);
|
||||||
PROCESS(codeprop_process, "Code propagator");
|
PROCESS(codeprop_process, "Code propagator");
|
||||||
|
|
||||||
struct codeprop_state {
|
struct codeprop_state {
|
||||||
u8_t state;
|
uint8_t state;
|
||||||
#define STATE_NONE 0
|
#define STATE_NONE 0
|
||||||
#define STATE_RECEIVING_TCPDATA 1
|
#define STATE_RECEIVING_TCPDATA 1
|
||||||
#define STATE_RECEIVING_UDPDATA 2
|
#define STATE_RECEIVING_UDPDATA 2
|
||||||
#define STATE_SENDING_UDPDATA 3
|
#define STATE_SENDING_UDPDATA 3
|
||||||
u16_t count;
|
uint16_t count;
|
||||||
u16_t addr;
|
uint16_t addr;
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
u16_t id;
|
uint16_t id;
|
||||||
struct etimer sendtimer;
|
struct etimer sendtimer;
|
||||||
struct timer nacktimer, timer, starttimer;
|
struct timer nacktimer, timer, starttimer;
|
||||||
u8_t received;
|
uint8_t received;
|
||||||
u8_t send_counter;
|
uint8_t send_counter;
|
||||||
struct pt tcpthread_pt;
|
struct pt tcpthread_pt;
|
||||||
struct pt udpthread_pt;
|
struct pt udpthread_pt;
|
||||||
struct pt recv_udpthread_pt;
|
struct pt recv_udpthread_pt;
|
||||||
|
@ -200,10 +200,10 @@ PROCESS_THREAD(codeprop_process, ev, data)
|
||||||
PROCESS_END();
|
PROCESS_END();
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
static u16_t
|
static uint16_t
|
||||||
send_udpdata(struct codeprop_udphdr *uh)
|
send_udpdata(struct codeprop_udphdr *uh)
|
||||||
{
|
{
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
|
|
||||||
uh->type = UIP_HTONS(TYPE_DATA);
|
uh->type = UIP_HTONS(TYPE_DATA);
|
||||||
uh->addr = uip_htons(s.addr);
|
uh->addr = uip_htons(s.addr);
|
||||||
|
|
|
@ -46,7 +46,7 @@ init_recv_buffer()
|
||||||
recv_buffer.flags = USB_BUFFER_SHORT_END | USB_BUFFER_NOTIFY;
|
recv_buffer.flags = USB_BUFFER_SHORT_END | USB_BUFFER_NOTIFY;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8_t
|
uint8_t
|
||||||
usbeth_send(void)
|
usbeth_send(void)
|
||||||
{
|
{
|
||||||
if ((xmit_buffer[0].flags & USB_BUFFER_SUBMITTED)) return UIP_FW_DROPPED;
|
if ((xmit_buffer[0].flags & USB_BUFFER_SUBMITTED)) return UIP_FW_DROPPED;
|
||||||
|
|
|
@ -315,7 +315,7 @@ static uip_ipaddr_t bcast_addr;
|
||||||
static void
|
static void
|
||||||
send_offer(struct uip_udp_conn *conn, struct dhcps_client_lease *lease)
|
send_offer(struct uip_udp_conn *conn, struct dhcps_client_lease *lease)
|
||||||
{
|
{
|
||||||
u8_t *end;
|
uint8_t *end;
|
||||||
struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
|
struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
|
||||||
|
|
||||||
create_msg(m);
|
create_msg(m);
|
||||||
|
@ -327,13 +327,13 @@ send_offer(struct uip_udp_conn *conn, struct dhcps_client_lease *lease)
|
||||||
end = add_config(end);
|
end = add_config(end);
|
||||||
end = add_end(end);
|
end = add_end(end);
|
||||||
uip_ipaddr_copy(&conn->ripaddr, &bcast_addr);
|
uip_ipaddr_copy(&conn->ripaddr, &bcast_addr);
|
||||||
uip_send(uip_appdata, (int)(end - (u8_t *)uip_appdata));
|
uip_send(uip_appdata, (int)(end - (uint8_t *)uip_appdata));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
send_ack(struct uip_udp_conn *conn, struct dhcps_client_lease *lease)
|
send_ack(struct uip_udp_conn *conn, struct dhcps_client_lease *lease)
|
||||||
{
|
{
|
||||||
u8_t *end;
|
uint8_t *end;
|
||||||
uip_ipaddr_t ciaddr;
|
uip_ipaddr_t ciaddr;
|
||||||
struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
|
struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
|
||||||
|
|
||||||
|
@ -347,13 +347,13 @@ send_ack(struct uip_udp_conn *conn, struct dhcps_client_lease *lease)
|
||||||
end = add_end(end);
|
end = add_end(end);
|
||||||
memcpy(&ciaddr, &lease->ipaddr,4);
|
memcpy(&ciaddr, &lease->ipaddr,4);
|
||||||
uip_ipaddr_copy(&conn->ripaddr, &bcast_addr);
|
uip_ipaddr_copy(&conn->ripaddr, &bcast_addr);
|
||||||
uip_send(uip_appdata, (int)(end - (u8_t *)uip_appdata));
|
uip_send(uip_appdata, (int)(end - (uint8_t *)uip_appdata));
|
||||||
printf("ACK\n");
|
printf("ACK\n");
|
||||||
}
|
}
|
||||||
static void
|
static void
|
||||||
send_nack(struct uip_udp_conn *conn)
|
send_nack(struct uip_udp_conn *conn)
|
||||||
{
|
{
|
||||||
u8_t *end;
|
uint8_t *end;
|
||||||
struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
|
struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
|
||||||
|
|
||||||
create_msg(m);
|
create_msg(m);
|
||||||
|
@ -364,7 +364,7 @@ send_nack(struct uip_udp_conn *conn)
|
||||||
end = add_end(end);
|
end = add_end(end);
|
||||||
|
|
||||||
uip_ipaddr_copy(&conn->ripaddr, &bcast_addr);
|
uip_ipaddr_copy(&conn->ripaddr, &bcast_addr);
|
||||||
uip_send(uip_appdata, (int)(end - (u8_t *)uip_appdata));
|
uip_send(uip_appdata, (int)(end - (uint8_t *)uip_appdata));
|
||||||
printf("NACK\n");
|
printf("NACK\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -476,17 +476,17 @@
|
||||||
|
|
||||||
#define MSBV(bit) (1 << ((bit) - 8))
|
#define MSBV(bit) (1 << ((bit) - 8))
|
||||||
|
|
||||||
#define nic_outlb(addr, val) (*(volatile u8_t *)(addr) = (val))
|
#define nic_outlb(addr, val) (*(volatile uint8_t *)(addr) = (val))
|
||||||
#define nic_outhb(addr, val) (*(volatile u8_t *)((addr) + 1) = (val))
|
#define nic_outhb(addr, val) (*(volatile uint8_t *)((addr) + 1) = (val))
|
||||||
#define nic_outwx(addr, val) (*(volatile u16_t *)(addr) = (val))
|
#define nic_outwx(addr, val) (*(volatile uint16_t *)(addr) = (val))
|
||||||
#define nic_outw(addr, val) { \
|
#define nic_outw(addr, val) { \
|
||||||
*(volatile u8_t *)(addr) = (u8_t)(val); \
|
*(volatile uint8_t *)(addr) = (uint8_t)(val); \
|
||||||
*((volatile u8_t *)(addr) + 1) = (u8_t)((val) >> 8); \
|
*((volatile uint8_t *)(addr) + 1) = (uint8_t)((val) >> 8); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define nic_inlb(addr) (*(volatile u8_t *)(addr))
|
#define nic_inlb(addr) (*(volatile uint8_t *)(addr))
|
||||||
#define nic_inhb(addr) (*(volatile u8_t *)((addr) + 1))
|
#define nic_inhb(addr) (*(volatile uint8_t *)((addr) + 1))
|
||||||
#define nic_inw(addr) (*(volatile u16_t *)(addr))
|
#define nic_inw(addr) (*(volatile uint16_t *)(addr))
|
||||||
|
|
||||||
#define nic_bs(bank) nic_outlb(NIC_BSR, bank)
|
#define nic_bs(bank) nic_outlb(NIC_BSR, bank)
|
||||||
|
|
||||||
|
@ -513,11 +513,11 @@
|
||||||
*
|
*
|
||||||
* \return Contents of the PHY interface rgister.
|
* \return Contents of the PHY interface rgister.
|
||||||
*/
|
*/
|
||||||
static u8_t NicPhyRegSelect(u8_t reg, u8_t we)
|
static uint8_t NicPhyRegSelect(uint8_t reg, uint8_t we)
|
||||||
{
|
{
|
||||||
u8_t rs;
|
uint8_t rs;
|
||||||
u8_t msk;
|
uint8_t msk;
|
||||||
u8_t i;
|
uint8_t i;
|
||||||
|
|
||||||
nic_bs(3);
|
nic_bs(3);
|
||||||
rs = (nic_inlb(NIC_MGMT) & ~(MGMT_MCLK | MGMT_MDO)) | MGMT_MDOE;
|
rs = (nic_inlb(NIC_MGMT) & ~(MGMT_MCLK | MGMT_MDO)) | MGMT_MDOE;
|
||||||
|
@ -577,11 +577,11 @@ static u8_t NicPhyRegSelect(u8_t reg, u8_t we)
|
||||||
*
|
*
|
||||||
* \return Contents of the specified register.
|
* \return Contents of the specified register.
|
||||||
*/
|
*/
|
||||||
static u16_t NicPhyRead(u8_t reg)
|
static uint16_t NicPhyRead(uint8_t reg)
|
||||||
{
|
{
|
||||||
u16_t rc = 0;
|
uint16_t rc = 0;
|
||||||
u8_t rs;
|
uint8_t rs;
|
||||||
u8_t i;
|
uint8_t i;
|
||||||
|
|
||||||
/* Select register for reading. */
|
/* Select register for reading. */
|
||||||
rs = NicPhyRegSelect(reg, 0);
|
rs = NicPhyRegSelect(reg, 0);
|
||||||
|
@ -613,10 +613,10 @@ static u16_t NicPhyRead(u8_t reg)
|
||||||
* \param reg PHY register number.
|
* \param reg PHY register number.
|
||||||
* \param val Value to write.
|
* \param val Value to write.
|
||||||
*/
|
*/
|
||||||
static void NicPhyWrite(u8_t reg, u16_t val)
|
static void NicPhyWrite(uint8_t reg, uint16_t val)
|
||||||
{
|
{
|
||||||
u16_t msk;
|
uint16_t msk;
|
||||||
u8_t rs;
|
uint8_t rs;
|
||||||
|
|
||||||
/* Select register for writing. */
|
/* Select register for writing. */
|
||||||
rs = NicPhyRegSelect(reg, 1);
|
rs = NicPhyRegSelect(reg, 1);
|
||||||
|
@ -649,10 +649,10 @@ static void NicPhyWrite(u8_t reg, u16_t val)
|
||||||
*/
|
*/
|
||||||
static int NicPhyConfig(void)
|
static int NicPhyConfig(void)
|
||||||
{
|
{
|
||||||
u16_t phy_sor;
|
uint16_t phy_sor;
|
||||||
u16_t phy_sr;
|
uint16_t phy_sr;
|
||||||
u16_t phy_to;
|
uint16_t phy_to;
|
||||||
u16_t mode;
|
uint16_t mode;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reset the PHY and wait until this self clearing bit
|
* Reset the PHY and wait until this self clearing bit
|
||||||
|
@ -739,7 +739,7 @@ static int NicPhyConfig(void)
|
||||||
*
|
*
|
||||||
* \return 0 on success or -1 on timeout.
|
* \return 0 on success or -1 on timeout.
|
||||||
*/
|
*/
|
||||||
static INLINE int NicMmuWait(u16_t tmo)
|
static INLINE int NicMmuWait(uint16_t tmo)
|
||||||
{
|
{
|
||||||
while (tmo--) {
|
while (tmo--) {
|
||||||
if ((nic_inlb(NIC_MMUCR) & MMUCR_BUSY) == 0)
|
if ((nic_inlb(NIC_MMUCR) & MMUCR_BUSY) == 0)
|
||||||
|
@ -803,9 +803,9 @@ static int NicReset(void)
|
||||||
*
|
*
|
||||||
* \param mac Six byte unique MAC address.
|
* \param mac Six byte unique MAC address.
|
||||||
*/
|
*/
|
||||||
static int NicStart(CONST u8_t * mac)
|
static int NicStart(CONST uint8_t * mac)
|
||||||
{
|
{
|
||||||
u8_t i;
|
uint8_t i;
|
||||||
|
|
||||||
if (NicReset())
|
if (NicReset())
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -843,8 +843,8 @@ static int NicStart(CONST u8_t * mac)
|
||||||
#if 0
|
#if 0
|
||||||
static void NicInterrupt(void *arg)
|
static void NicInterrupt(void *arg)
|
||||||
{
|
{
|
||||||
u8_t isr;
|
uint8_t isr;
|
||||||
u8_t imr;
|
uint8_t imr;
|
||||||
NICINFO *ni = (NICINFO *) ((NUTDEVICE *) arg)->dev_dcb;
|
NICINFO *ni = (NICINFO *) ((NUTDEVICE *) arg)->dev_dcb;
|
||||||
|
|
||||||
ni->ni_interrupts++;
|
ni->ni_interrupts++;
|
||||||
|
@ -912,11 +912,11 @@ static void NicInterrupt(void *arg)
|
||||||
/*
|
/*
|
||||||
* Write data block to the NIC.
|
* Write data block to the NIC.
|
||||||
*/
|
*/
|
||||||
static void NicWrite(u8_t * buf, u16_t len)
|
static void NicWrite(uint8_t * buf, uint16_t len)
|
||||||
{
|
{
|
||||||
register u16_t l = len - 1;
|
register uint16_t l = len - 1;
|
||||||
register u8_t ih = (u16_t) l >> 8;
|
register uint8_t ih = (uint16_t) l >> 8;
|
||||||
register u8_t il = (u8_t) l;
|
register uint8_t il = (uint8_t) l;
|
||||||
|
|
||||||
if (!len)
|
if (!len)
|
||||||
return;
|
return;
|
||||||
|
@ -931,11 +931,11 @@ static void NicWrite(u8_t * buf, u16_t len)
|
||||||
/*
|
/*
|
||||||
* Read data block from the NIC.
|
* Read data block from the NIC.
|
||||||
*/
|
*/
|
||||||
static void NicRead(u8_t * buf, u16_t len)
|
static void NicRead(uint8_t * buf, uint16_t len)
|
||||||
{
|
{
|
||||||
register u16_t l = len - 1;
|
register uint16_t l = len - 1;
|
||||||
register u8_t ih = (u16_t) l >> 8;
|
register uint8_t ih = (uint16_t) l >> 8;
|
||||||
register u8_t il = (u8_t) l;
|
register uint8_t il = (uint8_t) l;
|
||||||
|
|
||||||
if (!len)
|
if (!len)
|
||||||
return;
|
return;
|
||||||
|
@ -960,9 +960,9 @@ static void NicRead(u8_t * buf, u16_t len)
|
||||||
static NETBUF *NicGetPacket(void)
|
static NETBUF *NicGetPacket(void)
|
||||||
{
|
{
|
||||||
NETBUF *nb = 0;
|
NETBUF *nb = 0;
|
||||||
//u8_t *buf;
|
//uint8_t *buf;
|
||||||
u16_t fsw;
|
uint16_t fsw;
|
||||||
u16_t fbc;
|
uint16_t fbc;
|
||||||
|
|
||||||
/* Check the fifo empty bit. If it is set, then there is
|
/* Check the fifo empty bit. If it is set, then there is
|
||||||
nothing in the receiver fifo. */
|
nothing in the receiver fifo. */
|
||||||
|
@ -1028,9 +1028,9 @@ static NETBUF *NicGetPacket(void)
|
||||||
#if 0
|
#if 0
|
||||||
static int NicPutPacket(NETBUF * nb)
|
static int NicPutPacket(NETBUF * nb)
|
||||||
{
|
{
|
||||||
u16_t sz;
|
uint16_t sz;
|
||||||
u8_t odd = 0;
|
uint8_t odd = 0;
|
||||||
u8_t imsk;
|
uint8_t imsk;
|
||||||
|
|
||||||
//printf("[P]");
|
//printf("[P]");
|
||||||
/*
|
/*
|
||||||
|
@ -1130,7 +1130,7 @@ PROCESS_THREAD(lanc111_process, ev, data)
|
||||||
IFNET *ifn;
|
IFNET *ifn;
|
||||||
NICINFO *ni;
|
NICINFO *ni;
|
||||||
NETBUF *nb;*/
|
NETBUF *nb;*/
|
||||||
u8_t imsk;
|
uint8_t imsk;
|
||||||
static struct etimer et;
|
static struct etimer et;
|
||||||
|
|
||||||
/* dev = arg;
|
/* dev = arg;
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
PROCESS(rtl8019_process, "RTL8019 driver");
|
PROCESS(rtl8019_process, "RTL8019 driver");
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
u8_t
|
uint8_t
|
||||||
rtl8019_output(void)
|
rtl8019_output(void)
|
||||||
{
|
{
|
||||||
uip_arp_out();
|
uip_arp_out();
|
||||||
|
|
|
@ -41,6 +41,6 @@
|
||||||
|
|
||||||
PROCESS_NAME(rtl8019_process);
|
PROCESS_NAME(rtl8019_process);
|
||||||
|
|
||||||
u8_t rtl8019_output(void);
|
uint8_t rtl8019_output(void);
|
||||||
|
|
||||||
#endif /* __RTL8019_DRV_H__ */
|
#endif /* __RTL8019_DRV_H__ */
|
||||||
|
|
|
@ -73,7 +73,7 @@ FDEV_SETUP_STREAM(slip_putchar, NULL, _FDEV_SETUP_WRITE);
|
||||||
void
|
void
|
||||||
slip_arch_init(unsigned long ubr)
|
slip_arch_init(unsigned long ubr)
|
||||||
{
|
{
|
||||||
u8_t dummy;
|
uint8_t dummy;
|
||||||
spl_t s = splhigh();
|
spl_t s = splhigh();
|
||||||
|
|
||||||
UBRR1L = ubr;
|
UBRR1L = ubr;
|
||||||
|
|
|
@ -47,7 +47,7 @@ void
|
||||||
mtarch_start(struct mtarch_thread *t,
|
mtarch_start(struct mtarch_thread *t,
|
||||||
void (*function)(void *), void *data)
|
void (*function)(void *), void *data)
|
||||||
{
|
{
|
||||||
u16_t i;
|
uint16_t i;
|
||||||
|
|
||||||
for(i = 0; i < MTARCH_STACKSIZE; i++) {
|
for(i = 0; i < MTARCH_STACKSIZE; i++) {
|
||||||
t->stack[i] = i;
|
t->stack[i] = i;
|
||||||
|
@ -57,15 +57,15 @@ mtarch_start(struct mtarch_thread *t,
|
||||||
|
|
||||||
|
|
||||||
/* A parameter for method for thread function. */
|
/* A parameter for method for thread function. */
|
||||||
*t->sp = (u16_t)data;
|
*t->sp = (uint16_t)data;
|
||||||
--t->sp;
|
--t->sp;
|
||||||
|
|
||||||
/* This will be a return address of thread function. */
|
/* This will be a return address of thread function. */
|
||||||
*t->sp = (u16_t)mt_exit;
|
*t->sp = (uint16_t)mt_exit;
|
||||||
--t->sp;
|
--t->sp;
|
||||||
|
|
||||||
/* The thread function, is used as a return address of mtarch_switch. */
|
/* The thread function, is used as a return address of mtarch_switch. */
|
||||||
*t->sp = (u16_t)function;
|
*t->sp = (uint16_t)function;
|
||||||
--t->sp;
|
--t->sp;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -82,7 +82,7 @@ mtarch_start(struct mtarch_thread *t,
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
static struct mtarch_thread *running_thread;
|
static struct mtarch_thread *running_thread;
|
||||||
static u16_t *sptmp;
|
static uint16_t *sptmp;
|
||||||
static void
|
static void
|
||||||
mtarch_switch()
|
mtarch_switch()
|
||||||
{
|
{
|
||||||
|
@ -180,7 +180,7 @@ mtarch_pstart()
|
||||||
int
|
int
|
||||||
mtarch_stack_usage(struct mtarch_thread *t)
|
mtarch_stack_usage(struct mtarch_thread *t)
|
||||||
{
|
{
|
||||||
u16_t i;
|
uint16_t i;
|
||||||
for (i = 0; i < MTARCH_STACKSIZE; i++) {
|
for (i = 0; i < MTARCH_STACKSIZE; i++) {
|
||||||
if (t->stack[i] != i) {
|
if (t->stack[i] != i) {
|
||||||
return MTARCH_STACKSIZE - i;
|
return MTARCH_STACKSIZE - i;
|
||||||
|
|
|
@ -48,12 +48,12 @@ struct mtarch_thread {
|
||||||
* On top of the mtarch_thread must be the address for the stack pointer.
|
* On top of the mtarch_thread must be the address for the stack pointer.
|
||||||
* See details at mtarch_switch in mtarch.c
|
* See details at mtarch_switch in mtarch.c
|
||||||
*/
|
*/
|
||||||
u16_t *sp;
|
uint16_t *sp;
|
||||||
/*
|
/*
|
||||||
* Stack is 2-byte wide, so please note that you need 2 * MTARCH_STACKSIZE
|
* Stack is 2-byte wide, so please note that you need 2 * MTARCH_STACKSIZE
|
||||||
* bytes for the stack area for each thread.
|
* bytes for the stack area for each thread.
|
||||||
*/
|
*/
|
||||||
u16_t stack[MTARCH_STACKSIZE];
|
uint16_t stack[MTARCH_STACKSIZE];
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
.area _CODE
|
.area _CODE
|
||||||
|
|
||||||
;; ---------------------------------
|
;; ---------------------------------
|
||||||
;; void uip_add32(u8_t *op32, u16_t op16);
|
;; void uip_add32(uint8_t *op32, uint16_t op16);
|
||||||
;; Stack; retl reth op32l op32h op16l op16h
|
;; Stack; retl reth op32l op32h op16l op16h
|
||||||
;; ABCDEHL____
|
;; ABCDEHL____
|
||||||
;; return void
|
;; return void
|
||||||
|
@ -102,7 +102,7 @@ _uip_add32_nocarry0:
|
||||||
_uip_add32_end::
|
_uip_add32_end::
|
||||||
|
|
||||||
;; ---------------------------------
|
;; ---------------------------------
|
||||||
;; 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)
|
||||||
;; Stack; retl reth suml sumh datal datah lenl lenh
|
;; Stack; retl reth suml sumh datal datah lenl lenh
|
||||||
;; ABCDEHL____
|
;; ABCDEHL____
|
||||||
;; return HL
|
;; return HL
|
||||||
|
@ -188,11 +188,11 @@ _uip_arch_chksum_loop_exit:
|
||||||
_uip_arch_chksum_end::
|
_uip_arch_chksum_end::
|
||||||
|
|
||||||
;; ---------------------------------
|
;; ---------------------------------
|
||||||
;; u16_t uip_chksum(void);
|
;; uint16_t uip_chksum(void);
|
||||||
;; Stack; retl reth datal datah lenl lenh
|
;; Stack; retl reth datal datah lenl lenh
|
||||||
;; ABCDEHL____
|
;; ABCDEHL____
|
||||||
;; return HL
|
;; return HL
|
||||||
;; return htons(chksum(0, (u8_t *)data, len));
|
;; return htons(chksum(0, (uint8_t *)data, len));
|
||||||
;; ---------------------------------
|
;; ---------------------------------
|
||||||
_uip_chksum_start::
|
_uip_chksum_start::
|
||||||
_uip_chksum:
|
_uip_chksum:
|
||||||
|
|
|
@ -41,15 +41,15 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include "uip_arch.h"
|
#include "uip_arch.h"
|
||||||
|
|
||||||
static const u16_t sizeof_uip_ipaddr_t = sizeof(uip_ipaddr_t);
|
static const uint16_t sizeof_uip_ipaddr_t = sizeof(uip_ipaddr_t);
|
||||||
static const u16_t offset_tcpip_hdr_len = offsetof(struct uip_tcpip_hdr, len);
|
static const uint16_t offset_tcpip_hdr_len = offsetof(struct uip_tcpip_hdr, len);
|
||||||
static const u16_t offset_tcpip_hdr_srcipaddr = offsetof(struct uip_tcpip_hdr, srcipaddr);
|
static const uint16_t offset_tcpip_hdr_srcipaddr = offsetof(struct uip_tcpip_hdr, srcipaddr);
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
static void upper_layer_chksum() {
|
static void upper_layer_chksum() {
|
||||||
__asm
|
__asm
|
||||||
;; ---------------------------------
|
;; ---------------------------------
|
||||||
;; static u16_t upper_layer_chksum(u8_t proto);
|
;; static uint16_t upper_layer_chksum(uint8_t proto);
|
||||||
;; Stack; retl reth
|
;; Stack; retl reth
|
||||||
;; @param C proto
|
;; @param C proto
|
||||||
;; ABCDEHL____
|
;; ABCDEHL____
|
||||||
|
@ -142,12 +142,12 @@ __endasm;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
u16_t
|
uint16_t
|
||||||
uip_ipchksum(void)
|
uip_ipchksum(void)
|
||||||
{
|
{
|
||||||
__asm
|
__asm
|
||||||
;; ---------------------------------
|
;; ---------------------------------
|
||||||
;; u16_t uip_ipchksum(void);
|
;; uint16_t uip_ipchksum(void);
|
||||||
;; Stack; retl reth
|
;; Stack; retl reth
|
||||||
;; ABCDEHL____
|
;; ABCDEHL____
|
||||||
;; return HL
|
;; return HL
|
||||||
|
@ -164,12 +164,12 @@ __endasm;
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
#if UIP_CONF_IPV6
|
#if UIP_CONF_IPV6
|
||||||
u16_t
|
uint16_t
|
||||||
uip_icmp6chksum(void)
|
uip_icmp6chksum(void)
|
||||||
{
|
{
|
||||||
__asm
|
__asm
|
||||||
;; ---------------------------------
|
;; ---------------------------------
|
||||||
;; u16_t uip_icmp6chksum(void);
|
;; uint16_t uip_icmp6chksum(void);
|
||||||
;; Stack; retl reth
|
;; Stack; retl reth
|
||||||
;; ABCDEHL____
|
;; ABCDEHL____
|
||||||
;; return HL
|
;; return HL
|
||||||
|
@ -181,12 +181,12 @@ __endasm;
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* UIP_CONF_IPV6 */
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
u16_t
|
uint16_t
|
||||||
uip_tcpchksum(void)
|
uip_tcpchksum(void)
|
||||||
{
|
{
|
||||||
__asm
|
__asm
|
||||||
;; ---------------------------------
|
;; ---------------------------------
|
||||||
;; u16_t uip_tcpchksum(void);
|
;; uint16_t uip_tcpchksum(void);
|
||||||
;; Stack; retl reth
|
;; Stack; retl reth
|
||||||
;; ABCDEHL____
|
;; ABCDEHL____
|
||||||
;; return HL
|
;; return HL
|
||||||
|
@ -198,12 +198,12 @@ __endasm;
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
#if UIP_UDP_CHKSUMS
|
#if UIP_UDP_CHKSUMS
|
||||||
u16_t
|
uint16_t
|
||||||
uip_udpchksum(void)
|
uip_udpchksum(void)
|
||||||
{
|
{
|
||||||
__asm
|
__asm
|
||||||
;; ---------------------------------
|
;; ---------------------------------
|
||||||
;; u16_t uip_udpchksum(void);
|
;; uint16_t uip_udpchksum(void);
|
||||||
;; Stack; retl reth
|
;; Stack; retl reth
|
||||||
;; ABCDEHL____
|
;; ABCDEHL____
|
||||||
;; return HL
|
;; return HL
|
||||||
|
|
|
@ -47,12 +47,14 @@ typedef int32_t s32_t;
|
||||||
/* Pre-allocated memory for loadable modules heap space (in bytes)*/
|
/* Pre-allocated memory for loadable modules heap space (in bytes)*/
|
||||||
#define MMEM_CONF_SIZE 256
|
#define MMEM_CONF_SIZE 256
|
||||||
|
|
||||||
typedef uint32_t 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;
|
||||||
typedef unsigned short uip_stats_t;
|
typedef unsigned short uip_stats_t;
|
||||||
|
|
||||||
|
typedef uint32_t clock_time_t;
|
||||||
|
|
||||||
void clock_delay(unsigned int us2);
|
void clock_delay(unsigned int us2);
|
||||||
void clock_wait(int ms10);
|
void clock_wait(int ms10);
|
||||||
void clock_set_seconds(unsigned long s);
|
void clock_set_seconds(unsigned long s);
|
||||||
|
|
|
@ -35,8 +35,8 @@
|
||||||
#define BUTTON_MSG_TYPE 1
|
#define BUTTON_MSG_TYPE 1
|
||||||
|
|
||||||
struct button_msg {
|
struct button_msg {
|
||||||
u8_t type;
|
uint8_t type;
|
||||||
u8_t value;
|
uint8_t value;
|
||||||
};
|
};
|
||||||
|
|
||||||
void button_init(struct process *proc);
|
void button_init(struct process *proc);
|
||||||
|
|
|
@ -42,18 +42,18 @@
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#ifdef UIP_ARCH_IPCHKSUM
|
#ifdef UIP_ARCH_IPCHKSUM
|
||||||
#ifdef __IAR_SYSTEMS_ICC__
|
#ifdef __IAR_SYSTEMS_ICC__
|
||||||
u16_t
|
uint16_t
|
||||||
uip_ipchksum(void)
|
uip_ipchksum(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
u16_t
|
uint16_t
|
||||||
uip_ipchksum(void)
|
uip_ipchksum(void)
|
||||||
{
|
{
|
||||||
/* Assumes proper alignement of uip_buf. */
|
/* Assumes proper alignement of uip_buf. */
|
||||||
u16_t *p = (u16_t *)&uip_buf[UIP_LLH_LEN];
|
uint16_t *p = (uint16_t *)&uip_buf[UIP_LLH_LEN];
|
||||||
register u16_t sum;
|
register uint16_t sum;
|
||||||
|
|
||||||
sum = p[0];
|
sum = p[0];
|
||||||
asmv("add %[p], %[sum]": [sum] "+r" (sum): [p] "m" (p[1]));
|
asmv("add %[p], %[sum]": [sum] "+r" (sum): [p] "m" (p[1]));
|
||||||
|
|
|
@ -48,7 +48,7 @@ PROCESS(tapdev_process, "TAP driver");
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if !UIP_CONF_IPV6
|
#if !UIP_CONF_IPV6
|
||||||
u8_t
|
uint8_t
|
||||||
tapdev_output(void)
|
tapdev_output(void)
|
||||||
{
|
{
|
||||||
uip_arp_out();
|
uip_arp_out();
|
||||||
|
|
|
@ -38,6 +38,6 @@
|
||||||
|
|
||||||
PROCESS_NAME(tapdev_process);
|
PROCESS_NAME(tapdev_process);
|
||||||
|
|
||||||
u8_t tapdev_output(void);
|
uint8_t tapdev_output(void);
|
||||||
|
|
||||||
#endif /* __TAPDEV_DRV_H__ */
|
#endif /* __TAPDEV_DRV_H__ */
|
||||||
|
|
|
@ -122,7 +122,7 @@ tapdev_init(void)
|
||||||
lasttime = 0;
|
lasttime = 0;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
u16_t
|
uint16_t
|
||||||
tapdev_poll(void)
|
tapdev_poll(void)
|
||||||
{
|
{
|
||||||
fd_set fdset;
|
fd_set fdset;
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#define __TAPDEV_H__
|
#define __TAPDEV_H__
|
||||||
|
|
||||||
void tapdev_init(void);
|
void tapdev_init(void);
|
||||||
u16_t tapdev_poll(void);
|
uint16_t tapdev_poll(void);
|
||||||
void tapdev_send(void);
|
void tapdev_send(void);
|
||||||
void tapdev_exit(void);
|
void tapdev_exit(void);
|
||||||
|
|
||||||
|
|
|
@ -77,17 +77,17 @@ static unsigned long lasttime;
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#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])
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
#define PRINT6ADDR(addr)
|
#define PRINT6ADDR(addr)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void do_send(void);
|
static void do_send(void);
|
||||||
u8_t tapdev_send(uip_lladdr_t *lladdr);
|
uint8_t tapdev_send(uip_lladdr_t *lladdr);
|
||||||
|
|
||||||
|
|
||||||
u16_t
|
uint16_t
|
||||||
tapdev_poll(void)
|
tapdev_poll(void)
|
||||||
{
|
{
|
||||||
fd_set fdset;
|
fd_set fdset;
|
||||||
|
@ -192,7 +192,7 @@ do_send(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
u8_t tapdev_send(uip_lladdr_t *lladdr)
|
uint8_t tapdev_send(uip_lladdr_t *lladdr)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* If L3 dest is multicast, build L2 multicast address
|
* If L3 dest is multicast, build L2 multicast address
|
||||||
|
|
|
@ -40,8 +40,8 @@
|
||||||
#include "contiki-net.h"
|
#include "contiki-net.h"
|
||||||
|
|
||||||
void tapdev_init(void);
|
void tapdev_init(void);
|
||||||
u8_t tapdev_send(uip_lladdr_t *lladdr);
|
uint8_t tapdev_send(uip_lladdr_t *lladdr);
|
||||||
u16_t tapdev_poll(void);
|
uint16_t tapdev_poll(void);
|
||||||
void tapdev_do_send(void);
|
void tapdev_do_send(void);
|
||||||
void tapdev_exit(void); //math
|
void tapdev_exit(void); //math
|
||||||
#endif /* __TAPDEV_H__ */
|
#endif /* __TAPDEV_H__ */
|
||||||
|
|
|
@ -65,7 +65,7 @@ PROCESS(wpcap_process, "WinPcap driver");
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if !UIP_CONF_IPV6
|
#if !UIP_CONF_IPV6
|
||||||
u8_t
|
uint8_t
|
||||||
wpcap_output(void)
|
wpcap_output(void)
|
||||||
{
|
{
|
||||||
uip_arp_out();
|
uip_arp_out();
|
||||||
|
|
|
@ -38,6 +38,6 @@
|
||||||
|
|
||||||
PROCESS_NAME(wpcap_process);
|
PROCESS_NAME(wpcap_process);
|
||||||
|
|
||||||
u8_t wpcap_output(void);
|
uint8_t wpcap_output(void);
|
||||||
|
|
||||||
#endif /* __WPCAP_DRV_H__ */
|
#endif /* __WPCAP_DRV_H__ */
|
||||||
|
|
|
@ -185,7 +185,7 @@ init(void)
|
||||||
/* Nothing to do here */
|
/* Nothing to do here */
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
u8_t wfall_send(uip_lladdr_t *lladdr);
|
uint8_t wfall_send(uip_lladdr_t *lladdr);
|
||||||
#if FALLBACK_HAS_ETHERNET_HEADERS
|
#if FALLBACK_HAS_ETHERNET_HEADERS
|
||||||
#undef IPBUF
|
#undef IPBUF
|
||||||
#define IPBUF ((struct uip_tcpip_hdr *)&uip_buf[14])
|
#define IPBUF ((struct uip_tcpip_hdr *)&uip_buf[14])
|
||||||
|
@ -597,7 +597,7 @@ wpcap_init(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
u16_t
|
uint16_t
|
||||||
wpcap_poll(void)
|
wpcap_poll(void)
|
||||||
{
|
{
|
||||||
struct pcap_pkthdr *packet_header;
|
struct pcap_pkthdr *packet_header;
|
||||||
|
@ -656,12 +656,12 @@ wpcap_poll(void)
|
||||||
}
|
}
|
||||||
// PRINTF("SIN: %lu\n", packet_header->caplen);
|
// PRINTF("SIN: %lu\n", packet_header->caplen);
|
||||||
CopyMemory(uip_buf, packet, packet_header->caplen);
|
CopyMemory(uip_buf, packet, packet_header->caplen);
|
||||||
return (u16_t)packet_header->caplen;
|
return (uint16_t)packet_header->caplen;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef UIP_FALLBACK_INTERFACE
|
#ifdef UIP_FALLBACK_INTERFACE
|
||||||
u16_t
|
uint16_t
|
||||||
wfall_poll(void)
|
wfall_poll(void)
|
||||||
{
|
{
|
||||||
struct pcap_pkthdr *packet_header;
|
struct pcap_pkthdr *packet_header;
|
||||||
|
@ -699,7 +699,7 @@ wfall_poll(void)
|
||||||
}
|
}
|
||||||
PRINTF("FIN: %lu\n", packet_header->caplen);
|
PRINTF("FIN: %lu\n", packet_header->caplen);
|
||||||
CopyMemory(uip_buf, packet, packet_header->caplen);
|
CopyMemory(uip_buf, packet, packet_header->caplen);
|
||||||
return (u16_t)packet_header->caplen;
|
return (uint16_t)packet_header->caplen;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -707,7 +707,7 @@ wfall_poll(void)
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if UIP_CONF_IPV6
|
#if UIP_CONF_IPV6
|
||||||
u8_t
|
uint8_t
|
||||||
wpcap_send(uip_lladdr_t *lladdr)
|
wpcap_send(uip_lladdr_t *lladdr)
|
||||||
{
|
{
|
||||||
if(lladdr == NULL) {
|
if(lladdr == NULL) {
|
||||||
|
@ -744,7 +744,7 @@ wpcap_send(uip_lladdr_t *lladdr)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#ifdef UIP_FALLBACK_INTERFACE
|
#ifdef UIP_FALLBACK_INTERFACE
|
||||||
u8_t
|
uint8_t
|
||||||
wfall_send(uip_lladdr_t *lladdr)
|
wfall_send(uip_lladdr_t *lladdr)
|
||||||
{
|
{
|
||||||
#if FALLBACK_HAS_ETHERNET_HEADERS
|
#if FALLBACK_HAS_ETHERNET_HEADERS
|
||||||
|
|
|
@ -37,11 +37,11 @@
|
||||||
#define __WPCAP_H__
|
#define __WPCAP_H__
|
||||||
|
|
||||||
void wpcap_init(void);
|
void wpcap_init(void);
|
||||||
u16_t wpcap_poll(void);
|
uint16_t wpcap_poll(void);
|
||||||
u16_t wfall_poll(void);
|
uint16_t wfall_poll(void);
|
||||||
#if UIP_CONF_IPV6
|
#if UIP_CONF_IPV6
|
||||||
u8_t wpcap_send(uip_lladdr_t *lladdr);
|
uint8_t wpcap_send(uip_lladdr_t *lladdr);
|
||||||
u8_t wfall_send(uip_lladdr_t *lladdr);
|
uint8_t wfall_send(uip_lladdr_t *lladdr);
|
||||||
#else
|
#else
|
||||||
void wpcap_send(void);
|
void wpcap_send(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -525,7 +525,7 @@ void stm32w_flash_write(int32u address, const void * data, int32u length)
|
||||||
halInternalFlashWrite(curr_page, (int16u *)buf, FLASH_PAGE_SIZE/2);
|
halInternalFlashWrite(curr_page, (int16u *)buf, FLASH_PAGE_SIZE/2);
|
||||||
ENERGEST_OFF(ENERGEST_TYPE_FLASH_WRITE);
|
ENERGEST_OFF(ENERGEST_TYPE_FLASH_WRITE);
|
||||||
|
|
||||||
data = (u8_t *)data + next_page - i;
|
data = (uint8_t *)data + next_page - i;
|
||||||
i = next_page;
|
i = next_page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -227,7 +227,7 @@ static int stm32w_radio_init(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
int stm32w_radio_set_channel(u8_t channel)
|
int stm32w_radio_set_channel(uint8_t channel)
|
||||||
{
|
{
|
||||||
if (ST_RadioSetChannel(channel) == ST_SUCCESS)
|
if (ST_RadioSetChannel(channel) == ST_SUCCESS)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -300,7 +300,7 @@ static int stm32w_radio_transmit(unsigned short payload_len)
|
||||||
PRINTF("stm32w: sending %d bytes\r\n", payload_len);
|
PRINTF("stm32w: sending %d bytes\r\n", payload_len);
|
||||||
|
|
||||||
#if DEBUG > 1
|
#if DEBUG > 1
|
||||||
for(u8_t c=1; c <= stm32w_txbuf[0]-2; c++){
|
for(uint8_t c=1; c <= stm32w_txbuf[0]-2; c++){
|
||||||
PRINTF("%x:",stm32w_txbuf[c]);
|
PRINTF("%x:",stm32w_txbuf[c]);
|
||||||
}
|
}
|
||||||
PRINTF("\r\n");
|
PRINTF("\r\n");
|
||||||
|
@ -503,7 +503,7 @@ PROCESS_THREAD(stm32w_radio_process, ev, data)
|
||||||
PRINTF("stm32w_radio_process: calling receiver callback\r\n");
|
PRINTF("stm32w_radio_process: calling receiver callback\r\n");
|
||||||
|
|
||||||
#if DEBUG > 1
|
#if DEBUG > 1
|
||||||
for(u8_t c=1; c <= RCVD_PACKET_LEN; c++){
|
for(uint8_t c=1; c <= RCVD_PACKET_LEN; c++){
|
||||||
PRINTF("%x",stm32w_rxbuf[c]);
|
PRINTF("%x",stm32w_rxbuf[c]);
|
||||||
}
|
}
|
||||||
PRINTF("\r\n");
|
PRINTF("\r\n");
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
#include "hal/hal.h"
|
#include "hal/hal.h"
|
||||||
#include "simplemac/include/phy-library.h"
|
#include "simplemac/include/phy-library.h"
|
||||||
|
|
||||||
int stm32w_radio_set_channel(u8_t channel);
|
int stm32w_radio_set_channel(uint8_t channel);
|
||||||
short last_packet_rssi();
|
short last_packet_rssi();
|
||||||
|
|
||||||
#define STM32W_MAX_PACKET_LEN 127
|
#define STM32W_MAX_PACKET_LEN 127
|
||||||
|
|
|
@ -138,8 +138,8 @@ uart1_init(unsigned long ubr)
|
||||||
GPIO_PBCFGL &= 0xF00F;
|
GPIO_PBCFGL &= 0xF00F;
|
||||||
GPIO_PBCFGL |= 0x0490;
|
GPIO_PBCFGL |= 0x0490;
|
||||||
|
|
||||||
u16_t uartper = (u32_t)24e6/(2*ubr);
|
uint16_t uartper = (uint32_t)24e6/(2*ubr);
|
||||||
u32_t rest = (u32_t)24e6%(2*ubr);
|
uint32_t rest = (uint32_t)24e6%(2*ubr);
|
||||||
|
|
||||||
SC1_UARTFRAC = 0;
|
SC1_UARTFRAC = 0;
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
|
|
||||||
int rand(void)
|
int rand(void)
|
||||||
{
|
{
|
||||||
u16_t rand_num;
|
uint16_t rand_num;
|
||||||
|
|
||||||
ST_RadioGetRandomNumbers(&rand_num, 1);
|
ST_RadioGetRandomNumbers(&rand_num, 1);
|
||||||
|
|
||||||
|
|
|
@ -55,12 +55,12 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static u32_t time_msb = 0; // Most significant bits of the current time.
|
static uint32_t time_msb = 0; // Most significant bits of the current time.
|
||||||
|
|
||||||
// time of the next rtimer event. Initially is set to the max value.
|
// time of the next rtimer event. Initially is set to the max value.
|
||||||
static rtimer_clock_t next_rtimer_time = 0;
|
static rtimer_clock_t next_rtimer_time = 0;
|
||||||
|
|
||||||
static u16_t saved_TIM1CFG;
|
static uint16_t saved_TIM1CFG;
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
@ -150,7 +150,7 @@ void
|
||||||
rtimer_arch_schedule(rtimer_clock_t t)
|
rtimer_arch_schedule(rtimer_clock_t t)
|
||||||
{
|
{
|
||||||
|
|
||||||
PRINTF("rtimer_arch_schedule time %4x\r\n", /*((u32_t*)&t)+1,*/(u32_t)t);
|
PRINTF("rtimer_arch_schedule time %4x\r\n", /*((uint32_t*)&t)+1,*/(uint32_t)t);
|
||||||
|
|
||||||
next_rtimer_time = t;
|
next_rtimer_time = t;
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
#if UIP_TCP
|
#if UIP_TCP
|
||||||
void
|
void
|
||||||
uip_add32(u8_t *op32, u16_t op16)
|
uip_add32(uint8_t *op32, uint16_t op16)
|
||||||
{
|
{
|
||||||
uint32_t op32_align, uip_acc32_align;
|
uint32_t op32_align, uip_acc32_align;
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void scroll() {
|
static void scroll() {
|
||||||
unsigned char y;
|
unsigned char y;
|
||||||
u16_t src, dst;
|
uint16_t src, dst;
|
||||||
for (y = 0; y < LIBCONIO_CONF_SCREEN_HEIGHT - 1; y++) {
|
for (y = 0; y < LIBCONIO_CONF_SCREEN_HEIGHT - 1; y++) {
|
||||||
dst = LIBCONIO_VRAM_OFFSET(0, y);
|
dst = LIBCONIO_VRAM_OFFSET(0, y);
|
||||||
src = LIBCONIO_VRAM_OFFSET(0, y + 1);
|
src = LIBCONIO_VRAM_OFFSET(0, y + 1);
|
||||||
|
@ -85,7 +85,7 @@ void ctk_arch_draw_char(char c,
|
||||||
unsigned char ypos,
|
unsigned char ypos,
|
||||||
unsigned char reversed,
|
unsigned char reversed,
|
||||||
unsigned char color) {
|
unsigned char color) {
|
||||||
u16_t off;
|
uint16_t off;
|
||||||
adjust(&xpos, &ypos);
|
adjust(&xpos, &ypos);
|
||||||
|
|
||||||
off = LIBCONIO_VRAM_OFFSET(xpos, ypos);
|
off = LIBCONIO_VRAM_OFFSET(xpos, ypos);
|
||||||
|
|
|
@ -50,9 +50,9 @@ mef_load(unsigned char* offset)
|
||||||
{
|
{
|
||||||
unsigned char* start = offset;
|
unsigned char* start = offset;
|
||||||
unsigned char areasize = load_byte();
|
unsigned char areasize = load_byte();
|
||||||
u16_t relocsize;
|
uint16_t relocsize;
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
u16_t checksum = 0;
|
uint16_t checksum = 0;
|
||||||
unsigned char* buf;
|
unsigned char* buf;
|
||||||
struct Relocation reloc;
|
struct Relocation reloc;
|
||||||
|
|
||||||
|
@ -94,12 +94,12 @@ mef_reloc(unsigned char* offset, struct Relocation *reloc)
|
||||||
}
|
}
|
||||||
offset += reloc->address;
|
offset += reloc->address;
|
||||||
if (reloc->mode & MEF_RELOC_MSB_BYTE) {
|
if (reloc->mode & MEF_RELOC_MSB_BYTE) {
|
||||||
*offset = (unsigned char) ((reloc->data + (u16_t) offset) >> 8);
|
*offset = (unsigned char) ((reloc->data + (uint16_t) offset) >> 8);
|
||||||
} else if (reloc->mode & MEF_RELOC_LSB_BYTE) {
|
} else if (reloc->mode & MEF_RELOC_LSB_BYTE) {
|
||||||
*offset = (unsigned char) ((reloc->data + (u16_t) offset) & 0xff);
|
*offset = (unsigned char) ((reloc->data + (uint16_t) offset) & 0xff);
|
||||||
} else { /* word */
|
} else { /* word */
|
||||||
*offset++ = (unsigned char) ((reloc->data + (u16_t) offset) & 0xff);
|
*offset++ = (unsigned char) ((reloc->data + (uint16_t) offset) & 0xff);
|
||||||
*offset = (unsigned char) ((reloc->data + (u16_t) offset) >> 8);
|
*offset = (unsigned char) ((reloc->data + (uint16_t) offset) >> 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,8 +66,8 @@
|
||||||
|
|
||||||
struct Area {
|
struct Area {
|
||||||
unsigned char mode;
|
unsigned char mode;
|
||||||
u16_t size;
|
uint16_t size;
|
||||||
u16_t checksum;
|
uint16_t checksum;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -82,8 +82,8 @@ struct Area {
|
||||||
|
|
||||||
struct Relocation {
|
struct Relocation {
|
||||||
unsigned char mode;
|
unsigned char mode;
|
||||||
u16_t address;
|
uint16_t address;
|
||||||
u16_t data;
|
uint16_t data;
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned char load_byte();
|
unsigned char load_byte();
|
||||||
|
|
|
@ -47,7 +47,7 @@ void
|
||||||
mtarch_start(struct mtarch_thread *t,
|
mtarch_start(struct mtarch_thread *t,
|
||||||
void (*function)(void *), void *data)
|
void (*function)(void *), void *data)
|
||||||
{
|
{
|
||||||
u16_t i;
|
uint16_t i;
|
||||||
|
|
||||||
for(i = 0; i < MTARCH_STACKSIZE; i++) {
|
for(i = 0; i < MTARCH_STACKSIZE; i++) {
|
||||||
t->stack[i] = i;
|
t->stack[i] = i;
|
||||||
|
@ -57,15 +57,15 @@ mtarch_start(struct mtarch_thread *t,
|
||||||
|
|
||||||
|
|
||||||
/* A parameter for method for thread function. */
|
/* A parameter for method for thread function. */
|
||||||
*t->sp = (u16_t)data;
|
*t->sp = (uint16_t)data;
|
||||||
--t->sp;
|
--t->sp;
|
||||||
|
|
||||||
/* This will be a return address of thread function. */
|
/* This will be a return address of thread function. */
|
||||||
*t->sp = (u16_t)mt_exit;
|
*t->sp = (uint16_t)mt_exit;
|
||||||
--t->sp;
|
--t->sp;
|
||||||
|
|
||||||
/* The thread function, is used as a return address of mtarch_switch. */
|
/* The thread function, is used as a return address of mtarch_switch. */
|
||||||
*t->sp = (u16_t)function;
|
*t->sp = (uint16_t)function;
|
||||||
--t->sp;
|
--t->sp;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -82,7 +82,7 @@ mtarch_start(struct mtarch_thread *t,
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
static struct mtarch_thread *running_thread;
|
static struct mtarch_thread *running_thread;
|
||||||
static u16_t *sptmp;
|
static uint16_t *sptmp;
|
||||||
static void
|
static void
|
||||||
mtarch_switch()
|
mtarch_switch()
|
||||||
{
|
{
|
||||||
|
@ -180,7 +180,7 @@ mtarch_pstart()
|
||||||
int
|
int
|
||||||
mtarch_stack_usage(struct mtarch_thread *t)
|
mtarch_stack_usage(struct mtarch_thread *t)
|
||||||
{
|
{
|
||||||
u16_t i;
|
uint16_t i;
|
||||||
for (i = 0; i < MTARCH_STACKSIZE; i++) {
|
for (i = 0; i < MTARCH_STACKSIZE; i++) {
|
||||||
if (t->stack[i] != i) {
|
if (t->stack[i] != i) {
|
||||||
return MTARCH_STACKSIZE - i;
|
return MTARCH_STACKSIZE - i;
|
||||||
|
|
|
@ -48,12 +48,12 @@ struct mtarch_thread {
|
||||||
* On top of the mtarch_thread must be the address for the stack pointer.
|
* On top of the mtarch_thread must be the address for the stack pointer.
|
||||||
* See details at mtarch_switch in mtarch.c
|
* See details at mtarch_switch in mtarch.c
|
||||||
*/
|
*/
|
||||||
u16_t *sp;
|
uint16_t *sp;
|
||||||
/*
|
/*
|
||||||
* Stack is 2-byte wide, so please note that you need 2 * MTARCH_STACKSIZE
|
* Stack is 2-byte wide, so please note that you need 2 * MTARCH_STACKSIZE
|
||||||
* bytes for the stack area for each thread.
|
* bytes for the stack area for each thread.
|
||||||
*/
|
*/
|
||||||
u16_t stack[MTARCH_STACKSIZE];
|
uint16_t stack[MTARCH_STACKSIZE];
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
.area _CODE
|
.area _CODE
|
||||||
|
|
||||||
;; ---------------------------------
|
;; ---------------------------------
|
||||||
;; void uip_add32(u8_t *op32, u16_t op16);
|
;; void uip_add32(uint8_t *op32, uint16_t op16);
|
||||||
;; Stack; retl reth op32l op32h op16l op16h
|
;; Stack; retl reth op32l op32h op16l op16h
|
||||||
;; ABCDEHL____
|
;; ABCDEHL____
|
||||||
;; return void
|
;; return void
|
||||||
|
@ -102,7 +102,7 @@ _uip_add32_nocarry0:
|
||||||
_uip_add32_end::
|
_uip_add32_end::
|
||||||
|
|
||||||
;; ---------------------------------
|
;; ---------------------------------
|
||||||
;; 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)
|
||||||
;; Stack; retl reth suml sumh datal datah lenl lenh
|
;; Stack; retl reth suml sumh datal datah lenl lenh
|
||||||
;; ABCDEHL____
|
;; ABCDEHL____
|
||||||
;; return HL
|
;; return HL
|
||||||
|
@ -188,11 +188,11 @@ _uip_arch_chksum_loop_exit:
|
||||||
_uip_arch_chksum_end::
|
_uip_arch_chksum_end::
|
||||||
|
|
||||||
;; ---------------------------------
|
;; ---------------------------------
|
||||||
;; u16_t uip_chksum(void);
|
;; uint16_t uip_chksum(void);
|
||||||
;; Stack; retl reth datal datah lenl lenh
|
;; Stack; retl reth datal datah lenl lenh
|
||||||
;; ABCDEHL____
|
;; ABCDEHL____
|
||||||
;; return HL
|
;; return HL
|
||||||
;; return htons(chksum(0, (u8_t *)data, len));
|
;; return htons(chksum(0, (uint8_t *)data, len));
|
||||||
;; ---------------------------------
|
;; ---------------------------------
|
||||||
_uip_chksum_start::
|
_uip_chksum_start::
|
||||||
_uip_chksum:
|
_uip_chksum:
|
||||||
|
|
|
@ -41,15 +41,15 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include "uip_arch.h"
|
#include "uip_arch.h"
|
||||||
|
|
||||||
static const u16_t sizeof_uip_ipaddr_t = sizeof(uip_ipaddr_t);
|
static const uint16_t sizeof_uip_ipaddr_t = sizeof(uip_ipaddr_t);
|
||||||
static const u16_t offset_tcpip_hdr_len = offsetof(struct uip_tcpip_hdr, len);
|
static const uint16_t offset_tcpip_hdr_len = offsetof(struct uip_tcpip_hdr, len);
|
||||||
static const u16_t offset_tcpip_hdr_srcipaddr = offsetof(struct uip_tcpip_hdr, srcipaddr);
|
static const uint16_t offset_tcpip_hdr_srcipaddr = offsetof(struct uip_tcpip_hdr, srcipaddr);
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
static void upper_layer_chksum() {
|
static void upper_layer_chksum() {
|
||||||
__asm
|
__asm
|
||||||
;; ---------------------------------
|
;; ---------------------------------
|
||||||
;; static u16_t upper_layer_chksum(u8_t proto);
|
;; static uint16_t upper_layer_chksum(uint8_t proto);
|
||||||
;; Stack; retl reth
|
;; Stack; retl reth
|
||||||
;; @param C proto
|
;; @param C proto
|
||||||
;; ABCDEHL____
|
;; ABCDEHL____
|
||||||
|
@ -142,12 +142,12 @@ __endasm;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
u16_t
|
uint16_t
|
||||||
uip_ipchksum(void)
|
uip_ipchksum(void)
|
||||||
{
|
{
|
||||||
__asm
|
__asm
|
||||||
;; ---------------------------------
|
;; ---------------------------------
|
||||||
;; u16_t uip_ipchksum(void);
|
;; uint16_t uip_ipchksum(void);
|
||||||
;; Stack; retl reth
|
;; Stack; retl reth
|
||||||
;; ABCDEHL____
|
;; ABCDEHL____
|
||||||
;; return HL
|
;; return HL
|
||||||
|
@ -164,12 +164,12 @@ __endasm;
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
#if UIP_CONF_IPV6
|
#if UIP_CONF_IPV6
|
||||||
u16_t
|
uint16_t
|
||||||
uip_icmp6chksum(void)
|
uip_icmp6chksum(void)
|
||||||
{
|
{
|
||||||
__asm
|
__asm
|
||||||
;; ---------------------------------
|
;; ---------------------------------
|
||||||
;; u16_t uip_icmp6chksum(void);
|
;; uint16_t uip_icmp6chksum(void);
|
||||||
;; Stack; retl reth
|
;; Stack; retl reth
|
||||||
;; ABCDEHL____
|
;; ABCDEHL____
|
||||||
;; return HL
|
;; return HL
|
||||||
|
@ -181,12 +181,12 @@ __endasm;
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* UIP_CONF_IPV6 */
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
u16_t
|
uint16_t
|
||||||
uip_tcpchksum(void)
|
uip_tcpchksum(void)
|
||||||
{
|
{
|
||||||
__asm
|
__asm
|
||||||
;; ---------------------------------
|
;; ---------------------------------
|
||||||
;; u16_t uip_tcpchksum(void);
|
;; uint16_t uip_tcpchksum(void);
|
||||||
;; Stack; retl reth
|
;; Stack; retl reth
|
||||||
;; ABCDEHL____
|
;; ABCDEHL____
|
||||||
;; return HL
|
;; return HL
|
||||||
|
@ -198,12 +198,12 @@ __endasm;
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
#if UIP_UDP_CHKSUMS
|
#if UIP_UDP_CHKSUMS
|
||||||
u16_t
|
uint16_t
|
||||||
uip_udpchksum(void)
|
uip_udpchksum(void)
|
||||||
{
|
{
|
||||||
__asm
|
__asm
|
||||||
;; ---------------------------------
|
;; ---------------------------------
|
||||||
;; u16_t uip_udpchksum(void);
|
;; uint16_t uip_udpchksum(void);
|
||||||
;; Stack; retl reth
|
;; Stack; retl reth
|
||||||
;; ABCDEHL____
|
;; ABCDEHL____
|
||||||
;; return HL
|
;; return HL
|
||||||
|
|
Loading…
Reference in a new issue