examples/gene_SYNC_HCS12/appli.c
changeset 378 d2abf6c8c27b
parent 365 9b76e0881beb
child 801 32d146b64a35
equal deleted inserted replaced
377:bea5a1576cbd 378:d2abf6c8c27b
   260 
   260 
   261 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
   261 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
   262 // FUNCTIONS WHICH ARE PART OF CANFESTIVAL and *must* be implemented here.
   262 // FUNCTIONS WHICH ARE PART OF CANFESTIVAL and *must* be implemented here.
   263 
   263 
   264 //------------------------------------------------------------------------------
   264 //------------------------------------------------------------------------------
   265 void gene_SYNC_heartbeatError( UNS8 heartbeatID )
   265 void gene_SYNC_heartbeatError(CO_Data* d,  UNS8 heartbeatID )
   266 {
   266 {
   267   
   267   
   268   MSG_ERR(0x1F00, "HeartBeat not received from node : ", heartbeatID);
   268   MSG_ERR(0x1F00, "HeartBeat not received from node : ", heartbeatID);
   269 }
   269 }
   270 
   270 
   271 //------------------------------------------------------------------------------
   271 //------------------------------------------------------------------------------
   272 void gene_SYNC_initialisation()
   272 void gene_SYNC_initialisation(CO_Data* d)
   273 {  
   273 {  
   274   MSG_WAR (0x3F00, "Entering in INIT ", 0); 
   274   MSG_WAR (0x3F00, "Entering in INIT ", 0); 
   275   initSensor();  
   275   initSensor();  
   276 
   276 
   277   IO_PORTS_8(PORTB) &= ~ 0x01; // led  0         : ON
   277   IO_PORTS_8(PORTB) &= ~ 0x01; // led  0         : ON
   279   
   279   
   280 }
   280 }
   281 
   281 
   282 
   282 
   283 //------------------------------------------------------------------------------
   283 //------------------------------------------------------------------------------
   284 void gene_SYNC_preOperational()
   284 void gene_SYNC_preOperational(CO_Data* d)
   285 {
   285 {
   286   MSG_WAR (0x3F01, "Entering in PRE-OPERATIONAL ", 0); 
   286   MSG_WAR (0x3F01, "Entering in PRE-OPERATIONAL ", 0); 
   287   IO_PORTS_8(PORTB) &= ~ 0x03; // leds 0, 1      : ON
   287   IO_PORTS_8(PORTB) &= ~ 0x03; // leds 0, 1      : ON
   288   IO_PORTS_8(PORTB) |=   0x0C; // leds 2, 3      : OFF
   288   IO_PORTS_8(PORTB) |=   0x0C; // leds 2, 3      : OFF
   289     /* default values for the msg CAN filters */
   289     /* default values for the msg CAN filters */
   309    
   309    
   310 }
   310 }
   311 
   311 
   312 
   312 
   313 //------------------------------------------------------------------------------
   313 //------------------------------------------------------------------------------
   314 void gene_SYNC_operational()
   314 void gene_SYNC_operational(CO_Data* d)
   315 { 
   315 { 
   316    MSG_WAR (0x3F02, "Entering in OPERATIONAL ", 0); 
   316    MSG_WAR (0x3F02, "Entering in OPERATIONAL ", 0); 
   317    IO_PORTS_8(PORTB) &= ~ 0x07; // leds 0, 1, 2   : ON
   317    IO_PORTS_8(PORTB) &= ~ 0x07; // leds 0, 1, 2   : ON
   318    IO_PORTS_8(PORTB) |=   0x08; // leds 3         : OFF
   318    IO_PORTS_8(PORTB) |=   0x08; // leds 3         : OFF
   319    
   319    
   363    	 		MSG_WAR (0x3F04, "Downloaded CAN Rcv filter applied ", 0); 
   363    	 		MSG_WAR (0x3F04, "Downloaded CAN Rcv filter applied ", 0); 
   364    	}
   364    	}
   365 }
   365 }
   366 
   366 
   367 //------------------------------------------------------------------------------
   367 //------------------------------------------------------------------------------
   368 void gene_SYNC_stopped()
   368 void gene_SYNC_stopped(CO_Data* d)
   369 {
   369 {
   370   MSG_WAR (0x3F02, "Entering in STOPPED ", 0); 
   370   MSG_WAR (0x3F02, "Entering in STOPPED ", 0); 
   371   IO_PORTS_8(PORTB) |=   0x0E; // leds 1, 2, 3, 4   : OFF
   371   IO_PORTS_8(PORTB) |=   0x0E; // leds 1, 2, 3, 4   : OFF
   372 }
   372 }
   373 
   373