diff --git a/CANLibrary/Sym2Lib.py b/CANLibrary/Sym2Lib.py index 0a78098..0662430 100644 --- a/CANLibrary/Sym2Lib.py +++ b/CANLibrary/Sym2Lib.py @@ -26,7 +26,8 @@ def readSym(symfile): continue if name == "": continue - tmp["CycleTime"] = 0 + if not tmp.has_key("CycleTime"): + tmp["CycleTime"] = 0 message[name] = tmp tmp = {} name = "" @@ -52,7 +53,7 @@ def readSym(symfile): elif line.find("ID") == 0: msg_id = line.split("=")[1].strip().rstrip("h") - tmp["ID"] = int(msg_id, 16) + tmp["ID"] = int(msg_id, 16) # convert hex to int elif line.find("DLC") == 0: tmp["DLC"] = int(line.split("=")[1].strip()) @@ -117,7 +118,7 @@ def Sym2Code(symfile, adapter = "pcan"): def Add2Adapter(pcan, symfile): ''' - @attention: not tested + ''' mes = readSym(symfile) print ""