

          {if (SW == On)
          {DelayCounter = 0;  //start counting
    while(SW == On && DelayCounter <= 50) //wait switch release,max 0.5 Secs
          {Delay();    //  10ms
          DelayCounter ++;        }
          if (DelayCounter > 50 )
 Longpress_Job();//if switch pressed longer than 0.5 secs, call Longpress_Job 
 Shortpress_Job(); //normal 

