From 787cf82d7d9504b1cf630fb40f3f816630a8d6a1 Mon Sep 17 00:00:00 2001 From: Schlumpf Date: Wed, 8 May 2019 08:52:54 +0200 Subject: [PATCH] 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. --- soem/ethercattype.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/soem/ethercattype.h b/soem/ethercattype.h index 1881df3..86df704 100644 --- a/soem/ethercattype.h +++ b/soem/ethercattype.h @@ -23,15 +23,17 @@ extern "C" { #endif -/** Define Little or Big endian target */ -#define EC_LITTLE_ENDIAN - /** define EC_VER1 if version 1 default context and functions are needed * comment if application uses only ecx_ functions and own context */ #define EC_VER1 #include "osal.h" +/** Define little endian target by default if no endian is set */ +#if !defined(EC_LITTLE_ENDIAN) && !defined(EC_BIG_ENDIAN) +# define EC_LITTLE_ENDIAN +#endif + /** return value general error */ #define EC_ERROR -3 /** return value no frame returned */