extended to CANopen and additional, realtime thread.
More...
|
| CO_ReturnError_t | app_programStart (uint16_t *bitRate, uint8_t *nodeId, uint32_t *errInfo) |
| | Function is called once on the program startup, after Object dictionary initialization and before CANopen initialization.
|
| void | app_communicationReset (CO_t *co) |
| | Function is called after CANopen communication reset.
|
|
void | app_programEnd () |
| | Function is called just before program ends.
|
| void | app_programAsync (CO_t *co, uint32_t timer1usDiff) |
| | Function is called cyclically from main().
|
| void | app_programRt (CO_t *co, uint32_t timer1usDiff) |
| | Function is called cyclically from realtime thread at constant intervals.
|
extended to CANopen and additional, realtime thread.
◆ app_programStart()
| CO_ReturnError_t app_programStart |
( |
uint16_t * | bitRate, |
|
|
uint8_t * | nodeId, |
|
|
uint32_t * | errInfo ) |
Function is called once on the program startup, after Object dictionary initialization and before CANopen initialization.
- Parameters
-
| [in,out] | bitRate | Stored CAN bit rate, can be overridden. |
| [in,out] | nodeId | Stored CANopen NodeId, can be overridden. |
| [out] | errInfo | Variable may indicate error information - index of erroneous OD entry. |
- Returns
- CO_ReturnError_t CO_ERROR_NO in case of success.
◆ app_communicationReset()
| void app_communicationReset |
( |
CO_t * | co | ) |
|
Function is called after CANopen communication reset.
- Parameters
-
◆ app_programAsync()
| void app_programAsync |
( |
CO_t * | co, |
|
|
uint32_t | timer1usDiff ) |
Function is called cyclically from main().
Place for the slower code (all must be non-blocking).
- Warning
- Mind race conditions between this functions and app_programRt(), which run from the realtime thread. If accessing Object dictionary variable which is also mappable to PDO, it is necessary to use CO_LOCK_OD() and CO_UNLOCK_OD() macros from CO_critical_sections.
- Parameters
-
| co | CANopen object. |
| timer1usDiff | Time difference since last call in microseconds |
◆ app_programRt()
| void app_programRt |
( |
CO_t * | co, |
|
|
uint32_t | timer1usDiff ) |
Function is called cyclically from realtime thread at constant intervals.
Code inside this function must be executed fast. Take care on race conditions with app_programAsync.
- Parameters
-
| co | CANopen object. |
| timer1usDiff | Time difference since last call in microseconds |