SW500011 Microchip Technology, SW500011 Datasheet - Page 76

HI-TECH X PRO FOR PIC32

SW500011

Manufacturer Part Number
SW500011
Description
HI-TECH X PRO FOR PIC32
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC32r
Datasheet

Specifications of SW500011

No. Of User Licenses
1
Supported Families
PIC32
Core Architecture
PIC
Supported Hosts
Windows XP, Vista, Linux, Mac OS X
Software Edition
Professional
Kit Contents
Software And Docs
Tool Type
Compiler
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
PIC32 Series
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
032
778-1007
778-1007
Supported Data Types and Variables
incremented, but the same operation performed on a volatile object will load the W register with
1 and then store this to the appropriate address.
or assemby code.
3.3.10 Special Type Qualifiers
HI-TECH C PRO for the PIC32 MCU Family supports the special type qualifiers persistent, sfr
and cp0 to allow the user to control placement of static and extern class variables into particular
address spaces. If the PICC32 option, --STRICT is used, these type qualifiers are changed to
__persistent __sfr and __cp0. This type qualifier may also be applied to pointers. These types
of qualifiers may not be used on variables of class auto; if used on variables local to a function it
must be combined with the static keyword. For example, you may not write:
because intvar is of class auto. To declare intvar as a persistent variable local to function
test(), write:
Variables qualified as sfr or cp0 must also be 4-byte unsigned integers assigned an absolute address.
Additionally, variables qualifed as cp0 have other requirements as detailed below.
3.3.10.1 Persistent Type Qualifier
By default, any C variables that are not explicitly initialised are cleared to zero on startup. This is
consistent with the definition of the C language. However, there are occasions where it is desired for
some data to be preserved across resets or even power cycles (on-off-on).
In addition, any persistent variables will be stored in a different area of memory to other variables.
Persistent objects are placed within one of the non-volatile psects. If the persistent object is
also qualified near, it placed in the nvrram psect. Persistent bit objects are placed within the
nvbit psect. All other persistent objects are placed in the nvram psect.
76
Objects that are not qualified volatile may be removed by the compiler if they not used in C
The persistent type qualifier is used to qualify variables that should not be cleared on startup.
void test(void) {
}
static persistent int intvar;
persistent int intvar; /* WRONG! */
... other code ...
C Language Features

Related parts for SW500011