--- a/plugger.py Mon Oct 19 16:26:15 2009 +0200
+++ b/plugger.py Thu Oct 22 11:26:45 2009 +0200
@@ -1287,7 +1287,7 @@
"__publish_%s();"%locstrs[i-1] for i in xrange(len(locstrs), 0, -1)]),
"init_calls":"\n ".join([
- "if(res = __init_%s(argc,argv)){"%locstr +
+ "if((res = __init_%s(argc,argv))){"%locstr + #"printf(\"%s\"); "%locstr + #for debug
"return res;}" for i,locstr in enumerate(locstrs)]),
"cleanup_calls":"\n ".join([
--- a/targets/plc_common_main.c Mon Oct 19 16:26:15 2009 +0200
+++ b/targets/plc_common_main.c Thu Oct 22 11:26:45 2009 +0200
@@ -41,7 +41,7 @@
* Retrieve input variables, run PLC and publish output variables
if (greatest_tick_count__)
@@ -66,6 +66,7 @@
int __init(int argc,char **argv)
setlocale(LC_NUMERIC, "C");
@@ -75,7 +76,7 @@
* Calls plugin cleanup proc.
--- a/targets/plc_debug.c Mon Oct 19 16:26:15 2009 +0200
+++ b/targets/plc_debug.c Thu Oct 22 11:26:45 2009 +0200
@@ -51,17 +51,17 @@
struct_plcvar variable_table[%(variables_pointer_type_table_count)d];
%(variables_pointer_type_table_initializer)s
buffer_state = BUFFER_FREE;
+void __cleanup_debug(void)
+void __retrieve_debug(void) @@ -71,7 +71,7 @@
extern void InitiateDebugTransfer(void);
extern unsigned long __tick;
+void __publish_debug(void) /* Check there is no running debugger re-configuration */
if(TryEnterDebugSection()){
@@ -143,10 +143,11 @@
latest_subscription = subscription_table;
+void FreeDebugData(void) /* atomically mark buffer as free */
- long latest_state = AtomicCompareExchange(
+ latest_state = AtomicCompareExchange( @@ -169,8 +170,8 @@
- printf("%%d > %%d\n", old_cursor - debug_buffer, BUFFER_SIZE);
+ //printf("%%d > %%d\n", old_cursor - debug_buffer, BUFFER_SIZE);