1
0
Fork 0
CANopenNode/301
Freddie Chopin 4c3011d34a
Replace all memcpy/memset-like functions with standard <string.h> functions (#175)
* Use standard memcpy() instead of CO_memcpy()

* Remove CO_memcpy()

* Use standard memset() instead of CO_memset()

* Remove CO_memset()

* Move helper functions from CO_SDOserver.c to header and make them inline

* Implement CO_getUint16() with memcpy()

* Implement CO_getUint32() with memcpy()

* Implement CO_setUint16() with memcpy()

* Implement CO_setUint32() with memcpy()

* Define memcpy() as CO_memcpySwapX() for little-endian systems

* Fix several writes past the buffer due to hardcoded sizes

Use more "generic" sizes (via sizeof()) instead of hardcoded number in
all calls to memset() to avoid 1-byte errors which result in writes past
the buffer, for example:

memset(&LSSslave->TXbuff->data[5], 0, 4);
in CO_LSSslave_serviceInquire()

memset(&LSSmaster->TXbuff->data[6], 0, 3);
in CO_LSSmaster_switchStateSelectInitiate()

* Use "generic" size in calls to memcpy() where possible

* Remove CO_bytes_t

This type was used only for CO_{get,set}Uint{16,32}().
2020-05-04 11:22:32 +02:00
..
CO_config.h Update configuration macros. SDO state machine preview. 2020-04-29 13:12:07 +02:00
CO_driver.h Update configuration macros. SDO state machine preview. 2020-04-29 13:12:07 +02:00
CO_Emergency.c Replace all memcpy/memset-like functions with standard <string.h> functions (#175) 2020-05-04 11:22:32 +02:00
CO_Emergency.h Minor corrections in documentation. 2020-04-03 11:43:14 +02:00
CO_HBconsumer.c Make calculation of timerNext_us optional. 2020-03-20 16:44:37 +01:00
CO_HBconsumer.h Minor corrections in documentation. 2020-04-03 11:43:14 +02:00
CO_NMT_Heartbeat.c Make calculation of timerNext_us optional. 2020-03-20 16:44:37 +01:00
CO_NMT_Heartbeat.h Minor corrections in documentation. 2020-04-03 11:43:14 +02:00
CO_PDO.c Make SYNC optional in TPDO and RPDO. 2020-03-20 18:47:16 +01:00
CO_PDO.h Minor corrections in documentation. 2020-04-03 11:43:14 +02:00
CO_SDOclient.c Make calculation of timerNext_us optional. 2020-03-20 16:44:37 +01:00
CO_SDOclient.h Add Stack configuration macros to most of CANopenNode objects. 2020-03-19 18:07:23 +01:00
CO_SDOserver.c Replace all memcpy/memset-like functions with standard <string.h> functions (#175) 2020-05-04 11:22:32 +02:00
CO_SDOserver.h Replace all memcpy/memset-like functions with standard <string.h> functions (#175) 2020-05-04 11:22:32 +02:00
CO_SYNC.c Make calculation of timerNext_us optional. 2020-03-20 16:44:37 +01:00
CO_SYNC.h Minor corrections in documentation. 2020-04-03 11:43:14 +02:00
CO_TIME.c Replace all memcpy/memset-like functions with standard <string.h> functions (#175) 2020-05-04 11:22:32 +02:00
CO_TIME.h Change non-descriptive CO_***_initCallback() into CO_***_initCallbackPre(). 2020-03-18 23:19:29 +01:00
crc16-ccitt.c Drivers removed from stack, directory structure rearranged. 2020-02-05 10:52:56 +01:00
crc16-ccitt.h Drivers removed from stack, directory structure rearranged. 2020-02-05 10:52:56 +01:00