Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Timer

This section describes the configuration definitions related to the internal timer service. The presented source code lines represents the default configuration.

CO_TMR_TICKS_PER_SEC

#define CO_TMR_TICKS_PER_SEC    1000

This definition specifies the calling frequency of the CANopen timer service function.

Note: within the default implementation, the CANopen timer service function is called from within a hardware timer interrupt service function. Therefore this define shall be identical to the interrupt frequency of the hardware timer.

CO_TMR_N

#define CO_TMR_N                5

This definition specifies the maximum number of CANopen timed actions.

Note: It is allowed to use CANopen timers for the application as well. The number of application timed actions must be considered in this configuration, tooAPI functions of the CANopen timer module. These functions are implemented within the source file: co_tmr.c/h

The class CO.TMR is defined within co_tmr.h and is responsible for the CANopen highspeed timer management. The following data members are in this class:

Data MemberTypeDescription
NodeCO_NODE *Reference to parent CANopen node
MaxCPU_INT32UMaximum number of timed actions
APool[]CO_TMR_ACTIONTimer action pool array
TPool[]CO_TMR_TIMETimer event pool array
ActsCO_TMR_ACTION *Reference to root of free actions linked list
FreeCO_TMR_TIME *Reference to root of free events linked list
UseCO_TMR_TIME *Reference to root of used events linked list
TimeCPU_INT32UTime ticks of next event since creation
DelayCPU_INT32UTime ticks of next event from now

Note: The data within this structure must never be manipulated without the corresponding class member functions. This can lead to unpredictable behavior of the CANopen node.