targets/__init__.py
changeset 205 ee8d1f4528ef
parent 203 cb9901076a21
child 209 08dc3d064cb5
--- a/targets/__init__.py	Wed Aug 20 09:37:57 2008 +0200
+++ b/targets/__init__.py	Wed Aug 20 10:10:34 2008 +0200
@@ -64,4 +64,11 @@
 for target in DictXSD_target.keys():
     targetchoices += DictXSD_target[target]
 
+def code(target_name):
+    filename = path.join(path.split(__file__)[0], target_name, "plc_%s_main.c"%target_name)
+    if path.exists(filename):
+        return open(filename).read()
+    else:
+        return "#error %s target not implemented !!!\n"%target_name
+
 from toolchain_gcc import toolchain_gcc
\ No newline at end of file