--- a/LPCBus.py Mon Dec 08 17:02:35 2014 +0100
+++ b/LPCBus.py Mon Dec 08 17:24:59 2014 +0100
@@ -1,3 +1,4 @@
bus_template_code = {"MC8":"""
/* Code generated by LPCBus confnode */
@@ -181,8 +182,25 @@
+# to be overloaded at import from plcopen.structures import LOCATIONDATATYPES
from PLCControler import LOCATION_CONFNODE, LOCATION_MODULE, LOCATION_GROUP,\
LOCATION_VAR_INPUT, LOCATION_VAR_OUTPUT, LOCATION_VAR_MEMORY
@@ -364,7 +382,7 @@
# define a unique name for the generated C file
location_str = "_".join(map(str, current_location))
- BusName = arch + ":" + self.BaseParams.getName()
+ BusName = LPCarch + ":" + self.BaseParams.getName() bcode = bus_code.get(BusName,{"decl":"",
@@ -430,12 +448,12 @@
code_str["publish_code"] += " " + var["Publish"] % ("*" + var["location"]) + "\n"
- if arch not in bus_template_code:
+ if LPCarch not in bus_template_code: raise Exception, "Unknown arch %s. Please use %s"%(
- arch,repr(bus_template_code.keys()))
+ LPCarch,repr(bus_template_code.keys())) Gen_Module_path = os.path.join(buildpath, "Bus_%s.c"%location_str)
module = open(Gen_Module_path,'w')
- module.write(bus_template_code[arch] % code_str)
+ module.write(bus_template_code[LPCarch] % code_str) matiec_flags = '"-I%s" -Wno-unused-function'%os.path.abspath(self.GetCTRoot().GetIECLibPath())
--- a/LPCManager.py Mon Dec 08 17:02:35 2014 +0100
+++ b/LPCManager.py Mon Dec 08 17:24:59 2014 +0100
@@ -141,6 +141,8 @@
# canfestival.local_canfestival_config = LPC_canfestival_config()
+import LPCBus as LPCBus_mod +LPCBus_mod.LPCarch = arch #-------------------------------------------------------------------------------