void CheckAlarms(){
  static int inhibitalarm = 0;
  if (SW1State || SW2State){
    inhibitalarm = 1;
  }
  else if (CurrentTime_SOD > (WeekdayAlarm_SOD - AlarmFadeUpTime_s)  && CurrentTime_SOD < (WeekdayAlarm_SOD) && IsAlarm1On && !inhibitalarm && DayofWeek > 1 && DayofWeek < 7){
    //The time is currently in the fadeup period
    AlarmOnIndex = NumberOfAlarmIndecies - ((WeekdayAlarm_SOD - CurrentTime_SOD)*NumberOfAlarmIndecies)/(AlarmFadeUpTime_s);
  }
  else if (CurrentTime_SOD >= WeekdayAlarm_SOD && CurrentTime_SOD < (WeekdayAlarm_SOD + AlarmAutoOffTime_s) && IsAlarm1On && !inhibitalarm && DayofWeek > 1 && DayofWeek < 7)
  {
    // The time is within the alarm on Time
    AlarmOnIndex = NumberOfAlarmIndecies;
  }
  else if(CurrentTime_SOD > (WeekdayAlarm_SOD + AlarmAutoOffTime_s))
  {
    AlarmOnIndex = 0;
    inhibitalarm = 0;
  }
//  WeekdayAlarm_SOD
//  AlarmFadeUpTime_s
  
}

