Reflect changes in iec type definitions in matiec/lib
authoredouard
Fri, 04 Dec 2009 15:15:57 +0100
changeset 452 2d0718a05cc7
parent 451 73b3913b6d9c
child 453 923d036dfa90
Reflect changes in iec type definitions in matiec/lib
targets/Makefile/plc_Makefile_main.c
targets/plc_debug.c
--- a/targets/Makefile/plc_Makefile_main.c	Fri Dec 04 15:14:32 2009 +0100
+++ b/targets/Makefile/plc_Makefile_main.c	Fri Dec 04 15:15:57 2009 +0100
@@ -49,8 +49,9 @@
 
 extern unsigned long __tick;
 /* from plc_debugger.c */
-int WaitDebugData(void)
+int WaitDebugData(unsigned long *tick)
 {
+    *tick = __tick;
     return 0;
 }
 
--- a/targets/plc_debug.c	Fri Dec 04 15:14:32 2009 +0100
+++ b/targets/plc_debug.c	Fri Dec 04 15:15:57 2009 +0100
@@ -41,7 +41,7 @@
 %(extern_variables_declarations)s
 
 typedef void(*__for_each_variable_do_fp)(void*, __IEC_types_enum);
-__for_each_variable_do(__for_each_variable_do_fp fp)
+void __for_each_variable_do(__for_each_variable_do_fp fp)
 {
 %(for_each_variable_do_code)s
 }
@@ -50,9 +50,10 @@
 {
     switch(varindex){
 %(find_variable_case_code)s
-    }
-    *varp = NULL;
-    return UNKNOWN_ENUM;
+     default:
+      *varp = NULL;
+      return UNKNOWN_ENUM;
+    }
 }
 
 void __init_debug(void)
@@ -93,6 +94,8 @@
     switch(vartype){
         ANY(__BufferDebugDataIterator_case_t)
         ANY(__BufferDebugDataIterator_case_p)
+    default:
+        break;
     }
     if(flags && __IEC_DEBUG_FLAG){
         USINT size = __get_type_enum_size(vartype);
@@ -147,10 +150,12 @@
             ((__IEC_##TYPENAME##_p *)varp)->flags |= __IEC_DEBUG_FLAG;
 void RegisterDebugVariable(int idx)
 {
-    void *varp;
+    void *varp = NULL;
     switch(__find_variable(idx, varp)){
         ANY(__RegisterDebugVariable_case_t)
         ANY(__RegisterDebugVariable_case_p)
+    default:
+        break;
     }
 }
 
@@ -168,6 +173,8 @@
     switch(vartype){
         ANY(__ResetDebugVariablesIterator_case_t)
         ANY(__ResetDebugVariablesIterator_case_p)
+    default:
+        break;
     }
 }
 
@@ -185,7 +192,7 @@
         BUFFER_BUSY,
         BUFFER_FREE);
 }
-
+int WaitDebugData(unsigned long *tick);
 /* Wait until debug data ready and return pointer to it */
 int GetDebugData(unsigned long *tick, unsigned long *size, void **buffer){
     int res = WaitDebugData(tick);