This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

how to handle missed interrupt issue?


Hello.

Some days ago I started development of ecos's driver for some device
which compatible with ARINC 429.
Processor is belong to ARM9 family, freq is 200Mhz.

The logic is simple. Driver has circular buffer, and when it receive
from device interrupt, which means that it ready
to go, driver send to device next 32bit word, then it recieves next
interrupt and send next word and so on.
When driver sends all characters from circular buffer, it start from
begining of buffer.

Now I want implement function to change circular buffer pointer,
but if I do such simple thing:
cyg_drv_isr_lock()
change pointer
cyg_drv_isr_unlock()

there is probability that I lost interrupt between cyg_drv_isr_lock()
and cyg_drv_isr_unlock(),
and this of cause a problem, I willl wait interrupt and it never happens.

I imagine such scheme:

isr handler each time call dsr handler (via return value),
dsr signal via condition variable about interrupt,

when I want to change pointer to circular buffer, I do
wait on condition variable, and then disable interrupt, change my
pointer and enable interrupt.

This will works, because of maximum bit rate  of ARINC 429 is 100Kb/s, and
before next interrupt I have many time to disable/enable interrupts.

But may be there is more clever way to handle such case?

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]