CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

MOUSE USB

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
bardelli



Joined: 14 Oct 2007
Posts: 3

View user's profile Send private message

MOUSE USB
PostPosted: Sun Oct 14, 2007 7:16 pm     Reply with quote

Hello All..

I was look the ex_usb_mouse.c that comes with CCS PICC and i really dont know what this piece of code do:

out_data[0]=0; //button state goes here
out_data[1]=mouse_seq[x_seq];
out_data[2]=mouse_seq[y_seq];
out_data[3]=0; //wheel state goes here
if (usb_put_packet(1,out_data,4,USB_DTS_TOGGLE))

If you look the descriptor file, you will see the author configures a three button mouse. So, I dont know why he uses only out_data[0] to delivery information to the computer about the mouse buttons. I think it should be a 3 bit information [out_data[0], out_data[1], out_data[2]]

What is the whell state information?. If you check de descriptor file, there is nothing about it.

thanks...
libor



Joined: 14 Dec 2004
Posts: 288
Location: Hungary

View user's profile Send private message

PostPosted: Mon Oct 15, 2007 1:47 am     Reply with quote

out_data is an array of bytes, out_data[0] holds a byte = 8 bits. (enough for an 8 button mouse)
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group