SW500009 Microchip Technology, SW500009 Datasheet - Page 88

HI-TECH FOR DSPIC/PIC24

SW500009

Manufacturer Part Number
SW500009
Description
HI-TECH FOR DSPIC/PIC24
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC24 & DsPICr
Datasheet

Specifications of SW500009

Supported Families
PIC24
Core Architecture
PIC, DsPIC
Software Edition
Standard
Kit Contents
Software And Docs
Tool Type
Compiler
Mcu Supported Families
PIC24 MCUs And DsPIC DSCs
Lead Free Status / RoHS Status
Not applicable / RoHS Compliant
For Use With/related Products
DSPIC3X/PIC24
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
025
778-1003
778-1003
Preprocessing
3.12.3.4 The #pragma printf_check Directive
Certain library functions accept a format string followed by a variable number of arguments in the
manner of printf(). Although the format string is interpreted at runtime, it can be compile-time
checked for consistency with the remaining arguments.
includes the directive #pragma printf_check(printf) const to enable this checking for printf().
You may also use this for any user-defined function that accepts printf-style format strings. The
qualifier following the function name is to allow automatic conversion of pointers in variable argu-
ment lists. The above example would cast any pointers to strings in RAM to be pointers of the type
(const char *)
See Section 2.4.55.
3.12.3.5 The #pragma psect Directive
Normally the object code generated by the compiler is broken into the standard psects as described
in Section 3.9.1. This is fine for most applications, but sometimes it is necessary to redirect variables
or code into different psects when a special memory configuration is desired. Code and data for any
of the standard C psects may be redirected using a #pragma psect directive.
and instructs the code generator that anything that would normally appear in the compiler-generated
psect default_psect, will now appear in a new psect called new_psect. This psect will be
identical to default_psect in terms of its options, however will have a different name. Thus,
this new psect can be explicitly positioned by the linker without affect the original psect’s location.
text2, then the placeholder %%u should be used in the name of the psect at the position of the counter,
e.g. text%%u. Any default psect, regardless of the counter value, will match such a psect name.
redirected once in a particular module. All psect redirections for a particular module should be
placed at the top of the source file, below any #include statements and above any other declarations.
program. Using the #pragma psect directive in the source code, and adding a new linker option can
do this. First write the function in the usual way. Place the function definition in a separate module.
There is obviously something special about this function so a module all to itself is probably a good
idea anyway.
74
This directive enables this checking for the named function, e.g. the system header file <stdio.h>
Note that the warning level must be set to -1 or below for this option to have any visible effect.
The general form of this pragma looks like:
If the name of the default psect that is being redirected contains a counter, e.g. text0, text1,
This pragma remains in force until the end of the module and any given psect should only be
A particular function, called read_port(), needs to be located at the absolute address 0x400 in a
#pragma psect default_psect=new_psect
C Language Features

Related parts for SW500009