groke6@381: /* groke6@381: This file is part of CanFestival, a library implementing CanOpen Stack. groke6@381: groke6@381: Copyright (C): Edouard TISSERANT and Francis DUPIN groke6@381: groke6@381: See COPYING file for copyrights details. groke6@381: groke6@381: This library is free software; you can redistribute it and/or groke6@381: modify it under the terms of the GNU Lesser General Public groke6@381: License as published by the Free Software Foundation; either groke6@381: version 2.1 of the License, or (at your option) any later version. groke6@381: groke6@381: This library is distributed in the hope that it will be useful, groke6@381: but WITHOUT ANY WARRANTY; without even the implied warranty of groke6@381: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU groke6@381: Lesser General Public License for more details. groke6@381: groke6@381: You should have received a copy of the GNU Lesser General Public groke6@381: License along with this library; if not, write to the Free Software groke6@381: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA groke6@381: */ groke6@381: #ifdef USE_XENO groke6@381: //#define eprintf(...) if(0){} groke6@381: #define eprintf(...) groke6@381: #else groke6@381: #define eprintf(...) printf (__VA_ARGS__) groke6@381: #endif groke6@381: groke6@381: #include "canfestival.h" groke6@381: groke6@381: /* groke6@381: #define CAN_FIFO_LENGTH 100 groke6@381: groke6@381: #define DECLARE_A_CAN_FIFO \ groke6@381: static Message FIFO[CAN_FIFO_LENGTH];\ groke6@381: static int FIFO_First = 0;\ groke6@381: static int FIFO_Last = 0;\ groke6@381: \ groke6@381: static void PutInFIFO(Message *m)\ groke6@381: {\ groke6@381: FIFO[FIFO_Last++] = *m;\ groke6@381: FIFO_Last %= CAN_FIFO_LENGTH;\ groke6@381: }\ groke6@381: \ groke6@381: static void GetFromFIFO(Message *m)\ groke6@381: {\ groke6@381: *m = FIFO[FIFO_First++];\ groke6@381: FIFO_First %= CAN_FIFO_LENGTH;\ groke6@381: }\ groke6@381: \ groke6@381: static void TransmitMessage(CO_Data* d, UNS32 id)\ groke6@381: {\ groke6@381: Message m;\ groke6@381: GetFromFIFO(&m);\ groke6@381: canDispatch(d, &m);\ groke6@381: } groke6@381: */