bugfix
This commit is contained in:
parent
28e22c20ee
commit
d34df5ba18
1 changed files with 4 additions and 3 deletions
|
|
@ -26,7 +26,8 @@ def readSym(symfile):
|
||||||
continue
|
continue
|
||||||
if name == "":
|
if name == "":
|
||||||
continue
|
continue
|
||||||
tmp["CycleTime"] = 0
|
if not tmp.has_key("CycleTime"):
|
||||||
|
tmp["CycleTime"] = 0
|
||||||
message[name] = tmp
|
message[name] = tmp
|
||||||
tmp = {}
|
tmp = {}
|
||||||
name = ""
|
name = ""
|
||||||
|
|
@ -52,7 +53,7 @@ def readSym(symfile):
|
||||||
|
|
||||||
elif line.find("ID") == 0:
|
elif line.find("ID") == 0:
|
||||||
msg_id = line.split("=")[1].strip().rstrip("h")
|
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:
|
elif line.find("DLC") == 0:
|
||||||
tmp["DLC"] = int(line.split("=")[1].strip())
|
tmp["DLC"] = int(line.split("=")[1].strip())
|
||||||
|
|
@ -117,7 +118,7 @@ def Sym2Code(symfile, adapter = "pcan"):
|
||||||
|
|
||||||
def Add2Adapter(pcan, symfile):
|
def Add2Adapter(pcan, symfile):
|
||||||
'''
|
'''
|
||||||
@attention: not tested
|
|
||||||
'''
|
'''
|
||||||
mes = readSym(symfile)
|
mes = readSym(symfile)
|
||||||
print ""
|
print ""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue