17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

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

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

Built-in Functions<br />

If "errno.h" is included then the domain and range errors are stored in the errno<br />

variable. The user can check the errno to see if an error has occurred and print<br />

the error using the perror function.<br />

Range error occur in the following case:<br />

exp: when the argument is too large<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example Files:<br />

Also See:<br />

All devices<br />

#INCLUDE <br />

// Calculate x to the power of y<br />

x_power_y = exp( y * log(x) );<br />

None<br />

pow(), log(), log10()<br />

ext_int_edge( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example Files:<br />

Also See:<br />

ext_int_edge (source, edge)<br />

source is a constant 0,1 or 2 for the PIC18XXX and 0 otherwise.<br />

Source is optional and defaults to 0.<br />

edge is a constant H_TO_L or L_TO_H representing "high to low" and "low to<br />

high"<br />

undefined<br />

Determines when the external interrupt is acted upon. The edge may be<br />

L_TO_H or H_TO_L to specify the rising or falling edge.<br />

Only devices with interrupts (<strong>PCM</strong> and <strong>PCH</strong>)<br />

Constants are in the devices .h file<br />

ext_int_edge( 2, L_TO_H); // Set up PIC18 EXT2<br />

ext_int_edge( H_TO_L ); // Sets up EXT<br />

ex_wakup.c<br />

#INT_EXT , enable_interrupts() , disable_interrupts() , Interrupts Overview<br />

177

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

Saved successfully!

Ooh no, something went wrong!