# HG changeset patch # User etisserant # Date 1197223119 -3600 # Node ID 9ad18a387a9652e6ac1928b3236bb5d4211b2196 # Parent 8a726a62fbfc451296e97b6a7eb9694122c5f839 Windows related enhancements diff -r 8a726a62fbfc -r 9ad18a387a96 plugger.py --- a/plugger.py Sun Dec 09 17:15:56 2007 +0100 +++ b/plugger.py Sun Dec 09 18:58:39 2007 +0100 @@ -513,7 +513,12 @@ #################################################################################### #################################################################################### -iec2c_path = os.path.join(base_folder, "matiec", "iec2c") +if wx.Platform != '__WXMSW__': + exe_ext=".exe" +else: + exe_ext="" + +iec2c_path = os.path.join(base_folder, "matiec", "iec2c"+exe_ext) ieclib_path = os.path.join(base_folder, "matiec", "lib") # import for project creation timestamping @@ -580,6 +585,9 @@ + + + @@ -873,6 +881,9 @@ # Compile the resulting code into object files. compiler = self.BeremizRoot.getCompiler() + _CFLAGS = self.BeremizRoot.getCFLAGS() + linker = self.BeremizRoot.getLinker() + _LDFLAGS = self.BeremizRoot.getLDFLAGS() obns = [] objs = [] for Location, CFilesAndCFLAGS, DoCalls in LocationCFilesAndCFLAGS: @@ -887,7 +898,7 @@ obns.append(obn) logger.write(" [CC] "+bn+" -> "+obn+"\n") objectfilename = os.path.splitext(CFile)[0]+".o" - status, result, err_result = logger.LogCommand("%s -c %s -o %s %s"%(compiler, CFile, objectfilename, CFLAGS)) + status, result, err_result = logger.LogCommand("%s -c %s -o %s %s %s"%(compiler, CFile, objectfilename, _CFLAGS, CFLAGS)) if status != 0: logger.write_error("Build failed\n") return False @@ -899,7 +910,7 @@ exe += ".exe" exe_path = os.path.join(buildpath, exe) logger.write(" [CC] " + ' '.join(obns)+" -> " + exe + "\n") - status, result, err_result = logger.LogCommand("%s %s -o %s %s"%(compiler, " ".join(objs), exe_path, ' '.join(LDFLAGS))) + status, result, err_result = logger.LogCommand("%s %s -o %s %s"%(linker, " ".join(objs), exe_path, ' '.join(LDFLAGS+[_LDFLAGS]))) if status != 0: logger.write_error("Build failed\n") return False diff -r 8a726a62fbfc -r 9ad18a387a96 plugins/canfestival/cf_runtime.c --- a/plugins/canfestival/cf_runtime.c Sun Dec 09 17:15:56 2007 +0100 +++ b/plugins/canfestival/cf_runtime.c Sun Dec 09 18:58:39 2007 +0100 @@ -77,7 +77,7 @@ int __init_%(locstr)s(int argc,char **argv) { #ifndef NOT_USE_DYNAMIC_LOADING - if( !LoadCanDriver("libcanfestival_can_%(candriver)s.so") ){ + if( !LoadCanDriver("%(candriver)s") ){ fprintf(stderr, "Cannot load CAN interface library for CanFestival (%(candriver)s)\n");\ return -1; } diff -r 8a726a62fbfc -r 9ad18a387a96 runtime/plc_Win32_main.c --- a/runtime/plc_Win32_main.c Sun Dec 09 17:15:56 2007 +0100 +++ b/runtime/plc_Win32_main.c Sun Dec 09 18:58:39 2007 +0100 @@ -6,10 +6,11 @@ void timer_notify() { struct _timeb timebuffer; + printf("."); _ftime( &timebuffer ); - CURRENT_TIME.tv_sec = timebuffer.time; - CURRENT_TIME.tv_nsec = timebuffer.millitm * 1000000 + __CURRENT_TIME.tv_sec = timebuffer.time; + __CURRENT_TIME.tv_nsec = timebuffer.millitm * 1000000; __run(); } @@ -18,10 +19,10 @@ HANDLE hTimer = NULL; LARGE_INTEGER liDueTime; - liDueTime.QuadPart = -10000 * maxval(common_ticktime__,1);; + liDueTime.QuadPart = -10000 * maxval(common_ticktime__,1); // Create a waitable timer. - hTimer = CreateWaitableTimer(NULL, TRUE, "WaitableTimer"); + hTimer = CreateWaitableTimer(NULL, FALSE, "WaitableTimer"); if (NULL == hTimer) { printf("CreateWaitableTimer failed (%d)\n", GetLastError()); @@ -30,6 +31,7 @@ if( __init(argc,argv) == 0 ){ + printf("Tick Time : %d ms\n", common_ticktime__); // Set a timer if (!SetWaitableTimer(hTimer, &liDueTime, common_ticktime__, NULL, NULL, 0)) {