This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Enable EDB7xxx interrupts
- To: "Trenton D. Adams" <tadams at extremeeng dot com>
- Subject: Re: [ECOS] Enable EDB7xxx interrupts
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Mon, 25 Jun 2001 20:28:14 +0100
- Cc: 'Gary Thomas' <gthomas at cambridge dot redhat dot com>,"'Lewin A.R.W. Edwards'" <larwe at larwe dot com>,'eCos discussion' <ecos-discuss at sources dot redhat dot com>
- Organization: Red Hat UK Ltd.
- References: <000901c0fda7$76f3aa60$090110ac@TRENT>
"Trenton D. Adams" wrote:
>
> >
> > Did you use the create_interrupt() mechanism to attach to
> > this interrupt? If not, the system will see it, treat it as
> > spurious and simply clear and ignore it.
>
> I do the following in cyg_user_start ()
> cyg_interrupt_enable ();
No need to do this. In fact probably best not to. It'll be done later when
the scheduler starts.
> cyg_interrupt_create (CYGNUM_HAL_INTERRUPT_EINT1, 99, 0,
> InterruptHandler, 0, &hIntr, &intr);
> cyg_interrupt_attach (hIntr);
> cyg_interrupt_acknowledge(CYGNUM_HAL_INTERRUPT_EINT1);
> cyg_interrupt_unmask(CYGNUM_HAL_INTERRUPT_EINT1);
>
> Inside InterruptHandler () I do the following
> cyg_interrupt_mask (CYGNUM_HAL_INTERRUPT_EINT1);
> cyg_interrupt_acknowledge (CYGNUM_HAL_INTERRUPT_EINT1);
> printf ("Interrupt Occured");
> cyg_interrupt_unmask (CYGNUM_HAL_INTERRUPT_EINT1);
You shouldn't need to mask or unmask it because global interrupts are
disabled in ISRs.
> Then I have a thread that continuously prints out the PCMCIA controller
> interrupt information.
>
> Anyhow, the printf () in the interrupt handler never occurs. What could
> be wrong?
A missing \n? For an interrupt handler it is _lots_ better to use
diag_printf from <cyg/infra/diag.h>. printf is not interrupt safe.
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions http://www.redhat-techworld.com/