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:Why this ps/2 mouse driver doesn't work


I can describe what I did:
1)I defined a structure for my mouse driver.
   typedef struct Ps2Mouse {
	bool has_wheel;
	int x, y, xmax, xmin, ymax, ymin, wheel;
	CYG_WORD32 buttons;
	int            int_num;
    cyg_interrupt  mouse_interrupt;
    cyg_handle_t   mouse_interrupt_handle;
   } Ps2Mouse;
2)I allocated IRQ12 to my mouse.
    ps2mouse.int_num=44; //12+32
3)When the device was initializing,I create the interrupt as below:
	cyg_drv_interrupt_create(mouse->int_num,
                          99,
                          (cyg_addrword_t)mouse,
                          ps2Isr,
                          ps2dsr,
                          &mouse->mouse_interrupt_handle,
                          &mouse->mouse_interrupt);
        cyg_drv_interrupt_attach(mouse->mouse_interrupt_handle);
        cyg_drv_interrupt_unmask(mouse->int_num);
4)In ISR ,I mask the interrupt as below:
	cyg_drv_interrupt_mask(mouse->int_num);
    	cyg_drv_interrupt_acknowledge(mouse->int_num);
	return CYG_ISR_CALL_DSR;
5)At the end of DSRCI unmask the interrupt:
	    cyg_drv_interrupt_unmask(mouse->int_num);

Does anything above wrong? My ps2 mouse doesn't respond to interput.
Thank you.
-- 

_______________________________________________
1 cent a minute calls anywhere in the U.S.!

http://www.getpennytalk.com/cgi-bin/adforward.cgi?p_key=RG9853KJ&url=http://www.getpennytalk.com




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