Real-Time Embedded Multithreading: Using ThreadX and ARM

The application timer services described in this appendix include:
| tx_timer_activate | Activate an application timer |
| tx_timer_change | Change an application timer |
| tx_timer_create | Create an application timer |
| tx_timer_deactivate | Deactivate an application timer |
| tx_timer_delete | Delete an application timer |
| tx_timer_info_get | Retrieve information about an application timer |
Activate an application timer
UINT <b class="bold">tx_timer_activate</b>(TX_TIMER <b class="bold">*timer_ptr</b>)
This service activates the specified application timer. The expiration routines of timers that expire at the same time are executed in the order they were activated. This service modifies the Application Timer Control Block through the parameter timer_ptr.
| timer_ptr | Pointer to a previously created application timer s Control Block. |
| TX_SUCCESS1 | (0x00) | Successful application timer activation. |
| TX_TIMER_ERROR | (0x15) | Invalid application timer pointer. |
| TX_ACTIVATE_ERROR1 | (0x17) | Timer was already active. |
Initialization, threads, timers, and ISRs
No
TX_TIMER my_timer;UINT status;.../* Activate an application timer. Assume that the application timer has already been created. */status = <b class="bold">tx_timer_activate</b>(&my_timer);/* If status equals TX_SUCCESS, the application timer is now active. */
[115]This value is not affected by the TX_DISABLE_ERROR_CHECKING define that is used to disable API error checking.
Change an application timer
UINT <b class="bold">tx_timer_change</b>(TX_TIMER <b class="bold">*timer_ptr</b>, ULONG <b class="bold">initial_ticks</b>, ULONG <b class="bold">reschedule_ticks</b>)
This service changes the expiration characteristics of the specified application timer. The timer must be deactivated prior to calling this service. This service modifies...