...
The following interrupt service function generates the time base for the CANopen timed actions with periodic calls of the function COTmrService()
. When using a RTOS, the return value may be used to decide of triggering a separate timer task to process the elapsed events.
Code Block | ||
---|---|---|
| ||
void HardwareTimerISR (void)
{
CPU_INT16S num;
num = COTmrService(&AppNode.Tmr);
if (num > 0) {
/* post an event to the timer processing task */
}
} |
Note: The configuration setting CO_TMR_TICKS_PER.SEC
is assumed to be 1000, e.g. 1 tick is equal to 1ms. Therefore the hardware timer must be setup to generate an interrupt every 1ms. See CANopen Config Manual for details.
...