EasyManuals Logo

Texas Instruments TMS320 User Manual

Texas Instruments TMS320
288 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #272 background imageLoading...
Page #272 background image
Closing Devices
7-42
Example 7.31. Closing a Device (continued)
The arguments to Dxx_idle are:
DEV_Handle device; /* driver handle */
Bool flush; /* flush indicator */
The device parameter is, as usual, a pointer to a DEV_Obj for this instance
of the device. flush is a boolean parameter that indicates what to do with any
pending data while returning the device to its initial state.
For a device in input mode, all pending data is always thrown away, since
there is no way to force a task to retrieve data from a device. Therefore, the
flush parameter has no effect on a device opened for input.
For a device opened for output, however, the flush parameter is significant. If
flush is TRUE, any pending data is thrown away. If flush is FALSE, the
Dxx_idle function does not return until all pending data has been rendered.
/*
* Don't simply SEM_reset the count here. There is a
* possibility that the HWI had just completed working on a
* buffer just before we checked, and we don't want to mess
* up the semaphore count.
*/
while (post_count > 0) {
SEM_post(objptr->sync);
post_count--;
}
}
else {
/* dev->mode = DEV_INPUT or flush was requested */
`stop the device`
/*
* do standard idling, place all frames in fromdevice
* queue
*/
while (!QUE_empty(device->todevice)) {
QUE_put(device->fromdevice,
QUE_get(device->todevice));
SEM_post(objptr->sync);
}
}
return (SYS_OK);
}

Table of Contents

Other manuals for Texas Instruments TMS320

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320 and is the answer not in the manual?

Texas Instruments TMS320 Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320
CategoryComputer Hardware
LanguageEnglish

Related product manuals