examples/gene_SYNC_HCS12/appli.c
changeset 149 fe50ada8020b
parent 80 37354e408645
child 172 0248c2b148bb
equal deleted inserted replaced
148:ad3de8730172 149:fe50ada8020b
   280   MSG_ERR(0x1F01, "SDO timeout for line : ", line);
   280   MSG_ERR(0x1F01, "SDO timeout for line : ", line);
   281   // See the transfer structure in sdo.h to know what informations
   281   // See the transfer structure in sdo.h to know what informations
   282   // you can retreive.
   282   // you can retreive.
   283   MSG_ERR(0x1F02, "  to access index ", gene_SYNC_Data.transfers[line].index);
   283   MSG_ERR(0x1F02, "  to access index ", gene_SYNC_Data.transfers[line].index);
   284   MSG_ERR(0x1F03, "         subIndex ", gene_SYNC_Data.transfers[line].subIndex);
   284   MSG_ERR(0x1F03, "         subIndex ", gene_SYNC_Data.transfers[line].subIndex);
   285 }
       
   286 
       
   287 //------------------------------------------------------------------------------
       
   288 UNS8 gene_SYNC_canSend(Message *m)
       
   289 {
       
   290   // HCS12 driver function to send the CAN msg
       
   291   canMsgTransmit(CAN0, *m);
       
   292   return 0;
       
   293 }
   285 }
   294 
   286 
   295 //------------------------------------------------------------------------------
   287 //------------------------------------------------------------------------------
   296 void gene_SYNC_initialisation()
   288 void gene_SYNC_initialisation()
   297 {  
   289 {  
   393 {
   385 {
   394   MSG_WAR (0x3F02, "Entering in STOPPED ", 0); 
   386   MSG_WAR (0x3F02, "Entering in STOPPED ", 0); 
   395   IO_PORTS_8(PORTB) |=   0x0E; // leds 1, 2, 3, 4   : OFF
   387   IO_PORTS_8(PORTB) |=   0x0E; // leds 1, 2, 3, 4   : OFF
   396 }
   388 }
   397 
   389 
   398 //------------------------------------------------------------------------------
       
   399 void gene_SYNC_post_sync()
       
   400 {
       
   401 }
       
   402 
       
   403 //------------------------------------------------------------------------------
       
   404 void gene_SYNC_post_TPDO()
       
   405 {
       
   406 }
       
   407 
       
   408 // End functions which are part of Canfestival
   390 // End functions which are part of Canfestival
   409 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
   391 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
   410 
   392 
   411 
   393 
   412 /******************************************************************************/
   394 /******************************************************************************/
   417 UNS8 main (void)
   399 UNS8 main (void)
   418 {
   400 {
   419 
   401 
   420   MSG_WAR(0x3F34, "Entering in the main ", 0);
   402   MSG_WAR(0x3F34, "Entering in the main ", 0);
   421   //----------------------------- INITIALISATION --------------------------------
   403   //----------------------------- INITIALISATION --------------------------------
       
   404   gene_SYNC_Data.heartbeatError = gene_SYNC_heartbeatError;
       
   405   gene_SYNC_Data.SDOtimeoutError = gene_SYNC_SDOtimeoutError;
       
   406   gene_SYNC_Data.initialisation = gene_SYNC_initialisation;
       
   407   gene_SYNC_Data.preOperational = gene_SYNC_preOperational;
       
   408   gene_SYNC_Data.preOperational = gene_SYNC_operational;
       
   409   gene_SYNC_Data.stopped = gene_SYNC_stopped;
       
   410 
   422   
   411   
   423   /* Put the node in Initialisation mode */
   412   /* Put the node in Initialisation mode */
   424   MSG_WAR(0x3F35, "Will entering in INIT ", 0);
   413   MSG_WAR(0x3F35, "Will entering in INIT ", 0);
   425   setState(&gene_SYNC_Data, Initialisation);
   414   setState(&gene_SYNC_Data, Initialisation);
   426 
   415