Commit Graph

87 Commits

Author SHA1 Message Date
nakarlsson 1817b8b4fe
Allow FoE write of 0byte file (#769)
If FoE write of a file is done, no check
of incoming size is performed. If the
file is 0byte, a FoE Write Request is
sent but no ACK since dofinalzero
is initialized to FALSE.

fixes #766

Co-authored-by: Andreas Karlsson <andreas.karlsson@rt-labs.com>
2023-12-06 19:54:05 +01:00
Patrick Laza 6a5babfec9
Added config_map_aligned to use byte aligned outputs and inputs (#645) 2022-10-19 16:06:55 +02:00
lbckmnn 26fc5dd8e3
remove boot state from ecx_readstate and add some documentation (#643)
* remove boot state from ecx_readstate and documentation
2022-09-19 07:47:55 +02:00
lbckmnn 42ec9bf238
also configure the last SM (#622)
fixes #617
2022-07-02 11:32:02 +02:00
lbckmnn 9183e3068a
const correctness in coe functions (#620)
* add const in RxPDO and SDOwrite

* doc typo

* uniform indention in ethercatcoe.h

Co-authored-by: Lukas Beckmann <lukas.beckmann@yuanda-robotics.de>
2022-06-20 08:29:17 +02:00
Tore Fuglestad e604e98446 avoid 'may be used unitialized' warnings
gcc : -Wmaybe-uninitialized or -Wuninitialized
2022-06-16 07:04:30 +02:00
lilj c879aabd02
Update ethercatconfig.c
Using context->maxslave instead EC_MAXSLAVE
2022-03-16 17:25:06 +08:00
Michael Egli ff448e3485 Fix some UB cases. Closes #546
There are two cases of UB that are fixed in this commit.

1. In ethercatmain.c, there are two left shifts of 31:

    (1 << 31)

Because 1 is a signed int by default, the result cannot be represented
in an int. The fix is to explicitly make the 1 unsigned.

2. In ethercatconfig.c, for slaves that have no inputs, the code would
   apply an offset to a NULL pointer. The fix is to test that the slave
   has inputs available before applying the offset.

Both cases were found by clang with the help of UBSan.
2021-08-31 13:02:10 +02:00
Wanga 9fef1fc23c Add group checking for slave input offset calculation
Some slaves can be at different group and do not use overlap PDO map,
Let ec_config_overlap_map_group only change the input offset for current group.
2021-08-04 20:43:50 +08:00
ArthurKetels 6982a7648f
Add missing PO2SOconfigx() hook to ecx_reconfig_slave() 2021-08-02 20:52:22 +02:00
andreas karlsson 9de0889802 Adjust size of ec_EOE_t to max mailbox size
fix #514
2021-06-02 20:18:25 +02:00
Alex Brinkman bb303a645f add userdata initialization to default ecx_contextt 2021-02-18 09:30:33 -08:00
Alex Brinkman 59821cb410 add userdata to ec_context 2021-02-13 12:26:38 -08:00
Jorrit Olthuis 5550c445d8 Change include in ethercateoe.h (#470) 2021-01-02 11:15:08 +01:00
Andreas Karlsson 447d184d7e Fix llvm compiler implicit-int-conversion warnings
* use uint8 for idx
* make config Isize/Osize uint32
* generally, align sizes in functions to HW objects
* Fix non-standard [0] size data array in EoE struct
2020-10-12 16:24:42 +02:00
ArthurKetels cbc8f36e87
Fix bug in ecx_readIDNmap(), Osize and Isize
Osize and Isize where reset to 16 at every new drive number, thus loosing all lower drive mapping data. Changed to add 16 to Osize and Isize.
2020-10-01 23:00:01 +02:00
Andreas Karlsson 101ac54a7d Don't always include optional IP parameter lengths
Obvious fix, the optional IP parameters length should
only be included in total length if they are included.

fixes #421
2020-08-18 15:47:36 +02:00
nakarlsson bb82fc33d7
Revert "EoE and Distributed clock fixes" 2020-08-18 14:56:16 +02:00
Andreas Karlsson 33aa7a3c57 Correct unit for dc mastertime calulcation to (ns)
The correct factor for seconds should be 1000000000

fixes #432
2020-08-16 11:25:13 +02:00
Andreas Karlsson bae37b9028 Don't always include optional IP parameter lengths
Obvious fix, the optional IP parameters length should
only be included in total length if they are included.

fixes #421
2020-08-16 11:20:10 +02:00
Andreas Karlsson 093311561c Limit expected working counter per ESC
Add one to the expected working counter per
ESC/Slave, not for every syncmanager/fmmu.
Use case, if the slave define more input/output
syncmanager/fmmus it still only generate maximum
working counter of 3 for a RW command.

fixes 374
2020-03-03 11:30:55 +01:00
Arthur Ketels 92ff466357 Fix ecx_pushindex, remove DCtO and DCl from ecx_context 2019-11-13 21:03:56 +01:00
Arthur Ketels 9ec8635943 Fix tx/rx processdata functions 2019-11-12 17:03:48 +01:00
nakarlsson abbf0d42e3
Fix doxygen build warnings for SOEM 1.4.0 (#312)
Trvial non-code changes
2019-06-13 08:06:41 +02:00
Andreas Karlsson 817435066f Add support to choose if manual or automatic state change is done by config functions, fixes #189 2019-06-10 11:48:41 +02:00
Andreas Karlsson cc417d4c0c Add PO2SO hook including context, fixes #230 2019-06-10 09:23:02 +02:00
Andreas Karlsson 8c1e83ee8e Add extra ERROR on mailbox receive timeout to improv diagnostics possibilities 2019-05-24 14:28:29 +02:00
Andreas Karlsson 9c921d8d4e Make ERROR slave count exceeded unique 2019-05-24 14:05:53 +02:00
Andreas Karlsson 7b1ea32343 Make it possible to set EC_VER from osal layer 2019-05-24 14:02:46 +02:00
Andreas Karlsson c892921d7e Add ec_error to string print function, fixes #227 and fixes #232 2019-05-24 14:01:40 +02:00
Schlumpf 787cf82d7d Add possibiliy to set endian target by hardware layer
Now it is possible to set a EC_LITTLE_ENDIAN or EC_BIG_ENDIAN in the
osal_defs.h file or by compile option. If no endian is defined, the default
EC_LITTLE_ENDIAN is used.
2019-05-10 10:19:25 +02:00
jopado1 537145f6bf Fixes for big-endian hosts 2019-05-10 10:17:46 +02:00
andreas karlsson a37a8c733e Fix to enable building the SOEM library VER 2 with -werror 2019-04-08 10:02:03 +02:00
Andreas Karlsson 930d6e07c8 improve groups, make memory usage more efficient, fix erroneous byte calculations and dc frame handling 2019-03-11 10:34:21 +01:00
Claudio Scordino e0d880d7bd Avoid OSAL_THREAD usage when EC_MAX_MAPT=1
Rationale : allow SOEM to be used in a OS that does not support threads.
2019-02-14 10:56:50 +01:00
Claudio Scordino 7beba91c62 Fix typos in comments.
No functional changes.
2019-02-04 13:56:11 +01:00
Claudio Scordino 26cde1dc94 Introduce platform-specific EC_PRINT
Rationale: not all operating systems use function printf for printing
console messages. This commits allows to define platform-specific
functions.
2019-02-04 13:56:00 +01:00
nakarlsson 037a629839
Fixed un-used parameter and variable warnings for EoE (#248)
Trivial fix, no review
2019-02-01 10:42:18 +01:00
nakarlsson 86a2584e47
Impelmented EoE filter function in mailbox receive (#244) 2019-01-31 14:57:16 +01:00
ArthurKetels 4427684cc5
ethercatconfig : Set SM enable flag if SM length > 0 2019-01-31 10:07:18 +01:00
Schlumpf 8f2b233837 Endian fixes (#222)
This patch fixes some bugs on big-endian systems.
  - Use temp variables for etohs() and etohl() at function calls to avoid
    multiple function calls for one value.
  - Fix and add use of etohs(), etohl(), htoes() and htoel().
  - Fix use of 32bit values in 64bit variables.
2018-11-14 11:56:57 +01:00
Zihan Chen 462464ee37 Fixed windows x64 warning C4267 conversion from size_t to uint16 2018-02-22 15:01:44 -08:00
rtlaka 2b339a135b When broadcast read the state,it is OK if the WKC is higher 2018-02-02 08:27:19 +01:00
rtlaka 28d82fa8fd Add functions to configure and send an overlapping IOmap 2018-02-01 13:01:35 +01:00
rtlaka f329d2fc3a Add check that all slaves are present 2018-01-31 10:18:56 +01:00
Nick Tsiogkas 3cc1e9739e Integrate SOEM with RTEMS 2018-01-23 17:07:59 +01:00
mizoguch-ken 1903d1ff54 fix warnings and fix error (#128) 2017-09-18 08:06:12 +02:00
Hans-Erik Floryd 3daefaea61 Normalize line endings (#126)
* add .gitattributes

* normalize line-endings
2017-08-16 20:07:39 +02:00
Hans-Erik Floryd 0ece3165a0 name all exported structs (#125) 2017-08-15 19:02:00 +02:00
Hans-Erik Floryd 59a87a36c1 Merge pull request #112 from nakarlsson/master
Use only one config thread default, multiple threads is an advanced feature for people who know their system
2017-07-14 17:10:40 +02:00