This API can be used to change the period and/or phase of a task's existing periodic trigger timer. If the task has no periodic trigger timer (always the case for a program's main() thread), one will be allocated by this API provided that the
period input parameter is non-zero and one kernel object is still available for this purpose.
The time of the first trigger timer action resulting from this call (assuming
period non-zero) will be immediately unless the RTX_TA_SET_PHASE flag is set in the
attributes parameter. When RTX_TA_SET_PHASE flag is set the initial delay before trigger will be calculated as follows, depending on the RTX_TA_PERIOD_RTI flag.
With RTX_TA_PERIOD_RTI flag set:
delay_rti = (RtxInternal.rtxTickRti + phase - phaseRef) % period ;
delay_ms = (RtxInternal.rtxTickms + phase - phaseRef) % period ;
|taskId ||Task handle specifying which task to act on. This argument can be set to zero to indicate the current task. |
|period ||New task period in either milliseconds or RTI ticks, depending on selected |
attributes flags. Set this to zero to stop a periodic task's trigger timer.
|attributes ||This bitwise OR'ed combination of flags shares several of the flags used by the tkdAttr structure member at task creation time. These flags are:|
RTX_TA_PERIODIC - This flag is required.
RTX_TA_CATCH_UP - Trigger mode option for operation under high CPU loads.
phase arguments are in units of RTI instead of the default milliseconds.
RTX_TA_SET_PHASE - Use the
phaseRef arguments to set the task's trigger phase to a particular offset relatve to a
phaseRef datum so that it will have desired firing position relative to other tasks.
|phase ||Optional phase offset to align task execution on. Units are same as the |
period. This parameter is ignored if the RTX_TA_SET_PHASE flag is not set in the
|phaseRef ||Optional datum to reference phase offset to. This parameter is ignored if the RTX_TA_SET_PHASE flag is not set in the |
- Zero on success, else error code.
- This API is not available in the SC1x, SC2x and SC1x3 C-Library.
- SC2x3 V1.00 - CLIB V1.00