Remove CO_CANopenInitCallback() from CANopen.h/.c (revert)
This commit is contained in:
parent
22e66b7bb4
commit
3fc564b72f
4 changed files with 5 additions and 35 deletions
17
CANopen.c
17
CANopen.c
|
|
@ -626,23 +626,6 @@ CO_ReturnError_t CO_CANopenInit(uint8_t nodeId) {
|
|||
}
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
void CO_CANopenInitCallback(void *object,
|
||||
void (*pFunctSignal)(void *object))
|
||||
{
|
||||
CO_SDO_initCallback(CO->SDO[0], object, pFunctSignal);
|
||||
CO_EM_initCallback(CO->em, object, pFunctSignal);
|
||||
#if CO_NO_SDO_CLIENT != 0
|
||||
for (i = 0; i < CO_NO_SDO_CLIENT; i++) {
|
||||
CO_SDOclient_initCallback(CO->SDOclient[i], object, pFunctSignal);
|
||||
}
|
||||
#endif
|
||||
#if CO_NO_LSS_CLIENT == 1
|
||||
CO_LSSmaster_initCallback(CO->LSSmaster, object, pFunctSignal);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
CO_NMT_reset_cmd_t CO_process(CO_t *co,
|
||||
uint32_t timeDifference_us,
|
||||
|
|
|
|||
15
CANopen.h
15
CANopen.h
|
|
@ -273,21 +273,6 @@ CO_ReturnError_t CO_LSSinit(uint8_t nodeId,
|
|||
CO_ReturnError_t CO_CANopenInit(uint8_t nodeId);
|
||||
|
||||
|
||||
/**
|
||||
* Initialize callback functions.
|
||||
*
|
||||
* Function initializes optional callback functions, which executes after
|
||||
* internal state of some CANopen object changes. For example, after CAN message
|
||||
* is received or error condition is changed. Function may wake up external
|
||||
* task, which processes mainline CANopen functions.
|
||||
*
|
||||
* @param object Pointer to object, which will be passed to pFunctSignal(). Can be NULL
|
||||
* @param pFunctSignal Pointer to the callback function. Not called if NULL.
|
||||
*/
|
||||
void CO_CANopenInitCallback(void *object,
|
||||
void (*pFunctSignal)(void *object));
|
||||
|
||||
|
||||
/**
|
||||
* Process CANopen objects.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ Change Log
|
|||
- Rename in CO_driver_target.h: `IS_CANrxNew` -> `CO_FLAG_READ`, `SET_CANrxNew` -> `CO_FLAG_SET`, `CLEAR_CANrxNew` -> `CO_FLAG_CLEAR`
|
||||
- CO_driver.h file, function `CO_CANrxBufferInit()`, last argument (callback) changed from `(*pFunct)(void *object, const CO_CANrxMsg_t *message)` to `void (*CANrx_callback)(void *object, void *message)`. New functions are defined in `CO_driver_target.h` file: `CO_CANrxMsg_readIdent()`, `CO_CANrxMsg_readDLC()` and `CO_CANrxMsg_readData()`.
|
||||
- It is necessary to manually update CO_OD.c file - it must include: `301/CO_driver.h`, `CO_OD.h` and `301/CO_SDOserver.h`.
|
||||
- Added `void *object` argument CO_*_initCallback() functions. Added CO_CANopenInitCallback() into CANopen.h/.c.
|
||||
- Added `void *object` argument to CO_*_initCallback() functions.
|
||||
### Changed SocketCAN
|
||||
- ./stack/socketCAN removed from the project, ./stack/Neuberger-socketCAN moved to ./socketCAN
|
||||
- driver API updated
|
||||
|
|
|
|||
|
|
@ -51,12 +51,14 @@ void threadMain_init(void (*callback)(void*), void *object)
|
|||
{
|
||||
threadMain.start = CO_LinuxThreads_clock_gettime_us();
|
||||
|
||||
CO_CANopenInitCallback(object, callback);
|
||||
CO_SDO_initCallback(CO->SDO[0], object, callback);
|
||||
CO_EM_initCallback(CO->em, object, callback);
|
||||
}
|
||||
|
||||
void threadMain_close(void)
|
||||
{
|
||||
CO_CANopenInitCallback(NULL, NULL);
|
||||
CO_SDO_initCallback(CO->SDO[0], NULL, NULL);
|
||||
CO_EM_initCallback(CO->em, NULL, NULL);
|
||||
}
|
||||
|
||||
void threadMain_process(CO_NMT_reset_cmd_t *reset)
|
||||
|
|
|
|||
Loading…
Reference in a new issue