IPC@CHIP® RTOS-PPC – API Documentation

Header image

Main page


RTX_EC RTX_GearChg ( RTX_ID  taskId,
DWORD  period,
DWORD  attributes,
DWORD  phase,
DWORD  phaseRef 
)

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 ;

Otherwise:

    delay_ms = (RtxInternal.rtxTickms + phase - phaseRef) % period ;

Parameters:
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.
  • RTX_TA_PERIOD_RTI - period and phase arguments are in units of RTI instead of the default milliseconds.
  • RTX_TA_SET_PHASE - Use the phase and 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 attributes argument.
phaseRef Optional datum to reference phase offset to. This parameter is ignored if the RTX_TA_SET_PHASE flag is not set in the attributes argument.
Returns:
Zero on success, else error code.
Compatibility:
This API is not available in the SC1x, SC2x and SC1x3 C-Library.
Since:
SC2x3 V1.00 - CLIB V1.00





Top of page | Main page

Copyright © 2017 Beck IPC GmbH
Generated on Thu Jan 26 16:21:37 2017 by Doxygen 1.6.1