Real-Time Embedded Multithreading: Using ThreadX and ARM

Appendix J: Application Timer Services

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

tx_timer_activate

Activate an application timer

Prototype

UINT <b class="bold">tx_timer_activate</b>(TX_TIMER <b class="bold">*timer_ptr</b>)

Description

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.

Input Parameter

timer_ptr

Pointer to a previously created application timer s Control Block.

Return Values [115]

TX_SUCCESS1

(0x00)

Successful application timer activation.

TX_TIMER_ERROR

(0x15)

Invalid application timer pointer.

TX_ACTIVATE_ERROR1

(0x17)

Timer was already active.

Allowed From

Initialization, threads, timers, and ISRs

Preemption Possible

No

Example

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.

tx_timer_change

Change an application timer

Prototype

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>)

Description

This service changes the expiration characteristics of the specified application timer. The timer must be deactivated prior to calling this service. This service modifies...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Time Delay Relays
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.