targets/plc_debug.c
changeset 611 b665a9001451
parent 605 2250ed42e306
child 649 c48023b6f0ec
equal deleted inserted replaced
610:00df5b1db283 611:b665a9001451
    74 {
    74 {
    75     void *forced_value_p = NULL;
    75     void *forced_value_p = NULL;
    76     *flags = 0;
    76     *flags = 0;
    77     /* find data to copy*/
    77     /* find data to copy*/
    78     switch(vartype){
    78     switch(vartype){
    79         ANY(__Unpack_case_t)
    79         __ANY(__Unpack_case_t)
    80         ANY(__Unpack_case_p)
    80         __ANY(__Unpack_case_p)
    81     default:
    81     default:
    82         break;
    82         break;
    83     }
    83     }
    84     if (*flags & __IEC_FORCE_FLAG)
    84     if (*flags & __IEC_FORCE_FLAG)
    85         return forced_value_p;
    85         return forced_value_p;
   246 void RegisterDebugVariable(int idx, void* force)
   246 void RegisterDebugVariable(int idx, void* force)
   247 {
   247 {
   248     void *varp = NULL;
   248     void *varp = NULL;
   249     unsigned char flags = force ? __IEC_DEBUG_FLAG | __IEC_FORCE_FLAG : __IEC_DEBUG_FLAG;
   249     unsigned char flags = force ? __IEC_DEBUG_FLAG | __IEC_FORCE_FLAG : __IEC_DEBUG_FLAG;
   250     switch(__find_variable(idx, &varp)){
   250     switch(__find_variable(idx, &varp)){
   251         ANY(__RegisterDebugVariable_case_t)
   251         __ANY(__RegisterDebugVariable_case_t)
   252         ANY(__RegisterDebugVariable_case_p)
   252         __ANY(__RegisterDebugVariable_case_p)
   253     default:
   253     default:
   254         break;
   254         break;
   255     }
   255     }
   256 }
   256 }
   257 
   257 
   268 
   268 
   269 void ResetDebugVariablesIterator(void* varp, __IEC_types_enum vartype)
   269 void ResetDebugVariablesIterator(void* varp, __IEC_types_enum vartype)
   270 {
   270 {
   271     /* force debug flag to 0*/
   271     /* force debug flag to 0*/
   272     switch(vartype){
   272     switch(vartype){
   273         ANY(__ResetDebugVariablesIterator_case_t)
   273         __ANY(__ResetDebugVariablesIterator_case_t)
   274         ANY(__ResetDebugVariablesIterator_case_p)
   274         __ANY(__ResetDebugVariablesIterator_case_p)
   275     default:
   275     default:
   276         break;
   276         break;
   277     }
   277     }
   278 }
   278 }
   279 
   279