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: problem about interupt


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


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