This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re:Why this ps/2 mouse driver doesn't work
- From: "Q. jason" <ecos_fan at email dot com>
- To: ecos-discuss at sources dot redhat dot com
- Date: Wed, 19 Dec 2001 10:10:16 +0800
- Subject: [ECOS] 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 DSRCI 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