diff -r f45fd4cd3832 -r 34654679f262 doc/doxygen/html/Master_8c-source.html --- a/doc/doxygen/html/Master_8c-source.html Fri Jul 06 10:53:15 2007 +0200 +++ b/doc/doxygen/html/Master_8c-source.html Mon Jul 16 08:56:03 2007 +0200 @@ -18,7 +18,7 @@
00001 /* 00002 This file is part of CanFestival, a library implementing CanOpen Stack. 00003 @@ -46,9 +46,9 @@ 00025 #include "TestMasterSlave.h" 00026 00027 /*****************************************************************************/ -00028 void TestMaster_heartbeatError(UNS8 heartbeatID) +00028 void TestMaster_heartbeatError(UNS8 heartbeatID) 00029 { -00030 eprintf("TestMaster_heartbeatError %d\n", heartbeatID); +00030 eprintf("TestMaster_heartbeatError %d\n", heartbeatID); 00031 } 00032 00033 /******************************************************** @@ -56,47 +56,47 @@ 00035 * - setup master RPDO 1 to receive TPDO 1 from id 2 00036 * - setup master RPDO 2 to receive TPDO 2 from id 2 00037 ********************************************************/ -00038 void TestMaster_initialisation() +00038 void TestMaster_initialisation() 00039 { -00040 UNS32 PDO1_COBID = 0x0182; -00041 UNS32 PDO2_COBID = 0x0282; -00042 UNS8 size = sizeof(UNS32); +00040 UNS32 PDO1_COBID = 0x0182; +00041 UNS32 PDO2_COBID = 0x0282; +00042 UNS8 size = sizeof(UNS32); 00043 -00044 eprintf("TestMaster_initialisation\n"); +00044 eprintf("TestMaster_initialisation\n"); 00045 00046 /***************************************** 00047 * Define RPDOs to match slave ID=2 TPDOs* 00048 *****************************************/ -00049 writeLocalDict( &TestMaster_Data, /*CO_Data* d*/ +00049 writeLocalDict( &TestMaster_Data, /*CO_Data* d*/ 00050 0x1400, /*UNS16 index*/ 00051 0x01, /*UNS8 subind*/ 00052 &PDO1_COBID, /*void * pSourceData,*/ 00053 &size, /* UNS8 * pExpectedSize*/ -00054 RW); /* UNS8 checkAccess */ +00054 RW); /* UNS8 checkAccess */ 00055 -00056 writeLocalDict( &TestMaster_Data, /*CO_Data* d*/ +00056 writeLocalDict( &TestMaster_Data, /*CO_Data* d*/ 00057 0x1401, /*UNS16 index*/ 00058 0x01, /*UNS8 subind*/ 00059 &PDO2_COBID, /*void * pSourceData,*/ 00060 &size, /* UNS8 * pExpectedSize*/ -00061 RW); /* UNS8 checkAccess */ +00061 RW); /* UNS8 checkAccess */ 00062 } 00063 00064 // Step counts number of times ConfigureSlaveNode is called 00065 static init_step = 0; 00066 00067 /*Froward declaration*/ -00068 static void ConfigureSlaveNode(CO_Data* d, UNS8 nodeId); +00068 static void ConfigureSlaveNode(CO_Data* d, UNS8 nodeId); 00069 00070 -00071 static void CheckSDOAndContinue(CO_Data* d, UNS8 nodeId) +00071 static void CheckSDOAndContinue(CO_Data* d, UNS8 nodeId) 00072 { -00073 UNS32 abortCode; -00074 if(getWriteResultNetworkDict (d, nodeId, &abortCode) != SDO_FINISHED) -00075 eprintf("Master : Failed in initializing slave %2.2x, step %d, AbortCode :%4.4x \n", nodeId, init_step, abortCode); +00073 UNS32 abortCode; +00074 if(getWriteResultNetworkDict (d, nodeId, &abortCode) != SDO_FINISHED) +00075 eprintf("Master : Failed in initializing slave %2.2x, step %d, AbortCode :%4.4x \n", nodeId, init_step, abortCode); 00076 00077 /* Finalise last SDO transfer with this node */ -00078 closeSDOtransfer(&TestMaster_Data, nodeId, SDO_CLIENT); +00078 closeSDOtransfer(&TestMaster_Data, nodeId, SDO_CLIENT); 00079 00080 ConfigureSlaveNode(d, nodeId); 00081 } @@ -117,20 +117,20 @@ 00096 * finished. 00097 ********************************************************/ 00098 -00099 static void ConfigureSlaveNode(CO_Data* d, UNS8 nodeId) +00099 static void ConfigureSlaveNode(CO_Data* d, UNS8 nodeId) 00100 { 00101 /* Master configure heartbeat producer time at 1000 ms 00102 * for slave node-id 0x02 by DCF concise */ 00103 -00104 UNS8 Transmission_Type = 0x01; -00105 UNS32 abortCode; -00106 UNS8 res; -00107 eprintf("Master : ConfigureSlaveNode %2.2x\n", nodeId); +00104 UNS8 Transmission_Type = 0x01; +00105 UNS32 abortCode; +00106 UNS8 res; +00107 eprintf("Master : ConfigureSlaveNode %2.2x\n", nodeId); 00108 00109 switch(++init_step){ 00110 case 1: /*First step : setup Slave's TPDO 1 to be transmitted on SYNC*/ -00111 eprintf("Master : set slave %2.2x TPDO 1 transmit type\n", nodeId); -00112 res = writeNetworkDictCallBack (d, /*CO_Data* d*/ +00111 eprintf("Master : set slave %2.2x TPDO 1 transmit type\n", nodeId); +00112 res = writeNetworkDictCallBack (d, /*CO_Data* d*/ 00113 nodeId, /*UNS8 nodeId*/ 00114 0x1800, /*UNS16 index*/ 00115 0x02, /*UNS8 subindex*/ @@ -141,8 +141,8 @@ 00120 break; 00121 00122 case 2: /*Second step*/ -00123 eprintf("Master : set slave %2.2x TPDO 2 transmit type\n", nodeId); -00124 writeNetworkDictCallBack (d, /*CO_Data* d*/ +00123 eprintf("Master : set slave %2.2x TPDO 2 transmit type\n", nodeId); +00124 writeNetworkDictCallBack (d, /*CO_Data* d*/ 00125 nodeId, /*UNS8 nodeId*/ 00126 0x1801, /*UNS16 index*/ 00127 0x02, /*UNS16 index*/ @@ -156,96 +156,154 @@ 00135 /****************************** START *******************************/ 00136 00137 /* Put the master in operational mode */ -00138 setState(d, Operational); +00138 setState(d, Operational); 00139 00140 /* Ask slave node to go in operational mode */ -00141 masterSendNMTstateChange (d, nodeId, NMT_Start_Node); +00141 masterSendNMTstateChange (d, nodeId, NMT_Start_Node); 00142 00143 } 00144 } 00145 -00146 void TestMaster_preOperational() +00146 void TestMaster_preOperational() 00147 { 00148 -00149 eprintf("TestMaster_preOperational\n"); -00150 ConfigureSlaveNode(&TestMaster_Data, 0x02); +00149 eprintf("TestMaster_preOperational\n"); +00150 ConfigureSlaveNode(&TestMaster_Data, 0x02); 00151 00152 } 00153 -00154 void TestMaster_operational() +00154 void TestMaster_operational() 00155 { -00156 eprintf("TestMaster_operational\n"); +00156 eprintf("TestMaster_operational\n"); 00157 } 00158 -00159 void TestMaster_stopped() +00159 void TestMaster_stopped() 00160 { -00161 eprintf("TestMaster_stopped\n"); +00161 eprintf("TestMaster_stopped\n"); 00162 } 00163 -00164 void TestMaster_post_sync() +00164 void TestMaster_post_sync() 00165 { -00166 eprintf("TestMaster_post_sync\n"); -00167 eprintf("Master: %d %d %d %d %d %d %d %d %d %x %x\n",MasterMap1,MasterMap2 ,MasterMap3, MasterMap4,MasterMap5,MasterMap6,MasterMap7,MasterMap8,MasterMap9,MasterMap10,MasterMap11); -00168 } -00169 -00170 char query_result = 0; -00171 char waiting_answer = 0; -00172 -00173 void TestMaster_post_TPDO() -00174 { -00175 eprintf("TestMaster_post_TPDO\n"); -00176 // -00177 // { -00178 // char zero = 0; -00179 // if(MasterMap4 > 0x80){ -00180 // writeNetworkDict ( -00181 // &TestMaster_Data, -00182 // TestSlave_Data->bDeviceNodeId, -00183 // 0x2002, -00184 // 0x00, -00185 // 1, -00186 // 0, -00187 // &zero); -00188 // } -00189 // } -00190 -00191 if(waiting_answer){ -00192 UNS32 abortCode; -00193 UNS8 size; -00194 switch(getReadResultNetworkDict ( -00195 &TestMaster_Data, -00196 0x02, -00197 &query_result, -00198 &size, -00199 &abortCode)) -00200 { -00201 case SDO_FINISHED: -00202 /* Do something with result here !!*/ -00203 eprintf("Got SDO answer (0x2002, 0x00), %d %d\n",query_result,size); -00204 case SDO_ABORTED_RCV: -00205 case SDO_ABORTED_INTERNAL: -00206 case SDO_RESET: -00207 waiting_answer = 0; -00208 closeSDOtransfer( -00209 &TestMaster_Data, -00210 0x02, -00211 SDO_CLIENT); -00212 break; -00213 case SDO_DOWNLOAD_IN_PROGRESS: -00214 case SDO_UPLOAD_IN_PROGRESS: -00215 break; -00216 } -00217 }else if(MasterMap1 % 10 == 0){ -00218 readNetworkDict ( -00219 &TestMaster_Data, -00220 0x02, -00221 0x2002, -00222 0x00, -00223 0); -00224 waiting_answer = 1; -00225 } -00226 } -