examples/TestMasterSlave/Slave.c
changeset 284 24bf3d692993
parent 236 905677ed00f3
child 296 03f2b8b8cb0b
equal deleted inserted replaced
283:e0b3096230e5 284:24bf3d692993
    84 
    84 
    85 void TestSlave_post_TPDO()
    85 void TestSlave_post_TPDO()
    86 {
    86 {
    87         SlaveMap13 += 1;
    87         SlaveMap13 += 1;
    88 	eprintf("TestSlave_post_TPDO\n");
    88 	eprintf("TestSlave_post_TPDO\n");
       
    89 	
       
    90 	/* send an error and recover inmediately every 12 cycles */
       
    91 	if(SlaveMap13 % 12 == 0)
       
    92 	{
       
    93 		EMCY_setError(&TestSlave_Data, 0x4200, 0x08);
       
    94 		EMCY_errorRecovered(&TestSlave_Data, 0x4200);
       
    95 	}
    89 }
    96 }
    90 
    97 
    91 void TestSlave_storeODSubIndex(UNS16 wIndex, UNS8 bSubindex)
    98 void TestSlave_storeODSubIndex(UNS16 wIndex, UNS8 bSubindex)
    92 {
    99 {
    93 	/*TODO : 
   100 	/*TODO : 
    99 	 * for variables to store.
   106 	 * for variables to store.
   100 	 * 
   107 	 * 
   101 	 * */
   108 	 * */
   102 	eprintf("TestSlave_storeODSubIndex : %4.4x %2.2x\n", wIndex,  bSubindex);
   109 	eprintf("TestSlave_storeODSubIndex : %4.4x %2.2x\n", wIndex,  bSubindex);
   103 }
   110 }
       
   111 
       
   112 void TestSlave_post_emcy(UNS8 nodeID, UNS16 errCode, UNS8 errReg)
       
   113 {
       
   114 	eprintf("Slave received EMCY message. Node: %2.2x  ErrorCode: %4.4x  ErrorRegister: %2.2x\n", nodeID, errCode, errReg);
       
   115 }