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