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 />

qei_status( )<br />

Syntax: status = qei_status( );<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example Files:<br />

Also See:<br />

None<br />

The status of the QEI module.<br />

Returns the status of the QEI module.<br />

Devices that have the QEI module.<br />

Nothing.<br />

status = qei_status();<br />

None<br />

setup_qei() , qei_set_count() , qei_get_count().<br />

qsort( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

qsort (base, num, width, compare)<br />

base: Pointer to array of sort data<br />

num: Number of elements<br />

width: Width of elements<br />

compare: Function that compares two elements<br />

None<br />

Performs the shell-metzner sort (not the quick sort algorithm). The<br />

contents of the array are sorted into ascending order according to a<br />

comparison function pointed to by compare.<br />

All devices<br />

#INCLUDE <br />

Examples:<br />

int nums[5]={ 2,3,1,5,4};<br />

int compar(void *arg1,void *arg2);<br />

void main() {<br />

qsort ( nums, 5, sizeof(int), compar);<br />

}<br />

241

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

Saved successfully!

Ooh no, something went wrong!