This is the mail archive of the ecos-discuss@sources.redhat.com 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]

Re: Double buffers using US_RPR and US_RCR


Eric de Jong wrote:
> Alright, It took a while before I figured it out, but I think your code
> works as follows:
>
> ISR:
> - receive 1 character, store the character in a buffer
> - disable receive interrupt
> - start the PDC engine to store any further characters
> - trigger DPC
>
> DPC:
> - stops PDC engine, process all received characters
> - reenable receive interrupt

Not quite. Interrupts are re-enabled _before_ the data just received
is processed. So any data arriving during this time is not lost.

>
> As the first character is received in the ISR and not in the DPC as it used
> to be, the latency is smaller. However, if another interrupt is handled
> first, it is still possible to miss characters. Would the following code
> not do exactly the same? I know interrupts are not enabled for the ARM
> target during DPC, but it should. Else there is no need for a DPC anyway
> (please correct me if I am wrong, I am not up-to-date).
>

A DPC (actually called a DSR in ecos terminology) is required in any case,
because the callbacks into the hardware-independent driver module cannot
be executed from interrupt context.

> ISR:
> - receive 1 character, store the character in a circular buffer, increase
> count - trigger DPC
>
> DPC: (ISR stays enabled)
> - copy circulair buffer
> - disable interrupts, decrease count, enable interrupts
> - process data
>
Would probably work, but causes more CPU load by requiring an interrupt for
every single character even at high baud rates, while not giving any speed
advantage. My patch aims at reducing the interrupt load when using fast
transmission (high baud rates), while still maintaining responsiveness at
lower speeds.

tk 
--------------------------------------------------

Thomas Koeller, Software Development

Basler Vision Technologies
An der Strusbek 60-62
22926 Ahrensburg
Germany

Tel +49 (4102) 463-162
Fax +49 (4102) 463-239

mailto:thomas.koeller@baslerweb.com
http://www.baslerweb.com

==============================


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


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