targets/plc_debug.c
changeset 235 a66e150f2888
parent 209 08dc3d064cb5
child 236 a32817e81f5e
equal deleted inserted replaced
234:aff053bad924 235:a66e150f2888
   134     /* atomically mark buffer as free */
   134     /* atomically mark buffer as free */
   135     long latest_state = AtomicCompareExchange(
   135     long latest_state = AtomicCompareExchange(
   136         &buffer_state,
   136         &buffer_state,
   137         BUFFER_BUSY,
   137         BUFFER_BUSY,
   138         BUFFER_FREE);
   138         BUFFER_FREE);
       
   139     subscription_cursor = subscription_table;
   139 }
   140 }
   140 
   141 
   141 void* IterDebugData(int* idx, const char **type_name)
   142 void* IterDebugData(int* idx, const char **type_name)
   142 {
   143 {
   143     if(subscription_cursor < latest_subscription){
   144     if(subscription_cursor < latest_subscription){
   144         *idx = *subscription_cursor;
   145         *idx = *subscription_cursor;
   145         struct_plcvar* my_var = &variable_table[*subscription_cursor++];
   146         struct_plcvar* my_var = &variable_table[*(subscription_cursor++)];
   146         *type_name = __get_type_enum_name(my_var->type);
   147         *type_name = __get_type_enum_name(my_var->type);
   147         return my_var->ptrvalue;
   148         return my_var->ptrvalue;
   148     }
   149     }
   149     return NULL;
   150     return NULL;
   150 }
   151 }