[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] what wrong with my tcp?
From: |
乔崇 |
Subject: |
Re: [lwip-users] what wrong with my tcp? |
Date: |
Sun, 9 Nov 2003 10:1:41 +0800 |
lwip-usersDear Sir:
I use ucos-ii.
///////////////////////////////////
struct sys_timeouts * sys_arch_timeouts(void)
{
u8_t curr_prio;
s16_t err,offset;
null_timeouts.next = NULL;
//get current task prio
err = OSTaskQuery(OS_PRIO_SELF,&curr_task_pcb);
curr_prio = curr_task_pcb.OSTCBPrio;
offset = curr_prio - LWIP_START_PRIO;
//not called by a lwip task ,return timeouts->NULL
if(offset < 0 || offset >= LWIP_TASK_MAX)
{
return &null_timeouts;
}
return &lwip_timeouts[offset];
}
u32_t sys_arch_sem_wait(sys_sem_t sem, u32_t timeout)
{
u8_t err;
u32_t ucos_timeout;
u32_t now;
ucos_timeout = 0;
if(timeout != 0){
ucos_timeout = (timeout * OS_TICKS_PER_SEC)/1000;
if(ucos_timeout < 1)
ucos_timeout = 1;
else if(ucos_timeout > 65535)
ucos_timeout = 65535;
}
now=OSTimeGet();
OSSemPend ((OS_EVENT *)sem,(u16_t)ucos_timeout, (u8_t *)&err);
if(err == OS_TIMEOUT)
return SYS_ARCH_TIMEOUT;
else
return (OSTimeGet()-now)*1000/OS_TICKS_PER_SEC;
}
////////////////////////////////////
I wrongly set LWIP_START_PRIO 6,set tcpip_thread prio 5.So
if(offset < 0 || offset >= LWIP_TASK_MAX)
{
return &null_timeouts;
}
It's my fault.The lwip is ok.
qiaochong
address@hidden
2003-11-09