RtReleaseInterrupt

RtReleaseInterrupt releases an interrupt previously attached using RtAttachInterrupt. This breaks the association between a user's interrupt handling routine and the hardware interrupt.

Syntax

Copy
BOOL RtReleaseInterrupt(
                    [in]    HANDLE hInterrupt
            );

Parameters

[in] hInterrupt

An wRTOS-specific handle as returned by a preceding call to RtAttachInterrupt.

Return Value

TRUE if the function succeeds, FALSE if the argument was invalid or the operation on the handle did not succeed.

If the function succeeds, it returns TRUE. If the argument was invalid or the operation on the handle did not succeed, it returns FALSE.

Remarks

RtReleaseInterrupt breaks the association between a device interrupt and the user's handling routine. For line-based interrupts or message-based single vector interrupts, 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, a wRTOS application can exit and leave a device enabled, with the device attempting to deliver interrupts to the handling thread. Although the wRTOS 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: Like 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

Minimum supported version Header Library

wRTOS 1.0 SDK

RtssApi.h

Startup.lib

Example

See the IntelPro1000 topic for information on an example that uses the RtReleaseInterrupt function.

See Also: