hi
sorry for taking so long to answer but we were off to lunch 
the function is a processor expert bean for general 1bit i/o
i did nothing than enabling the method creation of ClrVal und SetVal.
that leads to the auto generated code
#define DUT_WAKEN_ClrVal() ( \ (void)clrReg8Bits(PORTB, 8) /* BIT3=0 */ \ )#define DUT_WAKEN_SetVal() ( \ (void)setReg8Bits(PORTB, 8) /* BIT3=1 */ \ )
my function is a bit long because it proofs several cases...
ill try to short out repeated parts
void DUT_autotest(void){ uint8_t temp = 0; uint8_t temp2 = 0; errorcode1 = 0; // Reset error code (volatile) errorcode2 = 0; /***** Flag Test *****/ DUT_power_mode(GOTOSLEEP); FUNCTIONS_delay(10); errorcode2 |= ((~DUT_RXD_GetVal() & 1) << 6); errorcode2 |= ((~DUT_ERRN_GetVal() & 1) << 7); DUT_WAKEN_ClrVal(); DUT_WAKEN_SetVal(); FUNCTIONS_delay(10); errorcode2 |= (DUT_RXD_GetVal() << 6); errorcode2 |= (DUT_ERRN_GetVal() << 7); MUX_disconnect_all(); // Disconnect the whole DUT. It becomes unconnected and unpowered.}
i deleted repeated tests because they all look like this for different power modes.
errorcode is extern volatile.
so the only thing this should do is read the two pins, generate a wake signla by toggling WAKEN and check that pins again...
dont know if this helps but in my opinion there is nothing to shorten for the compiler, but i am not a specialist in compilers... 