目前在做httpserver,发现发送小数据时没有问题,但当发送大数据量时,发现write函数,无法返回,一路跟踪下来发现卡死在
u32_t sys_arch_sem_wait(sys_sem_t sem, u32_t
timeout)
{
portTickType StartTime, EndTime, Elapsed;
StartTime = xTaskGetTickCount();
if( timeout != 0)
{
if( xSemaphoreTake( sem, timeout / portTICK_RATE_MS ) == pdTRUE )
{
EndTime = xTaskGetTickCount();
Elapsed = (EndTime - StartTime) * portTICK_RATE_MS;
return (Elapsed); // return time blocked TODO test
}
else
{
return SYS_ARCH_TIMEOUT;
}
}
else // must block without a timeout
{
while( xSemaphoreTake( sem, portMAX_DELAY ) != pdTRUE ){}
EndTime = xTaskGetTickCount();
Elapsed = (EndTime - StartTime) * portTICK_RATE_MS;
return ( Elapsed ); // return time blocked
}
}
一直获取不了信号量,不知为何?
不知原子哥,碰到过没有,有无好的解决方案,谢谢!!!