INtime SDK Help
CILLIntSemaphoreHandler
This topic contains these sections:

This class is only available in the RT environment. It has been derived from CIIntHandler to ease the creation of an interrupt handler that processes interrupts by sending a unit to a low level semaphore. It must be used to derive an application specific semaphore interrupt handler class, or it can be used directly to control an interrupt handler object.

The class contains a static call that acts as an interrupt handler. When deriving from the CILLIntSemaphoreHandler class and overruling the handler, care should be taken in obeying all rules on the contents of such a handler.

Class members

Constructor

Destructor

Create

Release

Member variables

The following member variables are only available to the members of the class and its derived classes:

CILLSemaphore * m_pSem;

Inherited functions

All functions inherited from CIIntHandler can be used, although OnSignal implements the low level semaphore interface and is therefore essential. The Attach, Detach and Lookup functions cannot be used.

CILLIntSemaphoreHandler::Constructor

The constructor has no arguments. It does not install an interrupt handler yet.

CILLIntSemaphoreHandler::Destructor

The destructor removes the interrupt handler from the level, if one had been installed.

CILLIntSemaphoreHandler::Create

If a handler is currently installed, it is first removed. Then this call installs a new interrupt handler for the given level. Note that this call does not create any RT object and also does not catalog any name.

Syntax

DWORD CILLIntSemaphoreHandler::Create(
    WORD wLevel,
    CILLSemaphore * pSem
);

Parameters

wLevel
Indicates the level for the interrupt to be serviced (specified as one of the values IRQ0_LEVEL up to IRQ15_LEVEL).
pSem
Defines the low level semaphore. The result is a status indicating success or failure.

Status

E_OK
No exceptional conditions occurred.
E_PARAM
wLevel has a bad value, or pSem does not point to an attached low level semaphore.
E_CONTEXT
The interrupt level already has a handler.

CILLIntSemaphoreHandler::Release

CILLIntSemaphoreHandler::Release is called by the framework when an interrupt has occurred and a unit must be released; it should never be called explicitly. Inside this call scheduling has been stopped, so calls like releasing to a low level semaphore are allowed; do not use the address of a local variable inside this call and do not call any call that uses such an address. CILLIntSemaphoreHandler::Send releases one unit to the low level semaphore. When overruling this call, there is no need to call the default call.

Syntax

void CILLIntSemaphoreHandler::Release(void);
See Also

Interrupts