PCDIDE COMPILER Custom Computer Services Inc (CCS), PCDIDE COMPILER Datasheet - Page 347

PCD C-COMPILER PIC24, DSPIC

PCDIDE COMPILER

Manufacturer Part Number
PCDIDE COMPILER
Description
PCD C-COMPILER PIC24, DSPIC
Manufacturer
Custom Computer Services Inc (CCS)
Type
Compilerr
Datasheet

Specifications of PCDIDE COMPILER

For Use With/related Products
Microchip PIC24/dsPIC®
Lead Free Status / RoHS Status
Not applicable / Not applicable
Other names
429-1008
How do I make a pointer to a function?
The compiler does not permit pointers to functions so that the compiler can know at compile time
the complete call tree. This is used to allocate memory for full RAM re-use. Functions that could not
be in execution at the same time will use the same RAM locations. In addition since there is no
data stack in the PIC®, function parameters are passed in a special way that requires knowledge at
compile time of what function is being called. Calling a function via a pointer will prevent knowing
both of these things at compile time. Users sometimes will want function pointers to create a state
machine. The following is an example of how to do this without pointers:
enum tasks {taskA, taskB, taskC};
run_task(tasks task_to_run) {
}
How do I write variables to EEPROM that are not a word?
The following is an example of how to read and write a floating point number from/to EEPROM.
The same concept may be used for structures, arrays or any other types.
WRITE_FLOAT-EEPROM(int16 n, float data) {
float READ_FLOAT_EEPROM(int16 n) {
}
switch(task_to_run) {
case taskA : taskA_main();
case taskB : taskB_main();
case taskC : taskC_main();
}
• n is an offset into the EEPROM
write_eeprom(n, data, sizeof(float));
}
float data;
(int32)data = read_eeprom(n, sizeof(float));
return(data);
break;
break;
break;
333

Related parts for PCDIDE COMPILER