From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18463 invoked by alias); 5 Feb 2009 18:29:32 -0000 Received: (qmail 18434 invoked by uid 22791); 5 Feb 2009 18:29:30 -0000 X-SWARE-Spam-Status: No, hits=-0.2 required=5.0 tests=AWL,BAYES_50 X-Spam-Check-By: sourceware.org Received: from elasmtp-mealy.atl.sa.earthlink.net (HELO elasmtp-mealy.atl.sa.earthlink.net) (209.86.89.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Feb 2009 18:29:25 +0000 Received: from [75.82.39.242] (helo=PAULD) by elasmtp-mealy.atl.sa.earthlink.net with esmtpa (Exim 4.67) (envelope-from ) id 1LV8yY-00025W-JF for ecos-discuss@ecos.sourceware.org; Thu, 05 Feb 2009 13:29:23 -0500 From: "Paul D. DeRocco" To: "eCos Discuss" Date: Thu, 05 Feb 2009 18:29:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit In-Reply-To: <2a382c6e0902050650w4f59a9a9m4f5d594596694ef9@mail.gmail.com> X-ELNK-Trace: bd7d5d4e6f8f652c74cfc7ce3b1ad11381c87f5e519606883f51921068a5da006cb4fdc4d3a561b3350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: RE: [ECOS] how to handle missed interrupt issue? X-SW-Source: 2009-02/txt/msg00030.txt.bz2 @ix.netcom.com > From: Dave Milter > > 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? This shouldn't happen. Is it possible that your interrupt source generates a pulse, and your interrupt input is level-sensitive? That's a recipe for lost interrupts. I have no idea why you need to change the buffer pointer, but one alternative is to have the interrupt handler do that for you, in response to setting some request flag in the application. -- Ciao, Paul D. DeRocco Paul mailto:pderocco -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss