1
0
Fork 0
CANopenNode/305
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_LSS.h Drivers removed from stack, directory structure rearranged. 2020-02-05 10:52:56 +01:00
CO_LSSmaster.c Replace all memcpy/memset-like functions with standard <string.h> functions (#175) 2020-05-04 11:22:32 +02:00
CO_LSSmaster.h Minor corrections in documentation. 2020-04-03 11:43:14 +02:00
CO_LSSslave.c Replace all memcpy/memset-like functions with standard <string.h> functions (#175) 2020-05-04 11:22:32 +02:00
CO_LSSslave.h Minor corrections in documentation. 2020-04-03 11:43:14 +02:00