PWRM_registerNotify
2-328
PWRM_registerNotify returns one of the following constants as a status
value of type PWRM_Status:
Constraints and
Calling Context
❏
PWRM_registerNotify cannot be called from a SWI or HWI. This is
because PWRM_registerNotify internally calls MEM_alloc, which
may cause a context switch.
Example
/* client allows all setpoints */
#define ALLSETPOINTSALLOWED 0xFFFF
/* client doesn't allow lowest 4 setpoints */
#define SOMESETPOINTSALLOWED 0xFFF0
PWRM_NotifyHandle notifyHandle1;
PWRM_NotifyHandle notifyHandle2;
/* pointers to returned delayed completion fxns */
Fxn delayFxn1;
Fxn delayFxn2;
/* Client 1 registers pre-setpoint notification */
PWRM_registerNotify(PWRM_PENDINGSETPOINTCHANGE,
ALLSETPOINTSALLOWED, (Fxn)myNotifyFxn1,
(Arg)0x1111, ¬ifyHandle1, (Fxn *) &delayFxn1);
/* Client 2 registers post-setpoint notification */
PWRM_registerNotify(PWRM_DONESETPOINTCHANGE,
SOMESETPOINTSALLOWED, (Fxn)myNotifyFxn2,
(Arg)0x2222, ¬ifyHandle2, &delayFxn2);
Name
Usage
PWRM_SOK
The function was successfully registered.
PWRM_EFAIL
A general failure occurred.
PWRM_EINVALIDPOINTER
The operation failed because the notifyFxn,
notifyHandle or delayedCompletionFxn
parameter was NULL.
PWRM_EINVALIDEVENT
Operation failed because eventType is
invalid.