Commit 75319f1e authored by Pfeiffer, Götz's avatar Pfeiffer, Götz
Browse files

This is the improvement of the old "lost irq patch".


This should make the old "lost irq patch" more stable. All three write
functions in ci.c now work very similar.

* The timeout for a detection of a lost IRQ for a write command now takes the
  CAN object timeout into account.
* ci_write now waits if a previous write is not yet finished. This allows
  ci_write to be called after a ci_writelater which was previously not
  recommended.
* All write functions now use function object_event in order to detect if the
  irq was executed.
* Function handle_interrupt_missing has now more debug information.
* A lost IRQ can now always be simulated by setting vcan_lcount or vcan4_lcount
  to a value different from 0.
* The timeout in bosi_sem_wait_tm is now always greater or equal timeout
  parameter.
parent febfc6b0
......@@ -582,7 +582,13 @@ BSTATIC void bosi_sem_wait(bosi_semaphore *sem)
BSTATIC void bosi_sem_wait_tm(bosi_semaphore *sem, int milliseconds)
#ifdef B_VXWORKS
{
semTake(*sem, (milliseconds*sysClkRateGet())/1000);
int time;
if (milliseconds<=0)
time=1;
else
time= (milliseconds*sysClkRateGet()+999)/1000;
semTake(*sem, time);
}
#endif
......
This diff is collapsed.
......@@ -1295,7 +1295,15 @@ STATUS VCANINFO(void)
if ((gptr!=NULL) && (drv_ret_code==OK))
printf("driver is initialized\n");
else
printf("driver is not initialized\n");
printf("driver is not initialized, "
"maybe you should call "
#ifndef VCAN4
"'vcan4info'"
#else
"'vcaninfo'"
#endif
"\n");
#ifndef VCAN4
vcan_ci_defines();
#else
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment