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: question about interrupt service?


li hui wrote:
> 
> I had tried to revise my code,but it still failed to
> response interrupt! I set my mouse on com2, My code is
> below, please give me some advice to let it run.

> static int mouse_lookup()
> {
>         if (mouse_user++)
>         {
>                 return 0;
>         }
>         /****************************/
>         /*****omit request IRQ ******/
>         /****************************/
>         /******ecos IRQ**************/
> 
>     vga_setmode(G360x480x256);
> 
>         diag_printf("enter init\n");

Is this actually printed?
 
> static void mouse_interupt(cyg_vector_t vector,
> cyg_ucount32 count, cyg_addrword_t data)
> {
>         //vga_setcolor(15);
>         //vga_drawpixel(50,50+ticks*5);
>          diag_print("in DSR\n);
> }

You can't have compiled this code. diag_print isn't the right name! It
should be diag_printf.

Maybe the mouse port doesn't generate interrupts until it is directly
enabled (e.g. by sending something) in some way. Consult a PC Hardware
book.

Also compile eCos with assertions enabled and link your app with that. That
may tell you about any other problems. For example if you have the
interrupt wrong, it will probably tell you "Spurious interrupt".

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]