 bool SystemServiceMode = false;                           //Enable embedded servotester for PPM generating(SYSTEM_SERVICE_PIN must be HIGH)
 
 //System state vars
-bool SwitchPOS = false;                                   //Switch position. TRUE if down, FALSE if UP
+bool SwitchPOS = true;                                    //Switch position. TRUE if down, FALSE if UP
 bool SwitchPOS_fromUp = false;                            //from upper position flag
 bool EngineSTOP = false;                                  //Switch for cut-off engine ignition
 bool EngineSTOP_flag = false;                             //Stopflag for prevent fast double switching

// ================================================================

void MainSWHandler(){
//reset packets counter
  if (MainSWPacketsCounter >= 50) { MainSWPacketsCounter=0;}  

//reading PPM signal from channel
     if (digitalRead(MAINSWITCH_IN_PIN) == HIGH) 
        {MainSWTime1 = micros(); } 
     else {MainSWTime2 = micros();
           //counter overflow correction (~70min)
           if (MainSWTime2<MainSWTime1) {MainSWTime2=MainSWTime1+100;}
           //calc PPM signal length and packets count
           MainSWTime = MainSWTime2 - MainSWTime1;
           MainSWPacketsCounter++;

      MainSWPressCounterChange=true;
      //reset position change flag
      SwitchPOS_fromUp=false;
   }
  }
  if (MainSWPacketsCounter >= 50) { MainSWPacketsCounter=1;}
}

//-----------------------------------------------------------------
