There was a problem with block transfer, when transmitting sequence of
data. If CANsend() failed (socket buffer full), message was dropped.
Now dropped message is marked with bufferFull flag and then it is
re-transmitted later by the driver, as is in the original behaviour of
CANopenNode. Same as commit acd719e27 in v2.0.
- SDO server: Change behavior for string data type + fixes + test all
- SDO client: fixes + test all
- OD interface: Special behavior for string data type
- CO_driver.h: added default debug configuration macros + fix spelling
- Gateway + fifo: added base64 support + updates
- CO_CANopenInit() - added arguments.
- update some documentation
- CO_epoll_interface fixes.
- CO_main_basic.c updates
- rearranged and better documented
- default values moved from CO_driver.h into appropriate files
- rearranged also in CO_driver_target.h files
- parts of the stack or whole objects can be disabled.
- configuration is verified for depencies
Additional:
- renamed some members of CO_Default_CAN_ID_t
- moved helpers CO_setUint32() etc from CO_SDOserver.h into CO_driver.h.
- change wrong CO_ERROR_PARAMETERS to CO_ERROR_ILLEGAL_ARGUMENT.
- renamed CO_ERROR_PARAMETERS to CO_ERROR_OD_PARAMETERS
- CO_LSSslave: move expensive code from CAN receive (interrupt) to mainline
CO_LSSslave_process() function.
- LSS slave now runs in parallel to other CANopen objects.
- LSS slave and master can run both on same device.
- LSS slave, LSS master and gateway-ascii(CiA309) LSS functions tested.
- LSSusage.md updated.
* 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) {
| ^~~~~~
- example/main.c updated to microsecond time base.
- NMT master moved from CANopen.h/.c into 301/CO_NMT_Heartbeat.h/.c.
- CANopen.h/.c files revised, changes in interface, compare example/main.c.
- Removed CO_init() from CANopen.h/.c. Use separate functions instead.
- CO_USE_GLOBALS and global definitions removed from CANopen.c.
- CO_USE_OWN_CRC16 removed from CANopen.c. Use CO_driver_target.h.
- Necessary to update Time base in OS too - call to CO_process() function.
- timerNext_us info to OS implemented in in all objects.
- CO_NMT_blinkingProcess50ms() moved inside CO_NMT_process().
- CO_HBconsumer_process() function optimized and revised.
- Bugfix "timeDifference_us = 0;" inside the for loop.
* fix NMTstartup handling if device is NOT the NMT Master and now OD_NMTStartup (0x1F80 OD) can be optional
issue #149
* Correctly use of NMTstartup to self start slave
According to DSP302, part2, V4.1.0, 2009 for object 1F80h (NMT startup):
bit0=0 - "CANopen device is not NMT master. The entries of the object 1F81h shall be ignored. All other bits of object 1F80h shall be ignored with the exception: value = 00000000 00000000 00000000 00001000b - "NMT slave that shall enter the NMT state Operational after the NMT state Initialisation autonomously (self starting)"
* All Warnings omitted
Now all warnings that came up in previous versions are fixed in a clean way directly in the code.
Inlcudes:
Shadowing
Missing default cases
Missing cases in switch statements
unused variables
Pointer problems
Function declarations' visibility
* Default case for NMTsendCommand
Default case was not catched before and could led to errors.
* fix typo when omitting warnings
* Omitting more warnings, and fix TIME->CANrxNew nulling
Inlcudes:
large integer implicitly truncated to unsigned type
this statement may fall through
* rename CO_this to co
* fix CO_process_SYNC name (CANopenNode master merging issue)
Co-authored-by: Michele B. <MicheleBlank@gmx-topmail.de>
----
Verified before merge. It is cleanup, no deep changes.
Previously, the address of the CAN device (`CANbaseAddress`)
was specified as a signed or unsigned integer of variable size.
This made the ABI specific for each driver and is not generic
enough for some use cases.
Replaced all usages by using a void pointer instead.
Renamed `CANbaseAddress` to `CANdevicePtr`.
Refactored the code where it needed to be (some comparisons to -1).
Use a pointer to a user-defined variable/structure instead of
a 32-bit integer for CANbaseAddress. Renamed CANbaseAddress
to CANbaseStruct to reflect that change in behavior.
This is more modular and avoids casts.
- emergency processing now affects CO_process() timerNext_ms
- timerNext_ms is gets set when either a message is ready to send, but inhibit time is not elapsed or when a message was sent to re-check the queue
- be aware that timer resolution is 1ms, whereas emergency inhibit time resolution is 100us. We round this up to the next ms.
- needs #define CO_NO_LSS_CLIENT 1 in CO_OD.h. This will need a change in the OD editor.
- still no fastscan support
- bitrate settin API untested
- some changes on LSS slave where necessary
- needs #define CO_NO_LSS_SERVER 1 in CO_OD.h. This will need a change in the OD editor.
- no Fastscan support yet
- bitrate setting API untested
- https://github.com/CANopenNode/CANopenNode/issues/46 (driver stuff)
- changed some of the other stack files, tried my best to remain compatible with standard non LSS CANopenNode
This enables the stack user to use a different calculation method. This
is needed to save space (no table) or to use hardware crc unit.
Implementation can be located in driver directory.