examples/TestMasterSlave/TestMasterSlave.c
author dejoigny
Tue, 16 May 2006 17:22:15 +0200
changeset 8 eee2b0c89213
parent 0 4472ee7c6c3e
child 31 a82b70738e5c
permissions -rw-r--r--
correction bogue pour BIG_ENDIAN
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     1
/*
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     2
This file is part of CanFestival, a library implementing CanOpen Stack. 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     3
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     4
Copyright (C): Edouard TISSERANT and Francis DUPIN
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     5
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     6
See COPYING file for copyrights details.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     7
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     8
This library is free software; you can redistribute it and/or
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     9
modify it under the terms of the GNU Lesser General Public
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    10
License as published by the Free Software Foundation; either
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    11
version 2.1 of the License, or (at your option) any later version.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    12
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    13
This library is distributed in the hope that it will be useful,
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    14
but WITHOUT ANY WARRANTY; without even the implied warranty of
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    16
Lesser General Public License for more details.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    17
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    18
You should have received a copy of the GNU Lesser General Public
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    19
License along with this library; if not, write to the Free Software
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    20
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    21
*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    22
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    23
#include <stdio.h>
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    24
#include <string.h>
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    25
#include <sys/time.h>
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    26
#include <unistd.h>
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    27
#include <stdlib.h>
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    28
#include <signal.h>
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    29
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    30
#include <applicfg.h>
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    31
#include <can_driver.h>
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    32
#include <timers_driver.h>
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    33
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    34
#include "Master.h"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    35
#include "Slave.h"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    36
#include "TestMasterSlave.h"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    37
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    38
#define MyCase(fc) case fc: eprintf(#fc);break;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    39
void print_message(Message *m)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    40
{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    41
	int i;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    42
	switch(m->cob_id.w >> 7)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    43
	{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    44
		MyCase(SYNC)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    45
		MyCase(TIME_STAMP)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    46
		MyCase(PDO1tx)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    47
		MyCase(PDO1rx)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    48
		MyCase(PDO2tx)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    49
		MyCase(PDO2rx)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    50
		MyCase(PDO3tx)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    51
		MyCase(PDO3rx)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    52
		MyCase(PDO4tx)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    53
		MyCase(PDO4rx)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    54
		MyCase(SDOtx)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    55
		MyCase(SDOrx)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    56
		MyCase(NODE_GUARD)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    57
		MyCase(NMT)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    58
	}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    59
	eprintf(" rtr:%d", m->rtr);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    60
	eprintf(" len:%d", m->len);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    61
	for (i = 0 ; i < m->len ; i++)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    62
		eprintf(" %02x", m->data[i]);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    63
	eprintf("\n");
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    64
}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    65
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    66
UNS32 OnMasterMap1Update(CO_Data* d, const indextable * unsused_indextable, UNS8 unsused_bSubindex)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    67
{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    68
	eprintf("OnSlaveMap1Update:%d\n", SlaveMap1);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    69
}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    70
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    71
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    72
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    73
void InitNodes(CO_Data* d, UNS32 id)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    74
{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    75
//  TestSlave_Index2000_callbacks[0] = &OnMasterMap1Update;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    76
  RegisterSetODentryCallBack(&TestMaster_Data, 0x2000, 0, &OnMasterMap1Update);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    77
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    78
  /****************************** INITIALISATION MASTER *******************************/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    79
  /* Defining the node Id */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    80
  setNodeId(&TestMaster_Data, 0x01);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    81
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    82
  /* init */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    83
  setState(&TestMaster_Data, Initialisation);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    84
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    85
  /****************************** INITIALISATION SLAVE *******************************/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    86
  /* Defining the node Id */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    87
  setNodeId(&TestSlave_Data, 0x02);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    88
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    89
  /* init */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    90
  setState(&TestSlave_Data, Initialisation);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    91
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    92
  /****************************** START *******************************/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    93
  /* Put the master in operational mode */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    94
  setState(&TestMaster_Data, Operational);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    95
  
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    96
  masterSendNMTstateChange (&TestMaster_Data, 0x02, NMT_Start_Node);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    97
	
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    98
}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    99
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   100
CAN_HANDLE SlaveCanHandle;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   101
CAN_HANDLE MasterCanHandle;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   102
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   103
// Baudrate values for Peak board :
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   104
// CAN_BAUD_1M CAN_BAUD_500K CAN_BAUD_250K CAN_BAUD_125K CAN_BAUD_100K CAN_BAUD_50K
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   105
// CAN_BAUD_20K CAN_BAUD_10K CAN_BAUD_5K
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   106
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   107
#ifdef CAN_BAUD_500K
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   108
// Appli have been compiled for Peak. Baudrate is defined
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   109
# define BAUDRATE CAN_BAUD_500K
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   110
#else
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   111
// Appli have been compiled for Generic. Baudrate not used
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   112
# define BAUDRATE 0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   113
#endif
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   114
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   115
void catch_signal(int sig)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   116
{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   117
  signal(SIGTERM, catch_signal);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   118
  signal(SIGINT, catch_signal);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   119
  stopTimer();
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   120
  eprintf("Got Sigterm - Finishing.\n");
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   121
}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   122
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   123
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   124
void help()
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   125
{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   126
  printf("**************************************************************\n");
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   127
  printf("*  TestMasterSlave                                           *\n");
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   128
  printf("*                                                            *\n");
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   129
  printf("*  A simple example for PC. It does implement 2 CanOpen      *\n");
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   130
  printf("*  nodes in the same process. A master and a slave. Both     *\n");
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   131
  printf("*   communicate together, exchanging periodically NMT, SYNC, *\n");
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   132
  printf("*   SDO and PDO.                                             *\n");
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   133
  printf("*                                                            *\n");
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   134
  printf("*   If you have chosen virtual CAN driver, just type         *\n");
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   135
  printf("*   ./TestMasterSlave                                        *\n");
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   136
  printf("*                                                            *\n");
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   137
  printf("*   Else you need to sepcify bus:                            *\n");
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   138
  printf("*                                                            *\n");
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   139
  printf("*     -s : slave CAN bus [default 0, peak first PCI]         *\n");
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   140
  printf("*     -m : master CAN bus [default 1, peak second PCI]       *\n");
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   141
  printf("*                                                            *\n");
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   142
  printf("**************************************************************\n");
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   143
}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   144
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   145
/****************************************************************************/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   146
/***************************  MAIN  *****************************************/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   147
/****************************************************************************/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   148
int main(int argc,char **argv)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   149
{
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   150
	s_BOARD SlaveBoard = {"0", BAUDRATE, &TestSlave_Data};
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   151
	s_BOARD MasterBoard = {"1", BAUDRATE, &TestMaster_Data};
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   152
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   153
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   154
  char c;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   155
  extern char *optarg;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   156
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   157
  while ((c = getopt(argc, argv, "-m:s:")) != EOF)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   158
  {
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   159
    switch(c)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   160
    {
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   161
      case 's' :
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   162
        if (optarg[0] == 0)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   163
        {
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   164
          help();
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   165
          exit(1);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   166
        }
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   167
        SlaveBoard.busname = optarg;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   168
        break;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   169
      case 'm' :
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   170
        if (optarg[0] == 0)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   171
        {
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   172
          help();
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   173
          exit(1);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   174
        }
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   175
        MasterBoard.busname = optarg;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   176
        break;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   177
      default:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   178
        help();
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   179
        exit(1);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   180
    }
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   181
  }
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   182
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   183
	/* install signal handler for manual break */
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   184
	signal(SIGTERM, catch_signal);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   185
	signal(SIGINT, catch_signal);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   186
	
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   187
	// Open CAN devices
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   188
	SlaveCanHandle = canOpen(&SlaveBoard);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   189
	MasterCanHandle = canOpen(&MasterBoard);	
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   190
	
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   191
	// Will call InitNodes, and wait and handle next timer events.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   192
	TimerLoop(&InitNodes);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   193
	
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   194
	// Close CAN devices
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   195
	canClose(SlaveCanHandle);
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   196
	canClose(MasterCanHandle);	
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   197
	
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   198
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   199
  return 0;
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   200
}