товарищ столкнулся с сабжевой проблемой, покопался в драйвере компорта и нашёл неплохое решение - в коде в 8250.с есть строчки:
Цитата
mod_timer(&up->timer, jiffies + poll_timeout(up->port.timeout) + HZ/5);
и
poll_timeout(up->port.timeout) + HZ/5);
я моём случае меняем на
Цитата
mod_timer(&up->timer, jiffies + poll_timeout(up->port.timeout) + HZ/200);
и
poll_timeout(up->port.timeout) + HZ/200);
и получаем строб в 20 мс, который накрывает посылку длящуюся 9-10мс, с такими показателями можно жить.
товарищ поставил отключение строба прямо в драйвере ... я пока что отключаю после отправки write
Цитата
fd = open("/dev/mem", O_RDWR);
map = mmap(0, getpagesize(), PROT_READ, MAP_SHARED, fd, UnLSR_BASE_ADDR);
if (map == MAP_FAILED)
{
#ifdef DEBUG
printf("Error mmapping the file");
setP01(1,13, 0);
#endif
return 0;
}
data = 1;
//ждём когда в отправляющем буфере появятся данные
goal = 10 * CLOCKS_PER_SEC / 1000 + clock();
while(data)
{
data = (U3LSR)&(1<<6);
res = (U3LSR);
#ifdef DEBUG
printf("\ndata =%x",res);
#endif
if(goal < clock())
{
#ifdef DEBUG
printf("outbuf timeout");
#endif
setP01(1,13, 0);
return 1;
}
}
//------------------------------------------------
#ifdef DEBUG
printf("\n");
#endif
//ждём когда из отправляющего буфера данные уйдут
goal = 10 * CLOCKS_PER_SEC / 1000 + clock();
while(!data)
{
data = (U3LSR)&(1<<6);
res = (U3LSR);
#ifdef DEBUG
printf("\nres =%x",res);
#endif
if(goal < clock())
{
#ifdef DEBUG
printf("sendbuf timeout");
#endif
setP01(1,13, 0);
return 1;
}
}
setP01(1,13, 0);
//------------------------------------------------
if (munmap(map, getpagesize()) == -1)
{
#ifdef DEBUG
perror("Error un-mmapping the file");
#endif
}
close(fd);
Сообщение отредактировал andybeg - Jul 16 2010, 06:35