#define Procedure(port_in, in_ ,out_,TimeOut_) \
if ((((port_in & in_) == 0) | (In_Progress == out_) | (Turn_On_requirement & out_)))\
{\
if (In_Progress^out_)\
{\
PORTA = PORTA&(~(out_ ));\
}\
if ((TimeOut_ == 0) & ((Error & out_) != out_) )\
{\
if ( ((In_Progress == 0) & (Error == 0)) )\
{\
PORTA = PORTA|(out_);\
Turn_On_requirement = Turn_On_requirement & (~(out_ ));\
In_Progress = out_;\
Power_UP_Counter = PowerUp_Value;\
}\
else\
{\
if ( ((In_Progress == out_) & (Power_UP_Counter==0)) )\
{\
In_Progress = 0;\
if ( port_in & in_ )\
{\
ClrBit(Warning,out_);\
}\
else\
{\
PORTA = PORTA&(~(out_ ));\
if (Warning & out_)\
{\
SetBit(Error, out_);\
Led_Error;\
}\
else\
{\
SetBit(Warning, out_);\
TimeOut_ = TimeOut_Value; \
Turn_On_requirement = Turn_On_requirement | out_;\
}\
}\
}\
}\
}\
}
Procedure(PINC, In_S, Run_S, TimeOut_Run_S)
Procedure(PINC, In_A, Run_A, TimeOut_Run_A)
Procedure(PINC, In_SL, Run_SL, TimeOut_Run_SL)