CANopen Bootloader Documentation
Version 4.10.00
|
The are a number of CANopen services which require an internal timer (e.g. Heartbeat). The timer values for these services are set in a multiple of 1 millisecond. The stack works internally with timer ticks. A timer tick has a resolution of 1 microsecond, the time span of a timer tick is set via the definition CBL_TIMER_PERIOD inside the cbl_conf.h file.
The requested time values are converted into timer ticks with the function CblTmrCalcTicks().
Functions | |
uint16_t | CblTmrCalcTicks (uint16_t uwReqTimingV) |
void | CblTmrEvent (void) |
uint16_t CblTmrCalcTicks | ( | uint16_t | uwReqTimingV | ) |
Calculate number of timer ticks.
uwReqTimingV | - requested time in milliseconds |
The function calculates the number of required timer ticks (i.e. timer interrupts) based on the required time 'uwReqTimingV' (in milliseconds) and the constant value CBL_TIMER_PERIOD.
void CblTmrEvent | ( | void | ) |
Execute Timer-based Services.
This routine must be called by a timer resource of the target system. It is responsible to call services that depend on a timer (e.g. Heartbeat). The period of the timer is defined via the CBL_TIMER_PERIOD constant.
Example