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

18F4550 USB

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



Joined: 11 Oct 2017
Posts: 141

View user's profile Send private message

18F4550 USB
PostPosted: Sat Jul 06, 2019 8:24 pm     Reply with quote

What is the difference between 'while(!usb_put_packet...' and 'usb_put_packet...' ?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jul 07, 2019 2:54 am     Reply with quote

Quote:
while(!usb_put_packet...

It means:
Stay in the while() loop until the PIC successfully sends a USB packet.
If the PIC sent the packet OK, then exit the while() loop.
vtrx



Joined: 11 Oct 2017
Posts: 141

View user's profile Send private message

PostPosted: Mon Jul 08, 2019 9:32 am     Reply with quote

Is there any advantage or performance in using one or other?
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Jul 08, 2019 9:58 am     Reply with quote

well....
IF the PIC stays in the while loop unitl the USB packet is sent, it could stay there FOREVER should the USB hardware or 'other computer' crashes. There's probably 100 or more scenarios that will keep the PIC 'twiddling thumbs' with a bad USB connection.....

Jay
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