17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Built-in Functions<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example Files:<br />

Also See:<br />

No value<br />

The jump_to_isr function is used when the location of the interrupt service<br />

routines are not at the default location in program memory. When an<br />

interrupt occurs, program execution will jump to the default location and<br />

then jump to the specified address.<br />

All devices<br />

Nothing<br />

int_global<br />

void global_isr(void) {<br />

jump_to_isr(isr_address);<br />

}<br />

ex_bootloader.c<br />

#BUILD<br />

kbhit( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

value = kbhit()<br />

value = kbhit (stream)<br />

stream is the stream id assigned to an available RS232 port. If the stream<br />

parameter is not included, the function uses the primary stream used by<br />

getc().<br />

0 (or FALSE) if getc() will need to wait for a character to come in, 1 (or TRUE)<br />

if a character is ready for getc()<br />

If the RS232 is under software control this function returns TRUE if the start<br />

bit of a character is being sent on the RS232 RCV pin. If the RS232 is<br />

hardware this function returns TRUE if a character has been received and is<br />

waiting in the hardware buffer for getc() to read. This function may be used to<br />

poll for data without stopping and waiting for the data to appear. Note that in<br />

the case of software RS232 this function should be called at least 10 times<br />

the bit rate to ensure incoming data is not lost.<br />

All devices.<br />

#USE RS232<br />

Examples:<br />

char timed_getc() {<br />

long timeout;<br />

timeout_error=FALSE;<br />

211

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

Saved successfully!

Ooh no, something went wrong!