PWRM_changeSetpoint
2-312
PWRM_changeSetpoint disables SWI and TSK scheduling when it
begins making a change. However, HWIs may run during the notification
process. After the setpoint has been changed, SWI and TSK scheduling
is re-enabled, and a context switch occurs only if some other thread has
since been made ready to run.
Constraints and
Calling Context
❏
PWRM_changeSetpoint cannot be called from an HWI.
❏
This API cannot be called from a program’s main() function.
❏
PWRM_changeSetpoint can be called from a SWI only if
notifyTimeout is 0.
Example
#define TIMEOUT 10 /* timeout for notifications */
PWRM_Status status;
Int i;
status = PWRM_changeSetpoint(i, TIMEOUT);
if (status == PWRM_SOK) {
LOG_printf(TRACE, "New setpoint = %d", i);
}
else if (status == PWRM_ENOTSUPPORTED) {
LOG_printf(TRACE, "Setpoint %d unsupported", i);
}
else {
LOG_printf(TRACE, "Error: status = %x", status);
return;
}