This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: problem about interupt
- From: Jonathan Larmour <jlarmour at redhat dot com>
- To: li hui <lhbyron at yahoo dot com>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Thu, 29 Nov 2001 06:43:24 +0000
- Subject: Re: [ECOS] problem about interupt
- References: <20011121031221.38891.qmail@web14703.mail.yahoo.com>
li hui wrote:
>
> I try to write a mouse driver on ecos for i386 target.
> I set interupt vector as 5,and use DSR to response
> interupt.But to my surprise, it seem that DSR routine
> dosen't response the interupt at all. That's why?
> my program is below:
>
> #define MOUSE_BASE 0x300
> #define MOUSE_IRQ 5
> ........
> static int mouse_lookup()
> {
> .............
> printf("enter init\n");
> cyg_drv_interrupt_create ( MOUSE_IRQ, 99, 0, isr,
> mouse_interupt, &interupt_handle, &interupt_obj);
> cyg_drv_interrupt_attach (interupt_handle);
DOn't forget to unmask it.
And are global interrupts enabled?
> ..........
> }
> static void mouse_interupt(cyg_vector_t vector,
> cyg_ucount32 count, cyg_addrword_t data)
> {
> printf("enter DSR\n");
> .........
> }
> static cyg_uint32 isr(cyg_vector_t
> vector,cyg_addrword_t data)
> {
> printf("enter isr\n");
> return 1;
> }
>
> When I run the program above, it print neither "enter
> dsr" nor "enter isr"
Don't use printf from an ISR. It isn't safe. You can use diag_printf
though, by including <cyg/infra/diag.h>
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