1
0
Fork 0
CANopenNode/socketCAN
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_driver.c SocketCAN, CO_driver.c: replace CO_notifyPype with simpler eventfd(). 2020-03-17 17:39:22 +01:00
CO_driver_target.h Update configuration macros. SDO state machine preview. 2020-04-29 13:12:07 +02:00
CO_error.c Unify indentation in three files. 2020-03-16 15:30:19 +01:00
CO_error.h Unify indentation in three files. 2020-03-16 15:30:19 +01:00
CO_error_msgs.h Add CO_NMT_UNKNOWN state for Heartbeat consumer. 2020-03-18 21:46:34 +01:00
CO_Linux_threads.c Add Stack configuration macros to most of CANopenNode objects. 2020-03-19 18:07:23 +01:00
CO_Linux_threads.h Add Stack configuration macros to most of CANopenNode objects. 2020-03-19 18:07:23 +01:00
CO_main_basic.c Add Stack configuration macros to most of CANopenNode objects. 2020-03-19 18:07:23 +01:00
CO_OD_storage.c Replace all memcpy/memset-like functions with standard <string.h> functions (#175) 2020-05-04 11:22:32 +02:00
CO_OD_storage.h socketCAN now compiles and runs. 2020-03-12 08:38:58 +01:00