11.07.2015 Views

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

DSPICC Compiler OptionsDSPICC Command-line Driver2.4.38 --PROTO: Generate PrototypesThe --PROTO option is used to generate .pro files containing both ANSI and K&R style functiondeclarations for all functions within the specified source files. Each .pro file produced will havethe same base name as the corresponding source file. Prototype files contain both ANSI C-styleprototypes and old-style C function declarations within conditional compilation blocks.The extern declarations from each .pro file should be edited into a global header file which isincluded in all the source files comprising a project. The .pro files may also contain static declarationsfor functions which are local to a source file. These static declarations should be edited intothe start of the source file. To demonstrate the operation of the --PROTO option, enter the followingsource code as file test.c:#include add(arg1, arg2)int * arg1;int * arg2;{return *arg1 + *arg2;}void printlist(int * list, int count){while (count--)printf("%d ", *list++);putchar(’\n’);}If compiled with the command:DSPICC --CHIP=30F6014 --PROTO test.cDSPICC will produce test.pro containing the following declarations which may then be edited asnecessary:18/* Prototypes from test.c *//* extern functions - include these in a header file */#if PROTOTYPESextern int add(int *, int *);extern void printlist(int *, int);#else /* PROTOTYPES */extern int add();

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!