Real-Time Embedded Multithreading, Using ThreadX and ARM ~Chapter9~

Real-Time Embedded
Multithreading, Using
ThreadX and ARM
~Chapter9~
學生 : 曾楓喬
指導教授 : 張軒彬
OUTLINE












Introduction
Internal System Clock Services
Summary of Application Timer Services
Application Timer Control Block
Creating an Application Timer
Activating an Application Timer
Deactivating an Application Timer
Changing an Application Timer
Deleting an Application Timer
Retrieving Application Timer Information
Sample System Using Timers to Measure Thread Performance
Application Timer Internals
Introduction

Timer kinds
one-shot timer
periodic timer


Each timer interrupt is called a timer-tick.
To avoid using timers that expire every timer-tick.
Internal System Clock Services



ThreadX provides a single continuously
incrementing 32-bit tick counter.
ThreadX sets the internal system clock to zero
during application initialization ,and each
timer-tick increases the clock by one.
Two services
tx_time_get
tx_time_set
Internal System Clock Services(cont.)

tx_time_get
Retrieving the current
time from the internal
system clock.
Internal System Clock Services(cont.)

tx_time_get
Internal System Clock Services(cont.)

tx_time_set
Setting the current time
of the internal system
clock to some specified
value.
Summary of Application Timer
Services
Application Timer Control Block


The characteristics of each application timer
are found in its Application Timer Control
Block.
ThreadX prohibits an application from
modifying the Application Timer Control
Block.
Application Timer Control
Block(cont.)
Application Timer Control
Block(cont.)
Creating an Application Timer



tx_timer_create
The range of values for
the initial number of
timer-ticks is from 1 to
0xFFFFFFFF
For subsequent time
timer-ticks ,the range of
values is from 0 to
0xFFFFFFFF
Activating an Application Timer

tx_timer_activate
Activating an Application
Timer(cont.)
Deactivating an Application Timer

tx_timer_deactivate
Changing an Application Timer


tx_timer_change
Changing the initial number of timer-ticks and
the number of timer-ticks for all timer
expirations after the first.
Deleting an Application Timer

tx_timer_delete
Deleting an Application Timer(cont.)
Retrieving Application Timer
Information

tx_timer_info_get
Sample System Using Timers to
Measure Thread Performance
Sample System Using Timers to
Measure Thread Performance(cont.)
Sample System Using Timers to
Measure Thread Performance(cont.)
Sample System Using Timers to
Measure Thread Performance(cont.)
Sample System Using Timers to
Measure Thread Performance(cont.)
Sample System Using Timers to
Measure Thread Performance(cont.)
Sample System Using Timers to
Measure Thread Performance(cont.)
Application Timer Internals
THE END