- Rename local variable 'token' into 'tok' in CO_GTWA_process().
- CO_LSSmaster: replace CO_LSSmaster_InquireNodeId() with more generic
CO_LSSmaster_Inquire(). CiA309-3 command 'lss_inquire_addr' now works
also according to standard.
- CANopen.h: fix doxygen.
- gettingStarted.md: Change example "master" device from node-Id=3 to 1...
* LLSMaster: replace explicit array element copy with memcpy()
Replace explicit array element copy with memcpy()
Signed-off-by: Paolo Teti <paolo.teti@gmail.com>
* SDO server: copy and zeroize arrays using memcpy() and memset()
* Replace array elements copy with memcpy().
* Clear response buffer using memset()
Signed-off-by: Paolo Teti <paolo.teti@gmail.com>
- add CO_fifo_st enumerator for use in CO_fifo_cpyTok2xx functions.
- 309/CO_gateway_ascii: add x8 to x64 nonstandard data types
- example compiles now
- Fix "unused argument" warnings in socketCAN
* Include CO_fifo.h in CO_SDOclient.h in all cases
Struct CO_SDOclient_t has CO_fifo_t member no matter what configuration
is set, so the header is always required. Without this change the build
fails when CO_CONFIG_SDO_CLI_SEGMENTED is not enabled.
* Fix minor copy-paste errors in CO_config.h comments
* Fix new "unused argument" warnings
* Fix "variable may be used uninitialized" in CO_process_SYNC()
With enabled optimization compiler reports:
CANopen.c: In function ‘CO_process_SYNC’:
CANopen.c:890:12: warning: ‘syncWas’ may be used uninitialized in this
function [-Wmaybe-uninitialized]
890 | return syncWas;
| ^~~~~~~
microcontroller independent module.
It includes NMT master, LSS master and SDO client interface.
Interface is non-blocking, it is added to mainline.
Example for Linux stdio and socket is included.
Added CO_fifo.h/c for fifo data buffer, used with rewritten SDO client, etc
SDO client is rewritten. Now includes r/w fifo interface to transfer data.
doc/gettingStarted.md is updated.
Replace hard-coded values with enums and explicit manage all enumeration
values in CO_process_SYNC() to avoid warnings like this:
CANopen.c:837:5: warning: enumeration value ‘CO_SYNC_NONE’ not handled in switch [-Wswitch]
837 | switch (sync_process) {
| ^~~~~~
Function did not check whether the object had any flags assigned. It
makes no difference for objects with no subindexes, because then the
function will return NULL anyway. But is subIndex argument is not zero,
then the function calculates addresses of flags as offsets from NULL.
For example, for an object with no flags assigned, when subIndex == 5,
the function would return 5 as the address instead of the expected NULL.
User can now enable extension callbacks in RPDO/TPDO handling paths
simply by configuration flags instead of modifying sources or by passing
the defines directly to the compiler.
With -Wextra GCC gives:
socketCAN/CO_driver.c: In function ‘setRxFilters’:
socketCAN/CO_driver.c:159:19: warning: comparison of integer expressions
of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’}
[-Wsign-compare]
159 | for (i = 0; i < CANmodule->CANinterfaceCount; i ++) {
| ^
* Merge two parts of CO_PDO_receive() into single common code
* Add CO_RPDO_initCallbackPre() for received RPDO messages
This optional mechanism allows to immediatelly wake the thread that
processes RPDO, without waiting for its next tick.
* Add CO_SYNC_initCallbackPre() for received SYNC messages
This optional mechanism allows to immediatelly wake the thread that
processes SYNC, without waiting for its next tick.
* 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}().
This is the same as pull request #171, but applied to split-driver branch.
Original author: Oleg <ev.mipt@gmail.com>
Now additional state CO_SDO_ST_DOWNLOAD_BL_SUB_RESP_2 is used to send response without resetting SDO sequence.
Refactoring timeout halding logic in sub-block transfer.
Also add missed unsigned indicators for several constants.
issue #170
Now additional state CO_SDO_ST_DOWNLOAD_BL_SUB_RESP_2 is used to send response without resetting SDO sequence.
Refactoring timeout halding logic in sub-block transfer.
Also add missed unsigned indicators for several constants.
issue #170