diff -r 074f43e6e114 -r b4b69e85ed53 targets/plc_debug.c --- a/targets/plc_debug.c Mon Jan 13 15:15:01 2020 +0100 +++ b/targets/plc_debug.c Tue Jan 14 11:04:18 2020 +0100 @@ -100,7 +100,7 @@ void __init_debug(void) { /* init local static vars */ -#ifndef TARGET_ONLINE_DEBUG_DISABLE +#ifndef TARGET_ONLINE_DEBUG_DISABLE buffer_cursor = debug_buffer; buffer_state = BUFFER_FREE; #endif @@ -109,9 +109,9 @@ InitRetain(); /* Iterate over all variables to fill debug buffer */ if(CheckRetainBuffer()){ - __for_each_variable_do(RemindIterator); + __for_each_variable_do(RemindIterator); }else{ - char mstr[] = "RETAIN memory invalid - defaults used"; + char mstr[] = "RETAIN memory invalid - defaults used"; LogMessage(LOG_WARNING, mstr, sizeof(mstr)); } retain_offset = 0; @@ -124,7 +124,7 @@ void __cleanup_debug(void) { -#ifndef TARGET_ONLINE_DEBUG_DISABLE +#ifndef TARGET_ONLINE_DEBUG_DISABLE buffer_cursor = debug_buffer; InitiateDebugTransfer(); #endif @@ -150,16 +150,14 @@ if(flags & ( __IEC_DEBUG_FLAG | __IEC_RETAIN_FLAG)){ USINT size = __get_type_enum_size(dsc->type); -#ifndef TARGET_ONLINE_DEBUG_DISABLE +#ifndef TARGET_ONLINE_DEBUG_DISABLE if(flags & __IEC_DEBUG_FLAG){ /* copy visible variable to buffer */; if(do_debug){ /* compute next cursor positon. No need to check overflow, as BUFFER_SIZE is computed large enough */ - if((dsc->type == STRING_ENUM) || - (dsc->type == STRING_P_ENUM) || - (dsc->type == STRING_O_ENUM)){ + if(__Is_a_string(dsc)){ /* optimization for strings */ size = ((STRING*)visible_value_p)->len + 1; } @@ -174,7 +172,7 @@ memcpy(real_value_p, visible_value_p, size); } } -#endif +#endif if(flags & __IEC_RETAIN_FLAG){ /* compute next cursor positon*/