etisserant@0: /* etisserant@0: This file is part of CanFestival, a library implementing CanOpen Stack. etisserant@0: etisserant@0: Copyright (C): Edouard TISSERANT and Francis DUPIN etisserant@0: etisserant@0: See COPYING file for copyrights details. etisserant@0: etisserant@0: This library is free software; you can redistribute it and/or etisserant@0: modify it under the terms of the GNU Lesser General Public etisserant@0: License as published by the Free Software Foundation; either etisserant@0: version 2.1 of the License, or (at your option) any later version. etisserant@0: etisserant@0: This library is distributed in the hope that it will be useful, etisserant@0: but WITHOUT ANY WARRANTY; without even the implied warranty of etisserant@0: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU etisserant@0: Lesser General Public License for more details. etisserant@0: etisserant@0: You should have received a copy of the GNU Lesser General Public etisserant@0: License along with this library; if not, write to the Free Software etisserant@0: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA etisserant@0: */ etisserant@0: etisserant@0: #ifndef __APPLICFG_LINUX__ etisserant@0: #define __APPLICFG_LINUX__ etisserant@0: etisserant@0: #include etisserant@0: #include etisserant@0: etisserant@0: // Define the architecture : little_endian or big_endian etisserant@0: // ----------------------------------------------------- etisserant@0: // Test : etisserant@0: // UNS32 v = 0x1234ABCD; etisserant@0: // char *data = &v; etisserant@0: // etisserant@0: // Result for a little_endian architecture : etisserant@0: // data[0] = 0xCD; etisserant@0: // data[1] = 0xAB; etisserant@0: // data[2] = 0x34; etisserant@0: // data[3] = 0x12; etisserant@0: // etisserant@0: // Result for a big_endian architecture : etisserant@0: // data[0] = 0x12; etisserant@0: // data[1] = 0x34; etisserant@0: // data[2] = 0xAB; etisserant@0: // data[3] = 0xCD; etisserant@0: etisserant@0: // Integers etisserant@0: #define INTEGER8 char etisserant@0: #define INTEGER16 short etisserant@0: #define INTEGER24 etisserant@0: #define INTEGER32 long etisserant@0: #define INTEGER40 etisserant@0: #define INTEGER48 etisserant@0: #define INTEGER56 etisserant@0: #define INTEGER64 etisserant@0: etisserant@0: // Unsigned integers etisserant@0: #define UNS8 unsigned char etisserant@0: #define UNS16 unsigned short etisserant@0: #define UNS32 unsigned long etisserant@0: #define UNS24 etisserant@0: #define UNS40 etisserant@0: #define UNS48 etisserant@0: #define UNS56 etisserant@24: #define UNS64 unsigned long long etisserant@0: etisserant@0: // Reals etisserant@0: #define REAL32 float etisserant@0: #define REAL64 double etisserant@0: etisserant@0: /// Definition of error and warning macros etisserant@0: // -------------------------------------- etisserant@0: #if defined DEBUG_ERR_CONSOLE_ON || defined DEBUG_WAR_CONSOLE_ON etisserant@0: #include etisserant@0: #endif etisserant@0: etisserant@0: /// Definition of MSG_ERR etisserant@0: // --------------------- etisserant@0: #ifdef DEBUG_ERR_CONSOLE_ON etisserant@0: # define MSG_ERR(num, str, val)/* \ etisserant@0: printf("%s,%d : 0X%x %s 0X%x \n",__FILE__, __LINE__,num, str, val);*/ etisserant@0: #else etisserant@0: # define MSG_ERR(num, str, val) etisserant@0: #endif etisserant@0: etisserant@0: /// Definition of MSG_WAR etisserant@0: // --------------------- etisserant@0: #ifdef DEBUG_WAR_CONSOLE_ON etisserant@0: # define MSG_WAR(num, str, val)/* \ etisserant@0: printf("%s,%d : 0X%x %s 0X%x \n",__FILE__, __LINE__,num, str, val);*/ etisserant@0: #else etisserant@0: # define MSG_WAR(num, str, val) etisserant@0: #endif etisserant@0: etisserant@0: #endif etisserant@24: etisserant@24: #define CAN_HANDLE void* etisserant@24: etisserant@24: #define MS_TO_TIMEVAL(ms) ms*US_TO_TIMEVAL_FACTOR*1000 etisserant@24: #define US_TO_TIMEVAL(us) us*US_TO_TIMEVAL_FACTOR etisserant@24: etisserant@24: #define TASK_HANDLE pthread_t