typedef Pc0 VsbGood_Pin;
typedef Pc1 V33_Pin;
typedef Pc2 V33Enable_Pin;
typedef Pc3 PSOn_Pin;
// Gnd
typedef Pd0 Jumper1_Pin;
typedef Pd1 Jumper2_Pin;
typedef Pd2 Jumper3_Pin;
typedef Pd3 Jumper4_Pin;

typedef Pb5 AmpEnable_Pin;
typedef Pb4 PowerLed_Pin;
typedef Pb3 PowerSwitch_Pin;
typedef Pb2 PowerOk_Pin;
// Vcc
typedef Pb1 V12Enable_Pin;
typedef Pb0 VsbEnable_Pin;
typedef Pc4 Vin_Pin;
typedef Pc5 VIgn_Pin;

#define V33ADCChannel 1
#define VInADCChannel 4
#define VIgnADCChannel 5


int32_t TurnOffByButtonTimeouts[16] PROGMEM ={5,5,5,5,5,5,30,30,30,30,30,30,30,30,30,30}; // ६   Pwr  몫祭  ᨬ  ०
int32_t FullHardOffTimeouts[16] PROGMEM ={10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,300}; // ६   몫祭  ᨬ  ०
int32_t HardOffToSleepTimeouts[16] PROGMEM ={0,0,0,0,0,0,0,0,0,0,0,0,0,0,150,0}; // ६  몫祭 ᥣ ஬ Vsb  ᨬ  ०

#define FullHardOffOnIncorrectGoSleep //  砥, ᫨ ࠡ뢠 HardOffToSleep,    ⮬ 祭, 㤥 ந  ⪫祭,  ⮬ ᫥ Vsb

#define MinVoltageToStartR 11.5
#define MinVoltageToWorkR 11.7
#define MinVoltageToStartAfterLowVoltageStopR 12.5
#define MinIgnVoltageR 8 // 쭮 殮  Ign, 饥 稥 

#define IgnitionTimeBeforeStartF 5 //  ᥪ㭤,   ஡ 0 -   砥 ⮬᪨.      Vsb
#define MaxWorkTimeWithLowVoltage 60 // ᨬ쭮 ६ ࠡ  ᥪ㭤   殮
#define TimeBeforeAmpOn 20 //  ᥪ㭤 ᨬ쭮 祭 65000/SmallCyclesPerSecond


static uint16_t IgnitionTimeBeforeStart=(int)(IgnitionTimeBeforeStartF*10); //   ᥪ㭤
static int8_t MinVoltageToStart=(int)(MinVoltageToStartR/4/5*255);
static int8_t MinVoltageToWork=(int)(MinVoltageToWorkR/4/5*255);
static int8_t MinVoltageToStartAfterLowVoltageStop=(int)(MinVoltageToStartAfterLowVoltageStopR/4/5*255);
static int8_t MinIgnVoltage=(int)(MinIgnVoltageR/4/5*255);

uint8_t VsbEnabled;
uint8_t PowerEnabled;
uint16_t AmpTimer;
bool AmpEnabled;

int32_t TurnOffByButtonTimeout;
int32_t FullHardOffTimeout;
int32_t HardOffToSleepTimeout;

int8_t CurrentVIn;
int8_t CurrentV33;
int8_t CurrentVIgn;
int8_t CurrentV33Ok;
bool Ignition;

int32_t OffTimer; // ᥪ㭤   몫祭 
uint16_t LowVoltageTimer;  // ᥪ㭤    殮
uint16_t IgnitionTimer; // ⠥  ᥪ㭤
bool LowVoltageStopped=false; // ⠭ true, ᫨  몫稫   殮

#define SmallCyclesPerSecond 100
static uint8_t MinV33=(3.14/5*255);
static uint8_t MaxV33=(3.47/5*255);

#define TCNT2_Const F_CPU/1024/100 //१   100 
uint8_t TimerSeconds=0;
uint8_t Timer01Seconds=0;
uint8_t IntTimerSeconds=0;
uint8_t IntTimer01Seconds=0;

