pasini
Joined: 12 Dec 2005 Posts: 50 Location: Curitiba - Brazil
|
PIC18F4550 + USB + HeaderFiles |
Posted: Wed Jun 21, 2006 12:33 pm |
|
|
Hi,
PIC18F4550 MPLAB 7.10 CCS3.235
I initialize the usb CDC driver in the main routine inside code.c file, which calls a library show.h. Inside this library I have a Code: | printf(usb_cdc_putc,"x_axis = %5lu alfa = %f v_x = %f \n\r",x_axis, alfa, v_x); | .
The problem is that the copiler does not find the usb_cdc_putc pointer inshow.h because it was not declared in this file, and receive a Quote: | : Undefined identifier usb_cdc_putc | error.
How or where do I declare the pointer usb_cdc_putc inside show.h so that I can use both the code.c and show.h files without any problem ?
What do I have to change in the code.c main routine ?
Thanks for any help.
Pasini |
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jun 21, 2006 1:08 pm |
|
|
usb_cdc_putc is the name of a function, and it's declared in the
USB_CDC.H file, which is in this folder:
c:\program files\picc\drivers
Just include the usb_cdc.h file in your program with an #include statement.
Look at these two CCS example files. The both have an #include
statement for the usb_cdc.h file.
c:\program files\picc\examples\ex_usb_serial.c
c:\program files\picc\examples\ex_usb_serial2.c |
|