Commit Graph
40 Commits
Author SHA1 Message Date
Hans-Erik Floryd ed3ce755f2 Rename PACKED to OSAL_PACKED
Use a less generic name to avoid namespace conflicts.

Fixes #835.

Change-Id: I222878742ed7d02d19ad50ff732adabfe4f0729a
2025-07-10 11:38:57 +02:00
Hans-Erik Floryd f607afe810 Fix mailbox handling debug prints
Change-Id: I9c09c439254b117bc748e04ed428dceaab98fcaf
2025-07-10 10:23:07 +02:00
Hans-Erik Floryd f9d1101907 Document osal.h
Change-Id: I1ff4bfb2b872e1b4af8ca8c2778815adb3aec070
2025-07-10 10:23:07 +02:00
Hans-Erik Floryd 7c2da72988 Add OSAL functions for monotonic time
This commit adds osal_get_monotonic_time() and
osal_monotonic_sleep(). These functions are designed to facilitate
synchronization with DC time, which can achieve nanosecond precision.

To support this functionality, the ec_timet structure has been
refactored to hold time values in nanoseconds, eliminating the need to
maintain separate time representations.

Change-Id: I039a006ccdb21ba35c437ab76e44e5153c711998
2025-07-10 10:23:07 +02:00
Hans-Erik Floryd 5d87e8d9a2 Add contrib folder
Move unmaintained ports and samples to contrib folder.

Change-Id: Ie1b1a8290a0e2204b6e4e2e5c838585eb88d9e81
2025-07-10 10:23:07 +02:00
Hans-Erik Floryd 7b71cf8aa4 Add options header file
Add an options header file containing build-time configurable
settings.

Change-Id: Icfd71571ea6a3033416106cd114e6d464a47ecdc
2025-07-09 17:20:48 +02:00
Hans-Erik Floryd 0ae3d2f056 Run clang-format on sources
Change-Id: Ide59897b87104bfb71e953b7f8dace00e441e245
2025-07-09 17:20:48 +02:00
Hans-Erik Floryd 62a4c44336 Add win32 mutex
Change-Id: I40a29cfa3f3b669f04140b6dcf572d0e8d2f6509
2025-07-09 12:15:39 +02:00
Hans-Erik Floryd e8e06d19ef Update rt-kernel port
Add a method for choosing L2 driver and add support for sabresd board.

Change-Id: Ib5bbcb53990ffdbe4345cf99f69c44192250e0d8
2025-07-09 12:15:39 +02:00
Hans-Erik Floryd 68330229f6 Improved mailbox handling
This commit includes extensive changes across multiple files to
refactor the mailbox handling system and improve performance and
reliability in EtherCAT communication.

Update from Arthur Ketels 20240911.

Change-Id: I1177aea8b71156671a465473b7393af76be19c1c
2025-07-09 12:15:39 +02:00
Hans-Erik Floryd 29a4f009de Change licensing
This software is now dual-licensed, see LICENSE.md for details.

Change-Id: I646ab4a6e69f9f8c3cdfadd9ad3e4ca7007f729d
2025-07-09 12:15:39 +02:00
jawelch 49f2d8af36 Fix MSVC build: include lean windows.h, include stdlib.h for malloc/free 2025-01-24 13:43:37 -07:00
Jalius Welch cc7caf4751 include minwindefs.h for missing HANDLE definition 2024-11-29 01:39:29 -07:00
Jalius Welch 1ae89e23cb Address unused parameter and unused argument warnings. 2024-11-29 01:39:25 -07:00
Jalius Welch 30c5768485 Fix build errors due to signature mismatch in osal_thread_create.
Fix missing timezone struct declaration.
2024-11-29 01:39:22 -07:00
Jalius Welch 7189adba3c Update CMakeLists for non-MSVC, remove standard library files, add GCC-style struct packing 2024-11-29 01:38:44 -07:00
Alex Kalmuk cd7acdc78f Fix linux osal timers and osal_current_time 2021-04-07 12:11:29 +03:00
Andreas Karlsson 131158dda8 VxWorks, use monotonic clock, fixes #309 2019-06-12 14:42:26 +02:00
Andreas Karlsson c220255604 Don't re-define TRUE and FALSE if already defined 2019-05-24 13:55:15 +02:00
Marc Butler 812403783c Add port to macOS (#286)
* Port to macOS

This port to macOS is an amalgam of the existing Linux and Win32
ports. Consequently code is duplicated from each in this port:
primarily from win32 in oshw, and Linux is osal.

Synthesizing a shared common posix port, did not seem warranted given
the modest amount of code, and stable api.

This port uses the default pcap interface provided in the development
libraries shipped with XCode.

Limited testing on os releases: 10.13 and 10.14.

* fix possible race condition as for win32

See aed0f81724

* fix spelling as for linux / win32

See 7beba91c62
2019-05-15 07:35:31 +02:00
ArthurKetels d16d81e51b Merge pull request #283 from Apollo3zehn/fix/windows_use_absolute_time
osal.c (Windows): Use absolute time instead of relative time.
2019-05-10 23:14:50 +02:00
Vincent Wilms 4671254849 Use absolute time on win32 for DC initialization and errors. 2019-05-10 14:54:17 +02:00
Claudio Scordino 29df9ba013 Add ERIKA Enterprise RTOS support
This patch adds support to SOEM for the ERIKA Enterprise RTOS
(erika-enterprise.com).

Current requirements for running SOEM on ERIKA RTOS:
 - x86-64 platform with 2+ cores
 - Xen hypervisor
 - Intel i210 PCIe Ethernet controller

Signed-off-by: Claudio Scordino <claudio@evidence.eu.com>
Signed-off-by: Luca Cuomo <l.cuomo@evidence.eu.com>
2019-05-10 08:43:18 +02: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
Nick Tsiogkas 3cc1e9739e Integrate SOEM with RTEMS 2018-01-23 17:07:59 +01: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 da7d55e893 Enable and fix warnings (#123)
* cleanup CMakeLists.txt

* build with more warnings, warnings as errors

* fix expression has no effect warning

* fix unused parameter warnings

* fix loss of precision warning

* remove obsolete files
2017-08-16 13:48:51 +02:00
Zihan Chen e78bb66327 Fixed osal_timer_diff bug (#106) 2017-05-25 10:09:10 +02:00
Mikael Heden 15e7748198 Move license information to LICENSE file (#95)
OK
2017-03-29 07:16:44 +02:00
nakarlsson addb1204b4 vxworks
Add VxWorks reference driver, interrupt driven Mux driver.
2017-01-10 11:55:23 +01:00
Hans-Erik Floryd 725ddea4cd fix file encodings 2016-02-16 14:01:08 +01:00
Hans-Erik Floryd bec50c277a add extern "C" to all header files 2016-02-16 13:35:19 +01:00
Shahbaz Youssefi 5c2955139e Include relative to file
This allows the header files to be installed, say in /usr/include/soem
and then included with:

    #include <soem/ethercattype.h>

without having to add -I/usr/include/soem.

Signed-off-by: Shahbaz Youssefi <syoussefi@kinova.ca>
2015-12-18 09:38:09 -05:00
Albert Hofkamp 5239968d0d Remove trailing whitespace. 2015-11-04 13:02:33 +01:00
Mikael Heden d6dd3411d7 Minor cleanup in the test applications 2015-07-09 17:58:54 +02:00
Mikael Heden 77da52b89d Change to cmake build system 2015-07-09 17:57:59 +02:00
nakarlsson 6afd2f50cc SOEM 1.31 RC 2015-03-11 21:45:16 +01:00
nakarlsson f1404964e8 Added osal_task creation via task spwan, added fec driver for Freescale MAC FEC/ENET
Added osal_task creation via task spwan,
Added fec driver for Freescale MAC FEC/ENET
2015-03-08 17:27:00 +01:00
Mikael Heden 7472dae1a2 Added SOEM 1.3 (hg: a02cedcbdca5) 2014-11-25 16:10:29 +01:00