|
RtReleaseInterrupt releases an interrupt previously attached using RtAttachInterrupt. This breaks the association between a user's interrupt handling routine and the hardware interrupt. RtReleaseInterrupt is only supported in the RTSS environment. It cannot be called from a Windows application linked to RTX.
NOTE: This API call supersedes RtReleaseInterruptVector in RTSS. When writing RTSS applications, use RtReleaseInterrupt, instead of RtReleaseInterruptVector, which may be deprecated in the future.
Syntax
BOOL RtReleaseInterrupt(
HANDLE hInterrupt
);
Parameters
hInterrupt
An RTX-specific handle as returned by a preceding call to RtAttachInterrupt.
Return Values
TRUE if the function succeeds, FALSE if the argument was invalid or the operation on the handle did not succeed
Remarks
RtReleaseInterrupt breaks the association between a device interrupt and the user's handling routine. The user should take care to disable interrupt generation on the hardware device before making a call to this routine. Typically, this is done by writing to the command register of the device.
Unlike driver unloading, an RTX application can exit and leave a device enabled, with the device attempting to deliver interrupts to the handling thread. Although the RTX library usually cleans up after an application exits, there are times when the exiting application can bypass the library's attempt to detect the exit. To avoid such a condition, use RtReleaseInterrupt; it will release a previously attached interrupt.
Note: Just as in an interrupt service routine in a device driver, a real-time application must be able to acknowledge an interrupt and control the device that generated it. For further details on communicating with devices, see Physical Memory Mapping and Port IO.
Requirements
Header | Rtapi.h |
Library | Rtx_Rtss.lib |
See the IntelPro1000 topic for information on an example that uses the RtReleaseInterrupt function.
See Also: