--- a/examples/TestMasterSlave/TestMaster.c Mon Jan 29 14:34:31 2007 +0100
+++ b/examples/TestMasterSlave/TestMaster.c Mon Jan 29 14:36:42 2007 +0100
@@ -1,24 +1,3 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack.
-
-Copyright (C): Edouard TISSERANT and Francis DUPIN
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
/* File generated by gen_cfile.py. Should not be modified. */
@@ -27,10 +6,10 @@
/**************************************************************************/
/* Declaration of the mapped variables */
/**************************************************************************/
-UNS8 MasterMap1 = 0x0; // Mapped at index 0x2000, subindex 0x00
-UNS8 MasterMap2 = 0x0; // Mapped at index 0x2001, subindex 0x00
-UNS8 MasterMap3 = 0x0; // Mapped at index 0x2002, subindex 0x00
-UNS8 MasterMap4 = 0x0; // Mapped at index 0x2003, subindex 0x00
+UNS8 MasterMap1 = 0x0; /* Mapped at index 0x2000, subindex 0x00 */
+UNS8 MasterMap2 = 0x0; /* Mapped at index 0x2001, subindex 0x00 */
+UNS8 MasterMap3 = 0x0; /* Mapped at index 0x2002, subindex 0x00 */
+UNS8 MasterMap4 = 0x0; /* Mapped at index 0x2003, subindex 0x00 */
/**************************************************************************/
/* Declaration of the value range types */
@@ -49,35 +28,37 @@
/* node_id default value.*/
UNS8 TestMaster_bDeviceNodeId = 0x00;
-//*****************************************************************************/
+/**************************************************************************/
/* Array of message processing information */
const UNS8 TestMaster_iam_a_slave = 0;
TIMER_HANDLE TestMaster_heartBeatTimers[1] = {TIMER_NONE,};
-//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
-//
-// OBJECT DICTIONARY
-//
-//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
+/*
+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
+
+ OBJECT DICTIONARY
+
+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
+*/
/* index 0x1000 : Device Type. */
- UNS32 TestMaster_obj1000 = 0x12D; // 301
+ UNS32 TestMaster_obj1000 = 0x12D; /* 301 */
subindex TestMaster_Index1000[] =
{
{ RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1000 }
};
/* index 0x1001 : Error Register. */
- UNS8 TestMaster_obj1001 = 0x0; // 0
+ UNS8 TestMaster_obj1001 = 0x0; /* 0 */
subindex TestMaster_Index1001[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestMaster_obj1001 }
};
/* index 0x1005 : SYNC COB ID. */
- UNS32 TestMaster_obj1005 = 0x40000080; // 1073741952
+ UNS32 TestMaster_obj1005 = 0x40000080; /* 1073741952 */
ODCallback_t TestMaster_Index1005_callbacks[] =
{
NULL,
@@ -88,7 +69,7 @@
};
/* index 0x1006 : Communication / Cycle Period. */
- UNS32 TestMaster_obj1006 = 0xC350; // 50000
+ UNS32 TestMaster_obj1006 = 0xC350; /* 50000 */
ODCallback_t TestMaster_Index1006_callbacks[] =
{
NULL,
@@ -99,11 +80,11 @@
};
/* index 0x1010 : Store parameters. */
- UNS8 TestMaster_highestSubIndex_obj1010 = 4; // number of subindex - 1
- UNS32 TestMaster_obj1010_Save_All_Parameters = 0x0; // 0
- UNS32 TestMaster_obj1010_Save_Communication_Parameters = 0x0; // 0
- UNS32 TestMaster_obj1010_Save_Application_Parameters = 0x0; // 0
- UNS32 TestMaster_obj1010_Save_Manufacturer_Parameters = 0x0; // 0
+ UNS8 TestMaster_highestSubIndex_obj1010 = 4; /* number of subindex - 1*/
+ UNS32 TestMaster_obj1010_Save_All_Parameters = 0x0; /* 0 */
+ UNS32 TestMaster_obj1010_Save_Communication_Parameters = 0x0; /* 0 */
+ UNS32 TestMaster_obj1010_Save_Application_Parameters = 0x0; /* 0 */
+ UNS32 TestMaster_obj1010_Save_Manufacturer_Parameters = 0x0; /* 0 */
ODCallback_t TestMaster_Index1010_callbacks[] =
{
NULL,
@@ -122,11 +103,11 @@
};
/* index 0x1011 : Restore Default Parameters. */
- UNS8 TestMaster_highestSubIndex_obj1011 = 4; // number of subindex - 1
- UNS32 TestMaster_obj1011_Restore_All_Default_Parameters = 0x0; // 0
- UNS32 TestMaster_obj1011_Restore_Communication_Default_Parameters = 0x0; // 0
- UNS32 TestMaster_obj1011_Restore_Application_Default_Parameters = 0x0; // 0
- UNS32 TestMaster_obj1011_Restore_Manufacturer_Default_Parameters = 0x0; // 0
+ UNS8 TestMaster_highestSubIndex_obj1011 = 4; /* number of subindex - 1*/
+ UNS32 TestMaster_obj1011_Restore_All_Default_Parameters = 0x0; /* 0 */
+ UNS32 TestMaster_obj1011_Restore_Communication_Default_Parameters = 0x0; /* 0 */
+ UNS32 TestMaster_obj1011_Restore_Application_Default_Parameters = 0x0; /* 0 */
+ UNS32 TestMaster_obj1011_Restore_Manufacturer_Default_Parameters = 0x0; /* 0 */
ODCallback_t TestMaster_Index1011_callbacks[] =
{
NULL,
@@ -145,10 +126,10 @@
};
/* index 0x1016 : Consumer Heartbeat Time. */
- UNS8 TestMaster_highestSubIndex_obj1016 = 1; // number of subindex - 1
+ UNS8 TestMaster_highestSubIndex_obj1016 = 1; /* number of subindex - 1*/
UNS32 TestMaster_obj1016[] =
{
- 0x20802 // 133122
+ 0x20802 /* 133122 */
};
subindex TestMaster_Index1016[] =
{
@@ -157,14 +138,14 @@
};
/* index 0x1017 : Producer Heartbeat Time */
- UNS16 TestMaster_obj1017 = 0x0; // 0
+ UNS16 TestMaster_obj1017 = 0x0; /* 0 */
/* index 0x1018 : Identity. */
- UNS8 TestMaster_highestSubIndex_obj1018 = 4; // number of subindex - 1
- UNS32 TestMaster_obj1018_Vendor_ID = 0x0; // 0
- UNS32 TestMaster_obj1018_Product_Code = 0x0; // 0
- UNS32 TestMaster_obj1018_Revision_Number = 0x0; // 0
- UNS32 TestMaster_obj1018_Serial_Number = 0x0; // 0
+ UNS8 TestMaster_highestSubIndex_obj1018 = 4; /* number of subindex - 1*/
+ UNS32 TestMaster_obj1018_Vendor_ID = 0x0; /* 0 */
+ UNS32 TestMaster_obj1018_Product_Code = 0x0; /* 0 */
+ UNS32 TestMaster_obj1018_Revision_Number = 0x0; /* 0 */
+ UNS32 TestMaster_obj1018_Serial_Number = 0x0; /* 0 */
subindex TestMaster_Index1018[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1018 },
@@ -175,10 +156,10 @@
};
/* index 0x1280 : Client SDO 1 Parameter. */
- UNS8 TestMaster_highestSubIndex_obj1280 = 3; // number of subindex - 1
- UNS32 TestMaster_obj1280_COB_ID_Client_to_Server_Transmit_SDO = 0x602; // 1538
- UNS32 TestMaster_obj1280_COB_ID_Server_to_Client_Receive_SDO = 0x582; // 1410
- UNS32 TestMaster_obj1280_Node_ID_of_the_SDO_Server = 0x2; // 2
+ UNS8 TestMaster_highestSubIndex_obj1280 = 3; /* number of subindex - 1*/
+ UNS32 TestMaster_obj1280_COB_ID_Client_to_Server_Transmit_SDO = 0x602; /* 1538 */
+ UNS32 TestMaster_obj1280_COB_ID_Server_to_Client_Receive_SDO = 0x582; /* 1410 */
+ UNS32 TestMaster_obj1280_Node_ID_of_the_SDO_Server = 0x2; /* 2 */
subindex TestMaster_Index1280[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1280 },
@@ -188,12 +169,12 @@
};
/* index 0x1400 : Receive PDO 1 Parameter. */
- UNS8 TestMaster_highestSubIndex_obj1400 = 5; // number of subindex - 1
- UNS32 TestMaster_obj1400_COB_ID_used_by_PDO = 0x182; // 386
- UNS8 TestMaster_obj1400_Transmission_Type = 0x1; // 1
- UNS16 TestMaster_obj1400_Inhibit_Time = 0x0; // 0
- UNS16 TestMaster_obj1400_Compatibility_Entry = 0x0; // 0
- UNS16 TestMaster_obj1400_Event_Timer = 0x0; // 0
+ UNS8 TestMaster_highestSubIndex_obj1400 = 5; /* number of subindex - 1*/
+ UNS32 TestMaster_obj1400_COB_ID_used_by_PDO = 0x182; /* 386 */
+ UNS8 TestMaster_obj1400_Transmission_Type = 0x1; /* 1 */
+ UNS16 TestMaster_obj1400_Inhibit_Time = 0x0; /* 0 */
+ UNS16 TestMaster_obj1400_Compatibility_Entry = 0x0; /* 0 */
+ UNS16 TestMaster_obj1400_Event_Timer = 0x0; /* 0 */
subindex TestMaster_Index1400[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1400 },
@@ -205,12 +186,12 @@
};
/* index 0x1401 : Receive PDO 2 Parameter. */
- UNS8 TestMaster_highestSubIndex_obj1401 = 5; // number of subindex - 1
- UNS32 TestMaster_obj1401_COB_ID_used_by_PDO = 0x282; // 642
- UNS8 TestMaster_obj1401_Transmission_Type = 0x1; // 1
- UNS16 TestMaster_obj1401_Inhibit_Time = 0x0; // 0
- UNS16 TestMaster_obj1401_Compatibility_Entry = 0x0; // 0
- UNS16 TestMaster_obj1401_Event_Timer = 0x0; // 0
+ UNS8 TestMaster_highestSubIndex_obj1401 = 5; /* number of subindex - 1*/
+ UNS32 TestMaster_obj1401_COB_ID_used_by_PDO = 0x282; /* 642 */
+ UNS8 TestMaster_obj1401_Transmission_Type = 0x1; /* 1 */
+ UNS16 TestMaster_obj1401_Inhibit_Time = 0x0; /* 0 */
+ UNS16 TestMaster_obj1401_Compatibility_Entry = 0x0; /* 0 */
+ UNS16 TestMaster_obj1401_Event_Timer = 0x0; /* 0 */
subindex TestMaster_Index1401[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1401 },
@@ -222,29 +203,29 @@
};
/* index 0x1600 : Receive PDO 1 Mapping. */
- UNS8 TestMaster_highestSubIndex_obj1600 = 2; // number of subindex - 1
+ UNS8 TestMaster_highestSubIndex_obj1600 = 2; /* number of subindex - 1*/
UNS32 TestMaster_obj1600[] =
{
- 0x20000008, // 536870920
- 0x20010008 // 536936456
+ 0x20000008, /* 536870920 */
+ 0x20010008 /* 536936456 */
};
subindex TestMaster_Index1600[] =
{
- { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1600 },
+ { RW, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1600 },
{ RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[0] },
{ RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[1] }
};
/* index 0x1601 : Receive PDO 2 Mapping. */
- UNS8 TestMaster_highestSubIndex_obj1601 = 2; // number of subindex - 1
+ UNS8 TestMaster_highestSubIndex_obj1601 = 2; /* number of subindex - 1*/
UNS32 TestMaster_obj1601[] =
{
- 0x20020008, // 537001992
- 0x20030008 // 537067528
+ 0x20020008, /* 537001992 */
+ 0x20030008 /* 537067528 */
};
subindex TestMaster_Index1601[] =
{
- { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1601 },
+ { RW, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1601 },
{ RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1601[0] },
{ RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1601[1] }
};
@@ -328,27 +309,28 @@
return &TestMaster_objdict[i];
}
-// To count at which received SYNC a PDO must be sent.
-// Even if no pdoTransmit are defined, at least one entry is computed
-// for compilations issues.
+/* To count at which received SYNC a PDO must be sent.
+ * Even if no pdoTransmit are defined, at least one entry is computed
+ * for compilations issues.
+ */
UNS8 TestMaster_count_sync[1] = {0,};
quick_index TestMaster_firstIndex = {
- SDO_SVR : 0,
- SDO_CLT : 8,
- PDO_RCV : 9,
- PDO_RCV_MAP : 11,
- PDO_TRS : 0,
- PDO_TRS_MAP : 0
+ 0, /* SDO_SVR */
+ 8, /* SDO_CLT */
+ 9, /* PDO_RCV */
+ 11, /* PDO_RCV_MAP */
+ 0, /* PDO_TRS */
+ 0 /* PDO_TRS_MAP */
};
quick_index TestMaster_lastIndex = {
- SDO_SVR : 0,
- SDO_CLT : 8,
- PDO_RCV : 10,
- PDO_RCV_MAP : 12,
- PDO_TRS : 0,
- PDO_TRS_MAP : 0
+ 0, /* SDO_SVR */
+ 8, /* SDO_CLT */
+ 10, /* PDO_RCV */
+ 12, /* PDO_RCV_MAP */
+ 0, /* PDO_TRS */
+ 0 /* PDO_TRS_MAP */
};
UNS16 TestMaster_ObjdictSize = sizeof(TestMaster_objdict)/sizeof(TestMaster_objdict[0]);
--- a/examples/TestMasterSlave/TestMaster.h Mon Jan 29 14:34:31 2007 +0100
+++ b/examples/TestMasterSlave/TestMaster.h Mon Jan 29 14:36:42 2007 +0100
@@ -1,50 +1,33 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack.
-
-Copyright (C): Edouard TISSERANT and Francis DUPIN
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
/* File generated by gen_cfile.py. Should not be modified. */
#include "data.h"
-// prototypes of function to be filled by app
+/* Prototypes of function provided by object dictionnary */
+UNS32 TestMaster_valueRangeTest (UNS8 typeValue, void * value);
+const indextable * TestMaster_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks);
+
+/* prototypes of function to be filled by app. */
void TestMaster_SDOtimeoutError(UNS8 line);
void TestMaster_heartbeatError(UNS8);
UNS8 TestMaster_canSend(Message *);
-void TestMaster_initialisation();
-void TestMaster_preOperational();
-void TestMaster_operational();
-void TestMaster_stopped();
+void TestMaster_initialisation(void);
+void TestMaster_preOperational(void);
+void TestMaster_operational(void);
+void TestMaster_stopped(void);
-void TestMaster_post_sync();
-void TestMaster_post_TPDO();
+void TestMaster_post_sync(void);
+void TestMaster_post_TPDO(void);
-// Master node data struct
+/* Master node data struct */
extern CO_Data TestMaster_Data;
-extern ODCallback_t Store_parameters_callbacks[]; // Callbacks of index0x1010
-extern ODCallback_t Restore_Default_Parameters_callbacks[]; // Callbacks of index0x1011
-extern UNS8 MasterMap1; // Mapped at index 0x2000, subindex 0x00
-extern ODCallback_t MasterMap1_callbacks[]; // Callbacks of index0x2000
-extern UNS8 MasterMap2; // Mapped at index 0x2001, subindex 0x00
-extern UNS8 MasterMap3; // Mapped at index 0x2002, subindex 0x00
-extern UNS8 MasterMap4; // Mapped at index 0x2003, subindex 0x00
+extern ODCallback_t Store_parameters_callbacks[]; /* Callbacks of index0x1010 */
+extern ODCallback_t Restore_Default_Parameters_callbacks[]; /* Callbacks of index0x1011 */
+extern UNS8 MasterMap1; /* Mapped at index 0x2000, subindex 0x00*/
+extern ODCallback_t MasterMap1_callbacks[]; /* Callbacks of index0x2000 */
+extern UNS8 MasterMap2; /* Mapped at index 0x2001, subindex 0x00*/
+extern UNS8 MasterMap3; /* Mapped at index 0x2002, subindex 0x00*/
+extern UNS8 MasterMap4; /* Mapped at index 0x2003, subindex 0x00*/
--- a/examples/TestMasterSlave/TestSlave.c Mon Jan 29 14:34:31 2007 +0100
+++ b/examples/TestMasterSlave/TestSlave.c Mon Jan 29 14:36:42 2007 +0100
@@ -1,24 +1,3 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack.
-
-Copyright (C): Edouard TISSERANT and Francis DUPIN
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
/* File generated by gen_cfile.py. Should not be modified. */
@@ -27,10 +6,10 @@
/**************************************************************************/
/* Declaration of the mapped variables */
/**************************************************************************/
-UNS8 SlaveMap1 = 0x0; // Mapped at index 0x2000, subindex 0x00
-UNS8 SlaveMap2 = 0x0; // Mapped at index 0x2001, subindex 0x00
-UNS8 SlaveMap3 = 0x0; // Mapped at index 0x2002, subindex 0x00
-UNS8 SlaveMap4 = 0x0; // Mapped at index 0x2003, subindex 0x00
+UNS8 SlaveMap1 = 0x0; /* Mapped at index 0x2000, subindex 0x00 */
+UNS8 SlaveMap2 = 0x0; /* Mapped at index 0x2001, subindex 0x00 */
+UNS8 SlaveMap3 = 0x0; /* Mapped at index 0x2002, subindex 0x00 */
+UNS8 SlaveMap4 = 0x0; /* Mapped at index 0x2003, subindex 0x00 */
/**************************************************************************/
/* Declaration of the value range types */
@@ -49,35 +28,37 @@
/* node_id default value.*/
UNS8 TestSlave_bDeviceNodeId = 0x00;
-//*****************************************************************************/
+/**************************************************************************/
/* Array of message processing information */
const UNS8 TestSlave_iam_a_slave = 1;
-TIMER_HANDLE TestSlave_heartBeatTimers[0];
-
-//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
-//
-// OBJECT DICTIONARY
-//
-//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
+TIMER_HANDLE TestSlave_heartBeatTimers[1];
+
+/*
+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
+
+ OBJECT DICTIONARY
+
+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
+*/
/* index 0x1000 : Device Type. */
- UNS32 TestSlave_obj1000 = 0x12D; // 301
+ UNS32 TestSlave_obj1000 = 0x12D; /* 301 */
subindex TestSlave_Index1000[] =
{
{ RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1000 }
};
/* index 0x1001 : Error Register. */
- UNS8 TestSlave_obj1001 = 0x0; // 0
+ UNS8 TestSlave_obj1001 = 0x0; /* 0 */
subindex TestSlave_Index1001[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestSlave_obj1001 }
};
/* index 0x1005 : SYNC COB ID. */
- UNS32 TestSlave_obj1005 = 0x80; // 128
+ UNS32 TestSlave_obj1005 = 0x80; /* 128 */
ODCallback_t TestSlave_Index1005_callbacks[] =
{
NULL,
@@ -88,7 +69,7 @@
};
/* index 0x1006 : Communication / Cycle Period. */
- UNS32 TestSlave_obj1006 = 0x0; // 0
+ UNS32 TestSlave_obj1006 = 0x0; /* 0 */
ODCallback_t TestSlave_Index1006_callbacks[] =
{
NULL,
@@ -99,11 +80,11 @@
};
/* index 0x1010 : Store parameters. */
- UNS8 TestSlave_highestSubIndex_obj1010 = 4; // number of subindex - 1
- UNS32 TestSlave_obj1010_Save_All_Parameters = 0x0; // 0
- UNS32 TestSlave_obj1010_Save_Communication_Parameters = 0x0; // 0
- UNS32 TestSlave_obj1010_Save_Application_Parameters = 0x0; // 0
- UNS32 TestSlave_obj1010_Save_Manufacturer_Parameters = 0x0; // 0
+ UNS8 TestSlave_highestSubIndex_obj1010 = 4; /* number of subindex - 1*/
+ UNS32 TestSlave_obj1010_Save_All_Parameters = 0x0; /* 0 */
+ UNS32 TestSlave_obj1010_Save_Communication_Parameters = 0x0; /* 0 */
+ UNS32 TestSlave_obj1010_Save_Application_Parameters = 0x0; /* 0 */
+ UNS32 TestSlave_obj1010_Save_Manufacturer_Parameters = 0x0; /* 0 */
ODCallback_t TestSlave_Index1010_callbacks[] =
{
NULL,
@@ -122,11 +103,11 @@
};
/* index 0x1011 : Restore Default Parameters. */
- UNS8 TestSlave_highestSubIndex_obj1011 = 4; // number of subindex - 1
- UNS32 TestSlave_obj1011_Restore_All_Default_Parameters = 0x0; // 0
- UNS32 TestSlave_obj1011_Restore_Communication_Default_Parameters = 0x0; // 0
- UNS32 TestSlave_obj1011_Restore_Application_Default_Parameters = 0x0; // 0
- UNS32 TestSlave_obj1011_Restore_Manufacturer_Default_Parameters = 0x0; // 0
+ UNS8 TestSlave_highestSubIndex_obj1011 = 4; /* number of subindex - 1*/
+ UNS32 TestSlave_obj1011_Restore_All_Default_Parameters = 0x0; /* 0 */
+ UNS32 TestSlave_obj1011_Restore_Communication_Default_Parameters = 0x0; /* 0 */
+ UNS32 TestSlave_obj1011_Restore_Application_Default_Parameters = 0x0; /* 0 */
+ UNS32 TestSlave_obj1011_Restore_Manufacturer_Default_Parameters = 0x0; /* 0 */
ODCallback_t TestSlave_Index1011_callbacks[] =
{
NULL,
@@ -146,22 +127,22 @@
/* index 0x1016 : Consumer Heartbeat Time */
UNS8 TestSlave_highestSubIndex_obj1016 = 0;
- UNS32 TestSlave_obj1016[0];
- subindex TestSlave_Index1016[0];
+ UNS32 TestSlave_obj1016[];
+ subindex TestSlave_Index1016[];
/* index 0x1017 : Producer Heartbeat Time. */
- UNS16 TestSlave_obj1017 = 0x3E8; // 1000
+ UNS16 TestSlave_obj1017 = 0x3E8; /* 1000 */
subindex TestSlave_Index1017[] =
{
{ RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1017 }
};
/* index 0x1018 : Identity. */
- UNS8 TestSlave_highestSubIndex_obj1018 = 4; // number of subindex - 1
- UNS32 TestSlave_obj1018_Vendor_ID = 0x0; // 0
- UNS32 TestSlave_obj1018_Product_Code = 0x0; // 0
- UNS32 TestSlave_obj1018_Revision_Number = 0x0; // 0
- UNS32 TestSlave_obj1018_Serial_Number = 0x0; // 0
+ UNS8 TestSlave_highestSubIndex_obj1018 = 4; /* number of subindex - 1*/
+ UNS32 TestSlave_obj1018_Vendor_ID = 0x0; /* 0 */
+ UNS32 TestSlave_obj1018_Product_Code = 0x0; /* 0 */
+ UNS32 TestSlave_obj1018_Revision_Number = 0x0; /* 0 */
+ UNS32 TestSlave_obj1018_Serial_Number = 0x0; /* 0 */
subindex TestSlave_Index1018[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1018 },
@@ -172,9 +153,9 @@
};
/* index 0x1200 : Server SDO Parameter. */
- UNS8 TestSlave_highestSubIndex_obj1200 = 2; // number of subindex - 1
- UNS32 TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO = 0x601; // 1537
- UNS32 TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO = 0x581; // 1409
+ UNS8 TestSlave_highestSubIndex_obj1200 = 2; /* number of subindex - 1*/
+ UNS32 TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO = 0x601; /* 1537 */
+ UNS32 TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO = 0x581; /* 1409 */
subindex TestSlave_Index1200[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1200 },
@@ -183,12 +164,12 @@
};
/* index 0x1800 : Transmit PDO 1 Parameter. */
- UNS8 TestSlave_highestSubIndex_obj1800 = 5; // number of subindex - 1
- UNS32 TestSlave_obj1800_COB_ID_used_by_PDO = 0x182; // 386
- UNS8 TestSlave_obj1800_Transmission_Type = 0x1; // 1
- UNS16 TestSlave_obj1800_Inhibit_Time = 0x0; // 0
- UNS16 TestSlave_obj1800_Compatibility_Entry = 0x0; // 0
- UNS16 TestSlave_obj1800_Event_Timer = 0x0; // 0
+ UNS8 TestSlave_highestSubIndex_obj1800 = 5; /* number of subindex - 1*/
+ UNS32 TestSlave_obj1800_COB_ID_used_by_PDO = 0x182; /* 386 */
+ UNS8 TestSlave_obj1800_Transmission_Type = 0x1; /* 1 */
+ UNS16 TestSlave_obj1800_Inhibit_Time = 0x0; /* 0 */
+ UNS16 TestSlave_obj1800_Compatibility_Entry = 0x0; /* 0 */
+ UNS16 TestSlave_obj1800_Event_Timer = 0x0; /* 0 */
subindex TestSlave_Index1800[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1800 },
@@ -200,12 +181,12 @@
};
/* index 0x1801 : Transmit PDO 2 Parameter. */
- UNS8 TestSlave_highestSubIndex_obj1801 = 5; // number of subindex - 1
- UNS32 TestSlave_obj1801_COB_ID_used_by_PDO = 0x282; // 642
- UNS8 TestSlave_obj1801_Transmission_Type = 0x1; // 1
- UNS16 TestSlave_obj1801_Inhibit_Time = 0x0; // 0
- UNS16 TestSlave_obj1801_Compatibility_Entry = 0x0; // 0
- UNS16 TestSlave_obj1801_Event_Timer = 0x0; // 0
+ UNS8 TestSlave_highestSubIndex_obj1801 = 5; /* number of subindex - 1*/
+ UNS32 TestSlave_obj1801_COB_ID_used_by_PDO = 0x282; /* 642 */
+ UNS8 TestSlave_obj1801_Transmission_Type = 0x1; /* 1 */
+ UNS16 TestSlave_obj1801_Inhibit_Time = 0x0; /* 0 */
+ UNS16 TestSlave_obj1801_Compatibility_Entry = 0x0; /* 0 */
+ UNS16 TestSlave_obj1801_Event_Timer = 0x0; /* 0 */
subindex TestSlave_Index1801[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1801 },
@@ -217,29 +198,29 @@
};
/* index 0x1A00 : Transmit PDO 1 Mapping. */
- UNS8 TestSlave_highestSubIndex_obj1A00 = 2; // number of subindex - 1
+ UNS8 TestSlave_highestSubIndex_obj1A00 = 2; /* number of subindex - 1*/
UNS32 TestSlave_obj1A00[] =
{
- 0x20000008, // 536870920
- 0x20010008 // 536936456
+ 0x20000008, /* 536870920 */
+ 0x20010008 /* 536936456 */
};
subindex TestSlave_Index1A00[] =
{
- { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A00 },
+ { RW, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A00 },
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[0] },
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[1] }
};
/* index 0x1A01 : Transmit PDO 2 Mapping. */
- UNS8 TestSlave_highestSubIndex_obj1A01 = 2; // number of subindex - 1
+ UNS8 TestSlave_highestSubIndex_obj1A01 = 2; /* number of subindex - 1*/
UNS32 TestSlave_obj1A01[] =
{
- 0x20020008, // 537001992
- 0x20030008 // 537067528
+ 0x20020008, /* 537001992 */
+ 0x20030008 /* 537067528 */
};
subindex TestSlave_Index1A01[] =
{
- { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A01 },
+ { RW, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A01 },
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A01[0] },
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A01[1] }
};
@@ -319,27 +300,28 @@
return &TestSlave_objdict[i];
}
-// To count at which received SYNC a PDO must be sent.
-// Even if no pdoTransmit are defined, at least one entry is computed
-// for compilations issues.
+/* To count at which received SYNC a PDO must be sent.
+ * Even if no pdoTransmit are defined, at least one entry is computed
+ * for compilations issues.
+ */
UNS8 TestSlave_count_sync[2] = {0,};
quick_index TestSlave_firstIndex = {
- SDO_SVR : 8,
- SDO_CLT : 0,
- PDO_RCV : 0,
- PDO_RCV_MAP : 0,
- PDO_TRS : 9,
- PDO_TRS_MAP : 11
+ 8, /* SDO_SVR */
+ 0, /* SDO_CLT */
+ 0, /* PDO_RCV */
+ 0, /* PDO_RCV_MAP */
+ 9, /* PDO_TRS */
+ 11 /* PDO_TRS_MAP */
};
quick_index TestSlave_lastIndex = {
- SDO_SVR : 8,
- SDO_CLT : 0,
- PDO_RCV : 0,
- PDO_RCV_MAP : 0,
- PDO_TRS : 10,
- PDO_TRS_MAP : 12
+ 8, /* SDO_SVR */
+ 0, /* SDO_CLT */
+ 0, /* PDO_RCV */
+ 0, /* PDO_RCV_MAP */
+ 10, /* PDO_TRS */
+ 12 /* PDO_TRS_MAP */
};
UNS16 TestSlave_ObjdictSize = sizeof(TestSlave_objdict)/sizeof(TestSlave_objdict[0]);
--- a/examples/TestMasterSlave/TestSlave.h Mon Jan 29 14:34:31 2007 +0100
+++ b/examples/TestMasterSlave/TestSlave.h Mon Jan 29 14:36:42 2007 +0100
@@ -1,49 +1,32 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack.
-
-Copyright (C): Edouard TISSERANT and Francis DUPIN
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
/* File generated by gen_cfile.py. Should not be modified. */
#include "data.h"
-// prototypes of function to be filled by app
+/* Prototypes of function provided by object dictionnary */
+UNS32 TestSlave_valueRangeTest (UNS8 typeValue, void * value);
+const indextable * TestSlave_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks);
+
+/* prototypes of function to be filled by app. */
void TestSlave_SDOtimeoutError(UNS8 line);
void TestSlave_heartbeatError(UNS8);
UNS8 TestSlave_canSend(Message *);
-void TestSlave_initialisation();
-void TestSlave_preOperational();
-void TestSlave_operational();
-void TestSlave_stopped();
+void TestSlave_initialisation(void);
+void TestSlave_preOperational(void);
+void TestSlave_operational(void);
+void TestSlave_stopped(void);
-void TestSlave_post_sync();
-void TestSlave_post_TPDO();
+void TestSlave_post_sync(void);
+void TestSlave_post_TPDO(void);
-// Master node data struct
+/* Master node data struct */
extern CO_Data TestSlave_Data;
-extern ODCallback_t Store_parameters_callbacks[]; // Callbacks of index0x1010
-extern ODCallback_t Restore_Default_Parameters_callbacks[]; // Callbacks of index0x1011
-extern UNS8 SlaveMap1; // Mapped at index 0x2000, subindex 0x00
-extern UNS8 SlaveMap2; // Mapped at index 0x2001, subindex 0x00
-extern UNS8 SlaveMap3; // Mapped at index 0x2002, subindex 0x00
-extern UNS8 SlaveMap4; // Mapped at index 0x2003, subindex 0x00
+extern ODCallback_t Store_parameters_callbacks[]; /* Callbacks of index0x1010 */
+extern ODCallback_t Restore_Default_Parameters_callbacks[]; /* Callbacks of index0x1011 */
+extern UNS8 SlaveMap1; /* Mapped at index 0x2000, subindex 0x00*/
+extern UNS8 SlaveMap2; /* Mapped at index 0x2001, subindex 0x00*/
+extern UNS8 SlaveMap3; /* Mapped at index 0x2002, subindex 0x00*/
+extern UNS8 SlaveMap4; /* Mapped at index 0x2003, subindex 0x00*/