<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I'm trying use the mouse driver in the pc386
bsp.</FONT></DIV>
<DIV><FONT face=Arial size=2>I have:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>////////////////////////////////////////////////////////////////////////////////</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>/* List of device drivers loaded by RTEMS at boot
time */<BR>rtems_driver_address_table Device_drivers[] = <BR>{<BR>
CONSOLE_DRIVER_TABLE_ENTRY,<BR> CLOCK_DRIVER_TABLE_ENTRY,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>
SERIAL_MOUSE_DRIVER_TABLE_ENTRY,<BR>};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial
size=2>////////////////////////////////////////////////////////////////////////////////</FONT></DIV>
<DIV> </DIV>
<DIV>void GsSelect(void)<BR>{<BR> struct MW_UID_MESSAGE m;<BR> int
rc;</DIV>
<DIV> </DIV>
<DIV> /* let's make sure that the type is invalid */<BR> m.type =
MV_UID_INVALID;</DIV>
<DIV> </DIV>
<DIV> /* wait up to 100 milisecons for events */<BR> rc =
uid_read_message( &m, 100 );</DIV>
<DIV> </DIV>
<DIV> /* return if timed-out or something went wrong */<BR> if( rc
< 0 )<BR> {<BR> if( errno != ETIMEDOUT
)<BR> printf( " rc= %d, errno=%d\n",
rc, errno );<BR> return;<BR> }</DIV>
<DIV> </DIV>
<DIV> switch( m.type )<BR> {<BR> /* Mouse or Touch
Screen event */<BR> case MV_UID_REL_POS:<BR>
case MV_UID_ABS_POS:<BR> printf(
"Mouse: btns=%X, dx=%d, dy=%d, dz=%d\n",
<BR>
m.m.pos.btns, m.m.pos.x, m.m.pos.y, m.m.pos.z
);<BR> break;</DIV>
<DIV><BR> default: ;<BR> }<BR>}</DIV>
<DIV> </DIV>
<DIV>int rtems_ini()<BR>{<BR> int rc;</DIV>
<DIV> int mouse_fd;<BR><BR> /* if this is the first time around,
create the message queue */<BR> rc = uid_open_queue( Q_NAME, O_CREAT |
O_RDWR, Q_MAX_MSGS );</DIV>
<DIV> </DIV>
<DIV> mouse_fd = open( "/dev/mouse", O_NONBLOCK
);<BR> uid_register_device( mouse_fd, Q_NAME );<BR> </DIV>
<DIV> while( TRUE )<BR> {<BR>
GsSelect();<BR> } </DIV>
<DIV><BR> return 0;<BR>}</DIV></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>////////////////////////////////////////////////////////////////////////////////</DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I'm not receiving messages from the mouse. I
correctly configured the com port and mouse type.</FONT></DIV>
<DIV><FONT face=Arial size=2>An equivalent method works with the
keyboard.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Could someone help me with any tip? or example
code?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks</FONT></DIV>
<DIV><FONT face=Arial size=2>Jose Alves</FONT></DIV></BODY></HTML>