--- a/LPCBeremiz.py Tue Dec 15 10:04:33 2009 +0100
+++ b/LPCBeremiz.py Tue Dec 15 10:06:01 2009 +0100
@@ -70,6 +70,18 @@
from PLCOpenEditor import IDEFrame, ProjectDialog
#-------------------------------------------------------------------------------
+# CANFESTIVAL PLUGIN HACK +#------------------------------------------------------------------------------- +from plugins.canfestival import canfestival +class LPC_canfestival_config: + def getCFLAGS(self, *args): + def getLDFLAGS(self, *args): +canfestival.local_canfestival_config = LPC_canfestival_config() +#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
--- a/plugins/canfestival/canfestival.py Tue Dec 15 10:04:33 2009 +0100
+++ b/plugins/canfestival/canfestival.py Tue Dec 15 10:06:01 2009 +0100
@@ -8,7 +8,7 @@
import config_utils, gen_cfile, eds_utils
from networkedit import networkedit
from objdictedit import objdictedit
-import canfestival_config
+import canfestival_config as local_canfestival_config from plugger import PlugTemplate
from commondialogs import CreateNodeDialog
@@ -171,7 +171,7 @@
res = eds_utils.GenerateEDSFile(os.path.join(buildpath, "Slave_%s.eds"%prefix), slave)
- return [(Gen_OD_path,canfestival_config.getCFLAGS(CanFestivalPath))],"",False
+ return [(Gen_OD_path,local_canfestival_config.getCFLAGS(CanFestivalPath))],"",False #--------------------------------------------------
@@ -293,7 +293,7 @@
- return [(Gen_OD_path,canfestival_config.getCFLAGS(CanFestivalPath))],"",False
+ return [(Gen_OD_path,local_canfestival_config.getCFLAGS(CanFestivalPath))],"",False XSD = """<?xml version="1.0" encoding="ISO-8859-1" ?>
@@ -315,7 +315,7 @@
if element["name"] == "CanFestivalInstance":
for child in element["children"]:
if child["name"] == "CAN_Driver":
- DLL_LIST= getattr(canfestival_config,"DLL_LIST",None)
+ DLL_LIST= getattr(local_canfestival_config,"DLL_LIST",None) @@ -427,6 +427,6 @@
- return [(cf_main_path, canfestival_config.getCFLAGS(CanFestivalPath))],canfestival_config.getLDFLAGS(CanFestivalPath), True
+ return [(cf_main_path, local_canfestival_config.getCFLAGS(CanFestivalPath))],local_canfestival_config.getLDFLAGS(CanFestivalPath), True --- a/plugins/canfestival/cf_runtime.c Tue Dec 15 10:04:33 2009 +0100
+++ b/plugins/canfestival/cf_runtime.c Tue Dec 15 10:06:01 2009 +0100
@@ -79,7 +79,7 @@
canClose(&nodename##_Data);\
-void __cleanup_%(locstr)s()
+void __cleanup_%(locstr)s(void) @@ -91,6 +91,11 @@
#define NODE_OPEN(nodename)\
if(!canOpen(&nodename##Board,&nodename##_Data)){\
fprintf(stderr,"Cannot open CAN intefrace %%s at speed %%s\n for CANopen node \"" #nodename "\"",nodename##Board.busname, nodename##Board.baudrate);\
@@ -105,8 +110,8 @@
#ifndef NOT_USE_DYNAMIC_LOADING
if( !LoadCanDriver("%(candriver)s") ){
fprintf(stderr, "Cannot load CAN interface library for CanFestival (%(candriver)s)\n");\
@@ -123,7 +128,7 @@
#define NODE_SEND_SYNC(nodename)\
sendSYNCMessage(&nodename##_Data);
-void __retrieve_%(locstr)s()
+void __retrieve_%(locstr)s(void) /* Locks the stack, so that no changes occurs while PLC access variables
* TODO : implement buffers to avoid such a big lock
@@ -136,7 +141,7 @@
#define NODE_PROCEED_SYNC(nodename)\
proceedSYNC(&nodename##_Data);
-void __publish_%(locstr)s()
+void __publish_%(locstr)s(void)