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
46 changed files with 208 additions and 206 deletions
|
@ -44,7 +44,7 @@
|
|||
#if CTK_CONF_MOUSE_SUPPORT
|
||||
|
||||
static struct mouse_pos pos;
|
||||
static u8_t okay;
|
||||
static uint8_t okay;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
void
|
||||
|
|
|
@ -77,7 +77,7 @@ AUTOSTART_PROCESSES(&dhcp_process);
|
|||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
static char *
|
||||
makebyte(u8_t byte, char *str)
|
||||
makebyte(uint8_t byte, char *str)
|
||||
{
|
||||
if(byte >= 100) {
|
||||
*str++ = (byte / 100 ) % 10 + '0';
|
||||
|
|
|
@ -48,7 +48,7 @@ static char * CC_FASTCALL
|
|||
ipaddrtoa(uip_ipaddr_t *ipaddr, char *buffer)
|
||||
{
|
||||
char *ptr = buffer;
|
||||
u8_t i;
|
||||
uint8_t i;
|
||||
|
||||
for(i = 0; i < 4; ++i) {
|
||||
*ptr = '.';
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
PROCESS(ethernet_process, "Ethernet driver");
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
u8_t
|
||||
uint8_t
|
||||
ethernet_output(void)
|
||||
{
|
||||
uip_arp_out();
|
||||
|
|
|
@ -37,12 +37,12 @@
|
|||
#include "contiki.h"
|
||||
|
||||
struct ethernet_config {
|
||||
u16_t addr;
|
||||
uint16_t addr;
|
||||
char name[12+1];
|
||||
};
|
||||
|
||||
PROCESS_NAME(ethernet_process);
|
||||
|
||||
u8_t ethernet_output(void);
|
||||
uint8_t ethernet_output(void);
|
||||
|
||||
#endif /* __ETHERNET_DRV_H__ */
|
||||
|
|
|
@ -46,11 +46,11 @@
|
|||
struct {
|
||||
char signature[4];
|
||||
struct uip_eth_addr ethernet_address;
|
||||
u8_t *buffer;
|
||||
u16_t buffer_size;
|
||||
void __fastcall__ (* init)(u16_t reg);
|
||||
u16_t (* poll)(void);
|
||||
void __fastcall__ (* send)(u16_t len);
|
||||
uint8_t *buffer;
|
||||
uint16_t buffer_size;
|
||||
void __fastcall__ (* init)(uint16_t reg);
|
||||
uint16_t (* poll)(void);
|
||||
void __fastcall__ (* send)(uint16_t len);
|
||||
void (* exit)(void);
|
||||
} *module;
|
||||
|
||||
|
@ -63,7 +63,7 @@ ethernet_init(struct ethernet_config *config)
|
|||
#ifndef ETHERNET
|
||||
|
||||
struct mod_ctrl module_control = {cfs_read};
|
||||
u8_t byte;
|
||||
uint8_t byte;
|
||||
|
||||
module_control.callerdata = cfs_open(config->name, CFS_READ);
|
||||
if(module_control.callerdata < 0) {
|
||||
|
@ -103,7 +103,7 @@ ethernet_init(struct ethernet_config *config)
|
|||
uip_setethaddr(module->ethernet_address);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
u16_t
|
||||
uint16_t
|
||||
ethernet_poll(void)
|
||||
{
|
||||
return module->poll();
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#define __ETHERNET_H__
|
||||
|
||||
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_exit(void);
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
/*-----------------------------------------------------------------------------------*/
|
||||
#pragma optimize(push, off)
|
||||
void
|
||||
uip_add32(u8_t *op32, u16_t op16)
|
||||
uip_add32(uint8_t *op32, uint16_t op16)
|
||||
{
|
||||
asm("ldy #3");
|
||||
asm("jsr ldaxysp");
|
||||
|
@ -71,12 +71,12 @@ uip_add32(u8_t *op32, u16_t op16)
|
|||
}
|
||||
#pragma optimize(pop)
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
static u16_t chksum_ptr, chksum_len, chksum_tmp;
|
||||
static u8_t chksum_protocol;
|
||||
static u16_t chksum(void);
|
||||
static uint16_t chksum_ptr, chksum_len, chksum_tmp;
|
||||
static uint8_t chksum_protocol;
|
||||
static uint16_t chksum(void);
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
#pragma optimize(push, off)
|
||||
u16_t
|
||||
uint16_t
|
||||
chksum(void) {
|
||||
|
||||
asm("lda #0");
|
||||
|
@ -172,14 +172,14 @@ chksum(void) {
|
|||
}
|
||||
#pragma optimize(pop)
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
u16_t
|
||||
uip_chksum(u16_t *buf, u16_t len)
|
||||
uint16_t
|
||||
uip_chksum(uint16_t *buf, uint16_t len)
|
||||
{
|
||||
/* unsigned long sum;
|
||||
|
||||
sum = 0;
|
||||
|
||||
chksum_ptr = (u16_t)buf;
|
||||
chksum_ptr = (uint16_t)buf;
|
||||
while(len >= 256) {
|
||||
chksum_len = 256;
|
||||
sum += chksum();
|
||||
|
@ -199,28 +199,28 @@ uip_chksum(u16_t *buf, u16_t len)
|
|||
return sum;*/
|
||||
|
||||
chksum_len = len;
|
||||
chksum_ptr = (u16_t)buf;
|
||||
chksum_ptr = (uint16_t)buf;
|
||||
return chksum();
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
u16_t
|
||||
uint16_t
|
||||
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;
|
||||
return chksum();
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
#pragma optimize(push, off)
|
||||
static u16_t
|
||||
transport_chksum(u8_t protocol)
|
||||
static uint16_t
|
||||
transport_chksum(uint8_t 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_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("sec");
|
||||
asm("sbc #%b", UIP_IPTCPH_LEN);
|
||||
|
@ -313,16 +313,16 @@ transport_chksum(u8_t protocol)
|
|||
#pragma optimize(pop)
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
u16_t
|
||||
uint16_t
|
||||
uip_tcpchksum(void)
|
||||
{
|
||||
return transport_chksum(IP_PROTO_TCP);
|
||||
#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_tmp = chksum();
|
||||
|
||||
chksum_ptr = (u16_t)uip_appdata;
|
||||
chksum_ptr = (uint16_t)uip_appdata;
|
||||
asm("lda _uip_buf+3+%b", UIP_LLH_LEN);
|
||||
asm("sec");
|
||||
asm("sbc #%b", UIP_IPTCPH_LEN);
|
||||
|
@ -416,16 +416,16 @@ uip_tcpchksum(void)
|
|||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
#if UIP_UDP_CHECKSUMS
|
||||
u16_t
|
||||
uint16_t
|
||||
uip_udpchksum(void)
|
||||
{
|
||||
return transport_chksum(IP_PROTO_UDP);
|
||||
#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_tmp = chksum();
|
||||
|
||||
chksum_ptr = (u16_t)uip_appdata;
|
||||
chksum_ptr = (uint16_t)uip_appdata;
|
||||
asm("lda _uip_buf+3+%b", UIP_LLH_LEN);
|
||||
asm("sec");
|
||||
asm("sbc #40");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue