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

USB Example Code Compile Error

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



Joined: 22 May 2006
Posts: 9

View user's profile Send private message

USB Example Code Compile Error
PostPosted: Mon May 22, 2006 8:08 pm     Reply with quote

Hi,

I have just been trying to get the CCS USB example code compiled and I am getting the following errors. My C is a little rusty but as they are examples I thought that perhaps someone else had come across this before.

Could someone explain the 'Warrning 216' messages? Line 240 is the end of file.

I am using CCS 3.233

Thanks in advance

Matt

Executing: "C:\Program files\Picc\CCSC.exe" "ex_usb_mouse.c" +FH +DF +LN +T -A +M +Z +Y=9 +EA
>>> Warning 203 "C:\...\pic18_usb.h" Line 416(1,1): Condition always TRUE
>>> Warning 203 "C:\...\ex_usb_mouse.c" Line 220(1,1): Condition always TRUE printf
>>> Warning 216 "C:\...\ex_usb_mouse.c" Line 240(0,1): Interrupts disabled during call to prevent re-entrancy: usb_token_reset delay_ms
>>> Warning 216 "C:\...\ex_usb_mouse.c" Line 240(0,1): Interrupts disabled during call to prevent re-entrancy: usb_flush_in
Memory usage: ROM=13% RAM=21% - 23%
0 Errors, 4 Warnings.

Executing: "C:\Program files\Picc\CCSC.exe" "USB.C" +FH +DF +LN +T -A +M +Z +Y=9 +EA
*** Error 128 "C:\...\usb.h" Line 259(1,11): A #DEVICE required before this line
Halting build on first failure as requested.
BUILD FAILED: Tue May 23 11:53:03 2006
PCM programmer



Joined: 06 Sep 2003
Posts: 21537

View user's profile Send private message

PostPosted: Mon May 22, 2006 8:38 pm     Reply with quote

Don't add USB.C to the MPLAB project. There must be only one C
source file in the project. All other files must be #include files.
Your Project window should look like this:
Code:

-Ex_usb_mouse.mcp
  - Source Files
     - Ex_usb_mouse.c
  -Header Files
     - 18F4550.h
     - pic18_usb.h
     - usb.h
     - usb_desc_mouse.h
  -Other Files

This assumes that you selected 18F4550 as the PIC to use, in the MPLAB
project wizard.

Just turn off the warnings. Go to the Project /Build Options menu in
MPLAB. Select the project name (Ex_usb_mouse) and a pop-up window
will appear. Un-check the box for "Show warnings".
mbro131



Joined: 22 May 2006
Posts: 9

View user's profile Send private message

interrupt warnings
PostPosted: Mon May 22, 2006 8:45 pm     Reply with quote

Ahh thats better. Should I be concerned about the 'Interrupts disabled during call to prevent re-entrancy' warnings?

Does this basically mean that the compiler disables interupts until these routines are finished? and if so should I be doing this explicitly?

Matt
PCM programmer



Joined: 06 Sep 2003
Posts: 21537

View user's profile Send private message

PostPosted: Mon May 22, 2006 10:05 pm     Reply with quote

The usb_token_reset() function is called by:
usb_isr_rst()
usb_detach()
usb_attach()

The usb_task() function calls usb_attach(). This call is made outside
of an interrupt service routine.

The usb_isr() function calls usb_isr_rst(). This call is made from
within the #int_usb interrupt service routine.

There is only one instance of the usb_token_reset() function and it
is not re-entrant. Therefore, the compiler automatically inserts code
at compile-time to disable interrupts while usb_token_reset() is
executing.
mbro131



Joined: 22 May 2006
Posts: 9

View user's profile Send private message

PostPosted: Mon May 22, 2006 10:08 pm     Reply with quote

Thankyou for clearing that up for me, much appreciated

Matt
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