# HG changeset patch # User luis # Date 1190984918 -7200 # Node ID 26015ee2c2c9f9f202e4f6d259a02b6b7cf4a952 # Parent fa4df65d06833dcb776221faf6da197757ef9c94 Modified codes in MSG_ERR and MSG_WAR in emcy.c Defined OD_VALUE_RANGE_EXCEEDED in def.h Modified gen_cfile.py so than range test for 1003h sub0 sends OD_VALUE_RANGE_EXCEEDED as abortcode when value written is different from 0. diff -r fa4df65d0683 -r 26015ee2c2c9 doc/code_debug.txt --- a/doc/code_debug.txt Thu Sep 27 09:42:51 2007 +0200 +++ b/doc/code_debug.txt Fri Sep 28 15:08:38 2007 +0200 @@ -18,7 +18,7 @@ 2 -> Warning 3 -> Information -f : 0 -> In file sync.c +f : 0 -> In file sync.c, emcy.c 1 -> lifegrd.c 2 -> objacces.c 3 -> timer.c diff -r fa4df65d0683 -r 26015ee2c2c9 include/def.h --- a/include/def.h Thu Sep 27 09:42:51 2007 +0200 +++ b/include/def.h Fri Sep 28 15:08:38 2007 +0200 @@ -35,6 +35,7 @@ #define OD_NOT_MAPPABLE 0x06040041 #define OD_LENGTH_DATA_INVALID 0x06070010 #define OD_NO_SUCH_SUBINDEX 0x06090011 +#define OD_VALUE_RANGE_EXCEEDED 0x06090030 /* Value range test result */ #define OD_VALUE_TOO_LOW 0x06090031 /* Value range test result */ #define OD_VALUE_TOO_HIGH 0x06090032 /* Value range test result */ /* Others SDO abort codes diff -r fa4df65d0683 -r 26015ee2c2c9 objdictgen/gen_cfile.py --- a/objdictgen/gen_cfile.py Thu Sep 27 09:42:51 2007 +0200 +++ b/objdictgen/gen_cfile.py Fri Sep 28 15:08:38 2007 +0200 @@ -107,8 +107,7 @@ valueRangeContent = "" strDefine = "\n#define valueRange_EMC 0x9F /* Type for index 0x1003 subindex 0x00 (only set of value 0 is possible) */" strSwitch = """ case valueRange_EMC: - if (*(UNS8*)value < (UNS8)0) return OD_VALUE_TOO_LOW; - if (*(UNS8*)value > (UNS8)0) return OD_VALUE_TOO_HIGH; + if (*(UNS8*)value != (UNS8)0) return OD_VALUE_RANGE_EXCEEDED; break;\n""" internal_types["valueRange_EMC"] = ("UNS8", "", "valueRange_EMC") num = 0 diff -r fa4df65d0683 -r 26015ee2c2c9 src/emcy.c --- a/src/emcy.c Thu Sep 27 09:42:51 2007 +0200 +++ b/src/emcy.c Fri Sep 28 15:08:38 2007 +0200 @@ -98,7 +98,7 @@ { Message m; - MSG_WAR(0xA001, "sendEMCY", 0); + MSG_WAR(0x3051, "sendEMCY", 0); m.cob_id.w = cob_id ; m.rtr = NOT_A_REQUEST; @@ -134,7 +134,7 @@ { if (d->error_data[index].active) { - MSG_WAR(0xA002, "EMCY message already sent", 0); + MSG_WAR(0x3052, "EMCY message already sent", 0); return 0; } else d->error_data[index].active = 1; /* set as active error */ break; @@ -146,7 +146,7 @@ if (index == EMCY_MAX_ERRORS) /* error_data full */ { - MSG_ERR(0xA003, "error_data full", 0); + MSG_ERR(0x3053, "error_data full", 0); return 1; } @@ -213,7 +213,7 @@ *d->error_register = errRegister_tmp; } else - MSG_WAR(0xA004, "recovered error was not active", 0); + MSG_WAR(0x3054, "recovered error was not active", 0); } /*! This function is responsible to process an EMCY canopen-message. @@ -229,11 +229,11 @@ UNS16 errCode; UNS8 errReg; - MSG_WAR(0xA005, "EMCY received. Proceed. ", 0); + MSG_WAR(0x3055, "EMCY received. Proceed. ", 0); /* Test if the size of the EMCY is ok */ if ( m->len != 8) { - MSG_ERR(0xA006, "Error size EMCY. CobId : ", m->cob_id.w); + MSG_ERR(0x1056, "Error size EMCY. CobId : ", m->cob_id.w); return; }