/*
 * File: COMR_TimeOut.c
 *
 * Code generated for Simulink model 'COMR_TimeOut'.
 *
 * Model version                  : A1.1_0
 * Simulink Coder version         : 8.11 (R2016b) 25-Aug-2016
 * C/C++ source code generated on : Mon Dec 07 20:14:47 2020
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: Infineon->TriCore
 * Code generation objectives:
 *    1. MISRA C:2012 guidelines
 *    2. Execution efficiency
 * Validation result: Not run
 */

#include "COMR_TimeOut.h"
#include "COMR_TimeOut_private.h"

/* Exported data definition */

/* Volatile memory section */
#define ASW1_OEM_START_SEC_DEFAULT_RAM1_CLEARED_UNSPECIFIED
#include "Asw1_OEM_MemMap.h"

/* Definition for custom storage class: Volatile */
volatile uint8_T DFC_BattHVMsgTmt_ASW;
volatile uint8_T DFC_BoardTempTmt_ASW;
volatile uint8_T DFC_BusHVMsgTmt_ASW;
volatile uint8_T DFC_CellTempTmt_ASW;
volatile uint8_T DFC_CellVoltTmt_ASW;
volatile uint8_T DFC_Msg050Tmt_ASW;
volatile uint8_T DFC_Msg0B5Tmt_ASW;
volatile uint8_T DFC_Msg130Tmt_ASW;
volatile uint8_T DFC_Msg17DTmt_ASW;
volatile uint8_T DFC_Msg195Tmt_ASW;
volatile uint8_T DFC_Msg28CTmt_ASW;
volatile uint8_T DFC_Msg2A3Tmt_ASW;
volatile uint8_T DFC_Msg2A5Tmt_ASW;
volatile uint8_T DFC_Msg2A7Tmt_ASW;
volatile uint8_T DFC_Msg2ADTmt_ASW;
volatile uint8_T DFC_Msg2BBTmt_ASW;
volatile uint8_T DFC_Msg2DFTmt_ASW;
volatile uint8_T DFC_Msg2E1Tmt_ASW;
volatile uint8_T DFC_Msg2E6Tmt_ASW;
volatile uint8_T DFC_Msg2EBTmt_ASW;
volatile uint8_T DFC_Msg2F1Tmt_ASW;
volatile uint8_T DFC_Msg37FTmt_ASW;
volatile uint8_T DFC_Msg3AATmt_ASW;
volatile uint8_T DFC_MsgCABTmt_ASW;
volatile uint8_T DFC_ObcTmt_ASW;
volatile uint8_T DFC_VcuTmt_ASW;

#define ASW1_OEM_STOP_SEC_DEFAULT_RAM1_CLEARED_UNSPECIFIED
#include "Asw1_OEM_MemMap.h"
#define ASW1_OEM_START_SEC_DEFAULT_RAM1_CLEARED_UNSPECIFIED
#include "Asw1_OEM_MemMap.h"

/* Definition for custom storage class: OutputSignal */
volatile boolean_T COMR_bTmt638Physical1Det;
volatile boolean_T COMR_bTmt638Physical1Heal;
volatile boolean_T COMR_bTmt638Physical2Det;
volatile boolean_T COMR_bTmt638Physical2Heal;
volatile boolean_T COMR_bTmtBoardTmpDet;
volatile boolean_T COMR_bTmtBoardTmpHeal;
volatile boolean_T COMR_bTmtCellTmpDet;
volatile boolean_T COMR_bTmtCellTmpHeal;
volatile boolean_T COMR_bTmtCellVolDet;
volatile boolean_T COMR_bTmtCellVolHeal;
volatile boolean_T COMR_bTmtObc2E0Det;
volatile boolean_T COMR_bTmtObc2E0Heal;
volatile boolean_T COMR_bTmtVcu2A3Det;
volatile boolean_T COMR_bTmtVcu2A3Heal;
volatile boolean_T COMR_flgDiagSlntReq;
volatile boolean_T COMR_flgTmtBalCirSta;
volatile boolean_T COMR_flgTmtCAB;
volatile boolean_T COMR_flgTmtGW2AD;
volatile boolean_T COMR_flgTmtGW2BB;
volatile boolean_T COMR_flgTmtGWABM050;
volatile boolean_T COMR_flgTmtModuVol;
volatile boolean_T COMR_flgTmtVcu2A5;
volatile boolean_T COMR_flgTmtVcu2A7;

#define ASW1_OEM_STOP_SEC_DEFAULT_RAM1_CLEARED_UNSPECIFIED
#include "Asw1_OEM_MemMap.h"

/* Block signals (auto storage) */
B_COMR_TimeOut_T COMR_TimeOut_B;

/* Block states (auto storage) */
DW_COMR_TimeOut_T COMR_TimeOut_DW;

/* Model step function */
void COMR_TimeOut_step(void)
{
  boolean_T rtb_LogicalOperator4_l;
  boolean_T rtb_LogicalOperator3;
  boolean_T rtb_Compare_d;
  boolean_T rtb_LogicalOperator2_h;
  real32_T rtb_Product;
  boolean_T rtb_Switch6;
  real32_T rtb_Product_mu;
  uint8_T rtb_Switch4_e4;
  real32_T rtb_LogicalOperator3_0;
  rtb_LogicalOperator4_l = (COMR_TimeOut_DW.Delay1_DSTATE_p && (!VeCan_BusOff));
  COMR_TimeOut_DW.Delay1_DSTATE_p = VeCan_BusOff;
  rtb_LogicalOperator4_l = ((COMR_TimeOut_DW.Delay_DSTATE_jm ||
    rtb_LogicalOperator4_l) && (!COMR_TimeOut_DW.Delay2_DSTATE));
  rtb_LogicalOperator3 = ((BSPR_bKl15WkUp || BMCR_bWkUpVCU || VCAN_NMMsgRx) && (
    !COMR_stEol) && (!BSW_stOTAMode) && (!COMR_flgDiagSlntReq));
  if (rtb_LogicalOperator3) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiPwrupDiagEna_C <= COMR_TimeOut_DW.Delay_DSTATE) {
    rtb_Product_mu = COMR_tiPwrupDiagEna_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_LogicalOperator3;
  COMR_TimeOut_DW.Delay_DSTATE = rtb_Product;
  if (COMR_UAESFltDiagDisbl_C) {
    rtb_LogicalOperator3 = COMR_UAESFltDiagDisbl_C;
  } else {
    rtb_LogicalOperator3 = ((!rtb_LogicalOperator4_l) && (!VeCan_BusOff));
  }

  rtb_LogicalOperator3 = (rtb_LogicalOperator3 && ((rtb_Product >
    COMR_tiPwrupDiagEna_C) && COMR_bLvComDiagEn));
  rtb_Compare_d = (rtb_LogicalOperator3 && COMR_DFC_Msg130Tmt);
  if (rtb_Compare_d) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiMcuMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_aq) {
    rtb_Product_mu = COMR_tiMcuMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_aq;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Compare_d;
  COMR_TimeOut_DW.Delay_DSTATE_aq = rtb_Product;
  rtb_Compare_d = ((COMR_cntObcTmtDiag_CW & 16) == 16);
  rtb_Switch6 = (rtb_Compare_d && (rtb_Product > COMR_tiMcuMsgTmt_C));
  rtb_LogicalOperator2_h = !COMR_DFC_Msg130Tmt;
  if (rtb_LogicalOperator2_h) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiMcuMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_e0) {
    rtb_Product_mu = COMR_tiMcuMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_e0;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_LogicalOperator2_h;
  COMR_TimeOut_DW.Delay_DSTATE_e0 = rtb_Product;
  rtb_Compare_d = ((!rtb_Compare_d) || (rtb_Product > COMR_tiMcuMsgTmt_C));
  if (COMR_TimeOut_DW.Delay2_DSTATE_c) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_Msg130Tmt_ASW | 8U);
  } else if (rtb_Switch6) {
    rtb_Switch4_e4 = (uint8_T)(DFC_Msg130Tmt_ASW | 152U);
  } else if (rtb_Compare_d) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_Msg130Tmt_ASW | 16U)
      | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_j;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_c = false;
  COMR_TimeOut_DW.Delay3_DSTATE_j = rtb_Switch4_e4;
  if (rtb_Compare_d || rtb_Switch6) {
    DFC_Msg130Tmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_Msg130Tmt_ASW = 0U;
  }

  rtb_Compare_d = !COMR_UAESFltDiagDisbl_C;
  rtb_Switch6 = (rtb_LogicalOperator3 && (!BSWBusHVDataMsgRx) && rtb_Compare_d);
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiHv638MsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_da) {
    rtb_Product_mu = COMR_tiHv638MsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_da;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_bTmt638Physical2Det = (rtb_Product > COMR_tiHv638MsgTmt_C);
  COMR_TimeOut_DW.Delay_DSTATE_da = rtb_Product;
  rtb_Switch6 = (COMR_UAESFltDiagDisbl_C || BSWBusHVDataMsgRx);
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiHv638MsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_jl) {
    rtb_Product_mu = COMR_tiHv638MsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_jl;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_bTmt638Physical2Heal = (rtb_Product > COMR_tiHv638MsgTmt_C);
  COMR_TimeOut_DW.Delay_DSTATE_jl = rtb_Product;
  if (COMR_TimeOut_DW.Delay2_DSTATE_dx) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_BusHVMsgTmt_ASW | 8U);
  } else if (COMR_bTmt638Physical2Det) {
    rtb_Switch4_e4 = (uint8_T)(DFC_BusHVMsgTmt_ASW | 152U);
  } else if (COMR_bTmt638Physical2Heal) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_BusHVMsgTmt_ASW |
      16U) | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_e;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_dx = false;
  COMR_TimeOut_DW.Delay3_DSTATE_e = rtb_Switch4_e4;
  if (COMR_bTmt638Physical2Heal || COMR_bTmt638Physical2Det) {
    DFC_BusHVMsgTmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_BusHVMsgTmt_ASW = 0U;
  }

  rtb_Compare_d = (rtb_LogicalOperator3 && (!BSWBatteryHVDataMsgRx) &&
                   rtb_Compare_d);
  if (rtb_Compare_d) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiHv638MsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_dxc) {
    rtb_Product_mu = COMR_tiHv638MsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_dxc;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Compare_d;
  COMR_bTmt638Physical1Det = (rtb_Product > COMR_tiHv638MsgTmt_C);
  COMR_TimeOut_DW.Delay_DSTATE_dxc = rtb_Product;
  rtb_Compare_d = (COMR_UAESFltDiagDisbl_C || BSWBatteryHVDataMsgRx);
  if (rtb_Compare_d) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiHv638MsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_j4) {
    rtb_Product_mu = COMR_tiHv638MsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_j4;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Compare_d;
  COMR_bTmt638Physical1Heal = (rtb_Product > COMR_tiHv638MsgTmt_C);
  COMR_TimeOut_DW.Delay_DSTATE_j4 = rtb_Product;
  if (COMR_TimeOut_DW.Delay2_DSTATE_g3) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_BattHVMsgTmt_ASW | 8U);
  } else if (COMR_bTmt638Physical1Det) {
    rtb_Switch4_e4 = (uint8_T)(DFC_BattHVMsgTmt_ASW | 152U);
  } else if (COMR_bTmt638Physical1Heal) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_BattHVMsgTmt_ASW |
      16U) | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_lw;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_g3 = false;
  COMR_TimeOut_DW.Delay3_DSTATE_lw = rtb_Switch4_e4;
  if (COMR_bTmt638Physical1Heal || COMR_bTmt638Physical1Det) {
    DFC_BattHVMsgTmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_BattHVMsgTmt_ASW = 0U;
  }

  if (COMR_TimeOut_DW.is_active_c1_COMR_TimeOut == 0U) {
    COMR_TimeOut_DW.is_active_c1_COMR_TimeOut = 1U;
    if (BSWBoardTempMsgRx[0] || BSWBoardTempMsgRx[1]) {
      COMR_TimeOut_B.COMR_flgTmtBoardTmp = 0.0F;
    } else {
      if ((!BSWBoardTempMsgRx[0]) && (!BSWBoardTempMsgRx[1])) {
        COMR_TimeOut_B.COMR_flgTmtBoardTmp = 1.0F;
      }
    }
  } else if (BSWBoardTempMsgRx[0] || BSWBoardTempMsgRx[1]) {
    COMR_TimeOut_B.COMR_flgTmtBoardTmp = 0.0F;
  } else {
    if ((!BSWBoardTempMsgRx[0]) && (!BSWBoardTempMsgRx[1])) {
      COMR_TimeOut_B.COMR_flgTmtBoardTmp = 1.0F;
    }
  }

  rtb_Compare_d = (rtb_LogicalOperator3 && (COMR_TimeOut_B.COMR_flgTmtBoardTmp
    != 0.0F) && (!COMR_UAESFltDiagDisbl_C));
  if (rtb_Compare_d) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiCSCMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_i) {
    rtb_Product_mu = COMR_tiCSCMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_i;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Compare_d;
  COMR_bTmtBoardTmpDet = (rtb_Product > COMR_tiCSCMsgTmt_C);
  COMR_TimeOut_DW.Delay_DSTATE_i = rtb_Product;
  rtb_Compare_d = (COMR_UAESFltDiagDisbl_C ||
                   (!(COMR_TimeOut_B.COMR_flgTmtBoardTmp != 0.0F)));
  if (rtb_Compare_d) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiCSCMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_cg) {
    rtb_Product_mu = COMR_tiCSCMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_cg;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Compare_d;
  COMR_bTmtBoardTmpHeal = (rtb_Product > COMR_tiCSCMsgTmt_C);
  COMR_TimeOut_DW.Delay_DSTATE_cg = rtb_Product;
  if (COMR_TimeOut_DW.Delay2_DSTATE_ii) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_BoardTempTmt_ASW | 8U);
  } else if (COMR_bTmtBoardTmpDet) {
    rtb_Switch4_e4 = (uint8_T)(DFC_BoardTempTmt_ASW | 152U);
  } else if (COMR_bTmtBoardTmpHeal) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_BoardTempTmt_ASW |
      16U) | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_bt;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_ii = false;
  COMR_TimeOut_DW.Delay3_DSTATE_bt = rtb_Switch4_e4;
  if (COMR_bTmtBoardTmpHeal || COMR_bTmtBoardTmpDet) {
    DFC_BoardTempTmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_BoardTempTmt_ASW = 0U;
  }

  if (COMR_TimeOut_DW.is_active_c2_COMR_TimeOut == 0U) {
    COMR_TimeOut_DW.is_active_c2_COMR_TimeOut = 1U;
    if ((BSWCellTempMsgRx[0] || BSWCellTempMsgRx[1] || BSWCellTempMsgRx[2]) &&
        (BSWCellTempMsgRx[3] || BSWCellTempMsgRx[4] || BSWCellTempMsgRx[5])) {
      COMR_TimeOut_B.COMR_flgTmtCellTmp = 0.0F;
    } else {
      /*    */
      if (((!BSWCellTempMsgRx[0]) && (!BSWCellTempMsgRx[1]) &&
           (!BSWCellTempMsgRx[2])) || ((!BSWCellTempMsgRx[3]) &&
           (!BSWCellTempMsgRx[4]) && (!BSWCellTempMsgRx[5]))) {
        COMR_TimeOut_B.COMR_flgTmtCellTmp = 1.0F;
      }
    }
  } else if ((BSWCellTempMsgRx[0] || BSWCellTempMsgRx[1] || BSWCellTempMsgRx[2])
             && (BSWCellTempMsgRx[3] || BSWCellTempMsgRx[4] || BSWCellTempMsgRx
                 [5])) {
    COMR_TimeOut_B.COMR_flgTmtCellTmp = 0.0F;
  } else {
    /*    */
    if (((!BSWCellTempMsgRx[0]) && (!BSWCellTempMsgRx[1]) && (!BSWCellTempMsgRx
          [2])) || ((!BSWCellTempMsgRx[3]) && (!BSWCellTempMsgRx[4]) &&
                    (!BSWCellTempMsgRx[5]))) {
      COMR_TimeOut_B.COMR_flgTmtCellTmp = 1.0F;
    }
  }

  rtb_Compare_d = (rtb_LogicalOperator3 && (COMR_TimeOut_B.COMR_flgTmtCellTmp !=
    0.0F) && (!COMR_UAESFltDiagDisbl_C));
  if (rtb_Compare_d) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiCSCMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_f3) {
    rtb_Product_mu = COMR_tiCSCMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_f3;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Compare_d;
  COMR_bTmtCellTmpDet = (rtb_Product > COMR_tiCSCMsgTmt_C);
  COMR_TimeOut_DW.Delay_DSTATE_f3 = rtb_Product;
  rtb_Compare_d = (COMR_UAESFltDiagDisbl_C ||
                   (!(COMR_TimeOut_B.COMR_flgTmtCellTmp != 0.0F)));
  if (rtb_Compare_d) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiCSCMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_h) {
    rtb_Product_mu = COMR_tiCSCMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_h;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Compare_d;
  COMR_bTmtCellTmpHeal = (rtb_Product > COMR_tiCSCMsgTmt_C);
  COMR_TimeOut_DW.Delay_DSTATE_h = rtb_Product;
  if (COMR_TimeOut_DW.Delay2_DSTATE_d) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_CellTempTmt_ASW | 8U);
  } else if (COMR_bTmtCellTmpDet) {
    rtb_Switch4_e4 = (uint8_T)(DFC_CellTempTmt_ASW | 152U);
  } else if (COMR_bTmtCellTmpHeal) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_CellTempTmt_ASW |
      16U) | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_cl;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_d = false;
  COMR_TimeOut_DW.Delay3_DSTATE_cl = rtb_Switch4_e4;
  if (COMR_bTmtCellTmpHeal || COMR_bTmtCellTmpDet) {
    DFC_CellTempTmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_CellTempTmt_ASW = 0U;
  }

  if (COMR_TimeOut_DW.is_active_c4_COMR_TimeOut == 0U) {
    COMR_TimeOut_DW.is_active_c4_COMR_TimeOut = 1U;

    /*    */
    if ((BSWCellVoltageMsgRx[0] || BSWCellVoltageMsgRx[1] ||
         BSWCellVoltageMsgRx[2] || BSWCellVoltageMsgRx[3] ||
         BSWCellVoltageMsgRx[4] || BSWCellVoltageMsgRx[5] ||
         BSWCellVoltageMsgRx[6] || BSWCellVoltageMsgRx[7] ||
         BSWCellVoltageMsgRx[8] || BSWCellVoltageMsgRx[9] ||
         BSWCellVoltageMsgRx[10] || BSWCellVoltageMsgRx[11]) &&
        (BSWCellVoltageMsgRx[12] || BSWCellVoltageMsgRx[13] ||
         BSWCellVoltageMsgRx[14] || BSWCellVoltageMsgRx[15] ||
         BSWCellVoltageMsgRx[16] || BSWCellVoltageMsgRx[17] ||
         BSWCellVoltageMsgRx[18] || BSWCellVoltageMsgRx[19] ||
         BSWCellVoltageMsgRx[20] || BSWCellVoltageMsgRx[21] ||
         BSWCellVoltageMsgRx[22] || BSWCellVoltageMsgRx[23])) {
      COMR_TimeOut_B.COMR_flgTmtCellVol = 0.0F;
    } else {
      if (((!BSWCellVoltageMsgRx[0]) && (!BSWCellVoltageMsgRx[1]) &&
           (!BSWCellVoltageMsgRx[2]) && (!BSWCellVoltageMsgRx[3]) &&
           (!BSWCellVoltageMsgRx[4]) && (!BSWCellVoltageMsgRx[5]) &&
           (!BSWCellVoltageMsgRx[6]) && (!BSWCellVoltageMsgRx[7]) &&
           (!BSWCellVoltageMsgRx[8]) && (!BSWCellVoltageMsgRx[9]) &&
           (!BSWCellVoltageMsgRx[10]) && (!BSWCellVoltageMsgRx[11])) ||
          ((!BSWCellVoltageMsgRx[12]) && (!BSWCellVoltageMsgRx[13]) &&
           (!BSWCellVoltageMsgRx[14]) && (!BSWCellVoltageMsgRx[15]) &&
           (!BSWCellVoltageMsgRx[16]) && (!BSWCellVoltageMsgRx[17]) &&
           (!BSWCellVoltageMsgRx[18]) && (!BSWCellVoltageMsgRx[19]) &&
           (!BSWCellVoltageMsgRx[20]) && (!BSWCellVoltageMsgRx[21]) &&
           (!BSWCellVoltageMsgRx[22]) && (!BSWCellVoltageMsgRx[23]))) {
        COMR_TimeOut_B.COMR_flgTmtCellVol = 1.0F;
      }
    }
  } else {
    /*    */
    if ((BSWCellVoltageMsgRx[0] || BSWCellVoltageMsgRx[1] ||
         BSWCellVoltageMsgRx[2] || BSWCellVoltageMsgRx[3] ||
         BSWCellVoltageMsgRx[4] || BSWCellVoltageMsgRx[5] ||
         BSWCellVoltageMsgRx[6] || BSWCellVoltageMsgRx[7] ||
         BSWCellVoltageMsgRx[8] || BSWCellVoltageMsgRx[9] ||
         BSWCellVoltageMsgRx[10] || BSWCellVoltageMsgRx[11]) &&
        (BSWCellVoltageMsgRx[12] || BSWCellVoltageMsgRx[13] ||
         BSWCellVoltageMsgRx[14] || BSWCellVoltageMsgRx[15] ||
         BSWCellVoltageMsgRx[16] || BSWCellVoltageMsgRx[17] ||
         BSWCellVoltageMsgRx[18] || BSWCellVoltageMsgRx[19] ||
         BSWCellVoltageMsgRx[20] || BSWCellVoltageMsgRx[21] ||
         BSWCellVoltageMsgRx[22] || BSWCellVoltageMsgRx[23])) {
      COMR_TimeOut_B.COMR_flgTmtCellVol = 0.0F;
    } else {
      if (((!BSWCellVoltageMsgRx[0]) && (!BSWCellVoltageMsgRx[1]) &&
           (!BSWCellVoltageMsgRx[2]) && (!BSWCellVoltageMsgRx[3]) &&
           (!BSWCellVoltageMsgRx[4]) && (!BSWCellVoltageMsgRx[5]) &&
           (!BSWCellVoltageMsgRx[6]) && (!BSWCellVoltageMsgRx[7]) &&
           (!BSWCellVoltageMsgRx[8]) && (!BSWCellVoltageMsgRx[9]) &&
           (!BSWCellVoltageMsgRx[10]) && (!BSWCellVoltageMsgRx[11])) ||
          ((!BSWCellVoltageMsgRx[12]) && (!BSWCellVoltageMsgRx[13]) &&
           (!BSWCellVoltageMsgRx[14]) && (!BSWCellVoltageMsgRx[15]) &&
           (!BSWCellVoltageMsgRx[16]) && (!BSWCellVoltageMsgRx[17]) &&
           (!BSWCellVoltageMsgRx[18]) && (!BSWCellVoltageMsgRx[19]) &&
           (!BSWCellVoltageMsgRx[20]) && (!BSWCellVoltageMsgRx[21]) &&
           (!BSWCellVoltageMsgRx[22]) && (!BSWCellVoltageMsgRx[23]))) {
        COMR_TimeOut_B.COMR_flgTmtCellVol = 1.0F;
      }
    }
  }

  rtb_Compare_d = (rtb_LogicalOperator3 && (COMR_TimeOut_B.COMR_flgTmtCellVol !=
    0.0F) && (!COMR_UAESFltDiagDisbl_C));
  if (rtb_Compare_d) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiCSCMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_ah) {
    rtb_Product_mu = COMR_tiCSCMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_ah;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Compare_d;
  COMR_bTmtCellVolDet = (rtb_Product > COMR_tiCSCMsgTmt_C);
  COMR_TimeOut_DW.Delay_DSTATE_ah = rtb_Product;
  rtb_Compare_d = (COMR_UAESFltDiagDisbl_C ||
                   (!(COMR_TimeOut_B.COMR_flgTmtCellVol != 0.0F)));
  if (rtb_Compare_d) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiCSCMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_dj) {
    rtb_Product_mu = COMR_tiCSCMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_dj;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Compare_d;
  COMR_bTmtCellVolHeal = (rtb_Product > COMR_tiCSCMsgTmt_C);
  COMR_TimeOut_DW.Delay_DSTATE_dj = rtb_Product;
  if (COMR_TimeOut_DW.Delay2_DSTATE_pz) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_CellVoltTmt_ASW | 8U);
  } else if (COMR_bTmtCellVolDet) {
    rtb_Switch4_e4 = (uint8_T)(DFC_CellVoltTmt_ASW | 152U);
  } else if (COMR_bTmtCellVolHeal) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_CellVoltTmt_ASW |
      16U) | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_fh;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_pz = false;
  COMR_TimeOut_DW.Delay3_DSTATE_fh = rtb_Switch4_e4;
  if (COMR_bTmtCellVolHeal || COMR_bTmtCellVolDet) {
    DFC_CellVoltTmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_CellVoltTmt_ASW = 0U;
  }

  if (COMR_TimeOut_DW.is_active_c3_COMR_TimeOut == 0U) {
    COMR_TimeOut_DW.is_active_c3_COMR_TimeOut = 1U;
    if ((!BSWCellBalanceCircuitStatusMsgRx[0]) &&
        (!BSWCellBalanceCircuitStatusMsgRx[1])) {
      COMR_flgTmtBalCirSta = true;
    } else {
      if (BSWCellBalanceCircuitStatusMsgRx[0] ||
          BSWCellBalanceCircuitStatusMsgRx[1]) {
        COMR_flgTmtBalCirSta = false;
      }
    }
  } else if ((!BSWCellBalanceCircuitStatusMsgRx[0]) &&
             (!BSWCellBalanceCircuitStatusMsgRx[1])) {
    COMR_flgTmtBalCirSta = true;
  } else {
    if (BSWCellBalanceCircuitStatusMsgRx[0] || BSWCellBalanceCircuitStatusMsgRx
        [1]) {
      COMR_flgTmtBalCirSta = false;
    }
  }

  if (COMR_TimeOut_DW.is_active_c6_COMR_TimeOut == 0U) {
    COMR_TimeOut_DW.is_active_c6_COMR_TimeOut = 1U;
    if (BSWModuleVoltageMsgRx[0] || BSWModuleVoltageMsgRx[1]) {
      COMR_flgTmtModuVol = false;
    } else {
      if ((!BSWModuleVoltageMsgRx[0]) && (!BSWModuleVoltageMsgRx[1])) {
        COMR_flgTmtModuVol = true;
      }
    }
  } else if (BSWModuleVoltageMsgRx[0] || BSWModuleVoltageMsgRx[1]) {
    COMR_flgTmtModuVol = false;
  } else {
    if ((!BSWModuleVoltageMsgRx[0]) && (!BSWModuleVoltageMsgRx[1])) {
      COMR_flgTmtModuVol = true;
    }
  }

  rtb_Compare_d = (rtb_LogicalOperator3 && COMR_DFC_Msg2ADTmt);
  if (rtb_Compare_d) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_av) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_av;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Compare_d;
  COMR_TimeOut_DW.Delay_DSTATE_av = rtb_Product;
  rtb_Compare_d = ((COMR_cntObcTmtDiag_CW & 16) == 16);
  COMR_flgTmtGW2AD = (rtb_Compare_d && (rtb_Product > COMR_tiGWMsgTmt_C));
  rtb_Switch6 = !COMR_DFC_Msg2ADTmt;
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_mh) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_mh;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_TimeOut_DW.Delay_DSTATE_mh = rtb_Product;
  rtb_Switch6 = ((!rtb_Compare_d) || (rtb_Product > COMR_tiGWMsgTmt_C));
  if (COMR_TimeOut_DW.Delay2_DSTATE_n) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2ADTmt_ASW | 8U);
  } else if (COMR_flgTmtGW2AD) {
    rtb_Switch4_e4 = (uint8_T)(DFC_Msg2ADTmt_ASW | 152U);
  } else if (rtb_Switch6) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2ADTmt_ASW | 16U)
      | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_oo;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_n = false;
  COMR_TimeOut_DW.Delay3_DSTATE_oo = rtb_Switch4_e4;
  if (rtb_Switch6 || COMR_flgTmtGW2AD) {
    DFC_Msg2ADTmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_Msg2ADTmt_ASW = 0U;
  }

  rtb_Switch6 = (rtb_LogicalOperator3 && COMR_DFC_Msg3AATmt);
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_l) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_l;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_TimeOut_DW.Delay_DSTATE_l = rtb_Product;
  rtb_Switch6 = (rtb_Compare_d && (rtb_Product > COMR_tiGWMsgTmt_C));
  rtb_LogicalOperator2_h = !COMR_DFC_Msg3AATmt;
  if (rtb_LogicalOperator2_h) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_p2) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_p2;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_LogicalOperator2_h;
  COMR_TimeOut_DW.Delay_DSTATE_p2 = rtb_Product;
  rtb_LogicalOperator2_h = ((!rtb_Compare_d) || (rtb_Product > COMR_tiGWMsgTmt_C));
  if (COMR_TimeOut_DW.Delay2_DSTATE_bz) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_Msg3AATmt_ASW | 8U);
  } else if (rtb_Switch6) {
    rtb_Switch4_e4 = (uint8_T)(DFC_Msg3AATmt_ASW | 152U);
  } else if (rtb_LogicalOperator2_h) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_Msg3AATmt_ASW | 16U)
      | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_o;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_bz = false;
  COMR_TimeOut_DW.Delay3_DSTATE_o = rtb_Switch4_e4;
  if (rtb_LogicalOperator2_h || rtb_Switch6) {
    DFC_Msg3AATmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_Msg3AATmt_ASW = 0U;
  }

  rtb_Switch6 = (rtb_LogicalOperator3 && COMR_DFC_Msg2DFTmt);
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_ne) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_ne;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_TimeOut_DW.Delay_DSTATE_ne = rtb_Product;
  rtb_Switch6 = (rtb_Compare_d && (rtb_Product > COMR_tiGWMsgTmt_C));
  rtb_LogicalOperator2_h = !COMR_DFC_Msg2DFTmt;
  if (rtb_LogicalOperator2_h) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_p) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_p;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_LogicalOperator2_h;
  COMR_TimeOut_DW.Delay_DSTATE_p = rtb_Product;
  rtb_LogicalOperator2_h = ((!rtb_Compare_d) || (rtb_Product > COMR_tiGWMsgTmt_C));
  if (COMR_TimeOut_DW.Delay2_DSTATE_ck) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2DFTmt_ASW | 8U);
  } else if (rtb_Switch6) {
    rtb_Switch4_e4 = (uint8_T)(DFC_Msg2DFTmt_ASW | 152U);
  } else if (rtb_LogicalOperator2_h) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2DFTmt_ASW | 16U)
      | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_jo;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_ck = false;
  COMR_TimeOut_DW.Delay3_DSTATE_jo = rtb_Switch4_e4;
  if (rtb_LogicalOperator2_h || rtb_Switch6) {
    DFC_Msg2DFTmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_Msg2DFTmt_ASW = 0U;
  }

  if (BSPR_bKl15WkUp) {
    rtb_Product_mu = 0.01F;
  } else {
    rtb_Product_mu = 0.0F;
  }

  if (COMR_tiGWMsg050Tmt_C <= COMR_TimeOut_DW.Delay_DSTATE_f) {
    rtb_Product = COMR_tiGWMsg050Tmt_C;
  } else {
    rtb_Product = COMR_TimeOut_DW.Delay_DSTATE_f;
  }

  rtb_Product = (rtb_Product_mu + rtb_Product) * (real32_T)BSPR_bKl15WkUp;
  COMR_TimeOut_DW.Delay_DSTATE_f = rtb_Product;
  rtb_Switch6 = ((rtb_Product > COMR_tiGWMsg050Tmt_C) && rtb_LogicalOperator3 &&
                 COMR_DFC_Msg050Tmt);
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_b) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_b;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_TimeOut_DW.Delay_DSTATE_b = rtb_Product;
  COMR_flgTmtGWABM050 = (rtb_Compare_d && (rtb_Product > COMR_tiGWMsgTmt_C));
  rtb_Switch6 = !COMR_DFC_Msg050Tmt;
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_ng) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_ng;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_TimeOut_DW.Delay_DSTATE_ng = rtb_Product;
  rtb_Switch6 = ((!rtb_Compare_d) || (rtb_Product > COMR_tiGWMsgTmt_C));
  if (COMR_TimeOut_DW.Delay2_DSTATE_nr) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_Msg050Tmt_ASW | 8U);
  } else if (COMR_flgTmtGWABM050) {
    rtb_Switch4_e4 = (uint8_T)(DFC_Msg050Tmt_ASW | 152U);
  } else if (rtb_Switch6) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_Msg050Tmt_ASW | 16U)
      | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_fo;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_nr = false;
  COMR_TimeOut_DW.Delay3_DSTATE_fo = rtb_Switch4_e4;
  if (rtb_Switch6 || COMR_flgTmtGWABM050) {
    DFC_Msg050Tmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_Msg050Tmt_ASW = 0U;
  }

  rtb_Switch6 = (rtb_LogicalOperator3 && COMR_DFC_Msg2BBTmt);
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_o2) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_o2;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_TimeOut_DW.Delay_DSTATE_o2 = rtb_Product;
  COMR_flgTmtGW2BB = (rtb_Compare_d && (rtb_Product > COMR_tiGWMsgTmt_C));
  rtb_Switch6 = !COMR_DFC_Msg2BBTmt;
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_dx) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_dx;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_TimeOut_DW.Delay_DSTATE_dx = rtb_Product;
  rtb_Switch6 = ((!rtb_Compare_d) || (rtb_Product > COMR_tiGWMsgTmt_C));
  if (COMR_TimeOut_DW.Delay2_DSTATE_hr) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2BBTmt_ASW | 8U);
  } else if (COMR_flgTmtGW2BB) {
    rtb_Switch4_e4 = (uint8_T)(DFC_Msg2BBTmt_ASW | 152U);
  } else if (rtb_Switch6) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2BBTmt_ASW | 16U)
      | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_bv;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_hr = false;
  COMR_TimeOut_DW.Delay3_DSTATE_bv = rtb_Switch4_e4;
  if (rtb_Switch6 || COMR_flgTmtGW2BB) {
    DFC_Msg2BBTmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_Msg2BBTmt_ASW = 0U;
  }

  rtb_Switch6 = (rtb_LogicalOperator3 && COMR_DFC_Msg17DTmt);
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_ar) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_ar;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_TimeOut_DW.Delay_DSTATE_ar = rtb_Product;
  rtb_Switch6 = (rtb_Compare_d && (rtb_Product > COMR_tiGWMsgTmt_C));
  rtb_LogicalOperator2_h = !COMR_DFC_Msg17DTmt;
  if (rtb_LogicalOperator2_h) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_ae) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_ae;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_LogicalOperator2_h;
  COMR_TimeOut_DW.Delay_DSTATE_ae = rtb_Product;
  rtb_LogicalOperator2_h = ((!rtb_Compare_d) || (rtb_Product > COMR_tiGWMsgTmt_C));
  if (COMR_TimeOut_DW.Delay2_DSTATE_i) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_Msg17DTmt_ASW | 8U);
  } else if (rtb_Switch6) {
    rtb_Switch4_e4 = (uint8_T)(DFC_Msg17DTmt_ASW | 152U);
  } else if (rtb_LogicalOperator2_h) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_Msg17DTmt_ASW | 16U)
      | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_m;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_i = false;
  COMR_TimeOut_DW.Delay3_DSTATE_m = rtb_Switch4_e4;
  if (rtb_LogicalOperator2_h || rtb_Switch6) {
    DFC_Msg17DTmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_Msg17DTmt_ASW = 0U;
  }

  rtb_Switch6 = (rtb_LogicalOperator3 && COMR_DFC_Msg28CTmt);
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_ee) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_ee;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_TimeOut_DW.Delay_DSTATE_ee = rtb_Product;
  rtb_Switch6 = (rtb_Compare_d && (rtb_Product > COMR_tiGWMsgTmt_C));
  rtb_LogicalOperator2_h = !COMR_DFC_Msg28CTmt;
  if (rtb_LogicalOperator2_h) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_ok) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_ok;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_LogicalOperator2_h;
  COMR_TimeOut_DW.Delay_DSTATE_ok = rtb_Product;
  rtb_LogicalOperator2_h = ((!rtb_Compare_d) || (rtb_Product > COMR_tiGWMsgTmt_C));
  if (COMR_TimeOut_DW.Delay2_DSTATE_g) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_Msg28CTmt_ASW | 8U);
  } else if (rtb_Switch6) {
    rtb_Switch4_e4 = (uint8_T)(DFC_Msg28CTmt_ASW | 152U);
  } else if (rtb_LogicalOperator2_h) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_Msg28CTmt_ASW | 16U)
      | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_bg;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_g = false;
  COMR_TimeOut_DW.Delay3_DSTATE_bg = rtb_Switch4_e4;
  if (rtb_LogicalOperator2_h || rtb_Switch6) {
    DFC_Msg28CTmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_Msg28CTmt_ASW = 0U;
  }

  rtb_Switch6 = (rtb_LogicalOperator3 && COMR_DFC_Msg37FTmt);
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_cv) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_cv;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_TimeOut_DW.Delay_DSTATE_cv = rtb_Product;
  rtb_Switch6 = (rtb_Compare_d && (rtb_Product > COMR_tiGWMsgTmt_C));
  rtb_LogicalOperator2_h = !COMR_DFC_Msg37FTmt;
  if (rtb_LogicalOperator2_h) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_mk) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_mk;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_LogicalOperator2_h;
  COMR_TimeOut_DW.Delay_DSTATE_mk = rtb_Product;
  rtb_LogicalOperator2_h = ((!rtb_Compare_d) || (rtb_Product > COMR_tiGWMsgTmt_C));
  if (COMR_TimeOut_DW.Delay2_DSTATE_j) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_Msg37FTmt_ASW | 8U);
  } else if (rtb_Switch6) {
    rtb_Switch4_e4 = (uint8_T)(DFC_Msg37FTmt_ASW | 152U);
  } else if (rtb_LogicalOperator2_h) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_Msg37FTmt_ASW | 16U)
      | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_i;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_j = false;
  COMR_TimeOut_DW.Delay3_DSTATE_i = rtb_Switch4_e4;
  if (rtb_LogicalOperator2_h || rtb_Switch6) {
    DFC_Msg37FTmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_Msg37FTmt_ASW = 0U;
  }

  rtb_Switch6 = (rtb_LogicalOperator3 && COMR_DFC_Msg195Tmt);
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_j) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_j;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_TimeOut_DW.Delay_DSTATE_j = rtb_Product;
  rtb_Switch6 = (rtb_Compare_d && (rtb_Product > COMR_tiGWMsgTmt_C));
  rtb_LogicalOperator2_h = !COMR_DFC_Msg195Tmt;
  if (rtb_LogicalOperator2_h) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_oi) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_oi;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_LogicalOperator2_h;
  COMR_TimeOut_DW.Delay_DSTATE_oi = rtb_Product;
  rtb_LogicalOperator2_h = ((!rtb_Compare_d) || (rtb_Product > COMR_tiGWMsgTmt_C));
  if (COMR_TimeOut_DW.Delay2_DSTATE_h) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_Msg195Tmt_ASW | 8U);
  } else if (rtb_Switch6) {
    rtb_Switch4_e4 = (uint8_T)(DFC_Msg195Tmt_ASW | 152U);
  } else if (rtb_LogicalOperator2_h) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_Msg195Tmt_ASW | 16U)
      | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_f;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_h = false;
  COMR_TimeOut_DW.Delay3_DSTATE_f = rtb_Switch4_e4;
  if (rtb_LogicalOperator2_h || rtb_Switch6) {
    DFC_Msg195Tmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_Msg195Tmt_ASW = 0U;
  }

  rtb_Switch6 = (rtb_LogicalOperator3 && COMR_DFC_Msg2F1Tmt);
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_kr) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_kr;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_TimeOut_DW.Delay_DSTATE_kr = rtb_Product;
  rtb_Switch6 = (rtb_Compare_d && (rtb_Product > COMR_tiGWMsgTmt_C));
  rtb_LogicalOperator2_h = !COMR_DFC_Msg2F1Tmt;
  if (rtb_LogicalOperator2_h) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (COMR_tiGWMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_kh) {
    rtb_Product_mu = COMR_tiGWMsgTmt_C;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_kh;
  }

  rtb_Product = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_LogicalOperator2_h;
  COMR_TimeOut_DW.Delay_DSTATE_kh = rtb_Product;
  rtb_Compare_d = ((!rtb_Compare_d) || (rtb_Product > COMR_tiGWMsgTmt_C));
  if (COMR_TimeOut_DW.Delay2_DSTATE_m) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2F1Tmt_ASW | 8U);
  } else if (rtb_Switch6) {
    rtb_Switch4_e4 = (uint8_T)(DFC_Msg2F1Tmt_ASW | 152U);
  } else if (rtb_Compare_d) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2F1Tmt_ASW | 16U)
      | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_cw;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_m = false;
  COMR_TimeOut_DW.Delay3_DSTATE_cw = rtb_Switch4_e4;
  if (rtb_Compare_d || rtb_Switch6) {
    DFC_Msg2F1Tmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_Msg2F1Tmt_ASW = 0U;
  }

  rtb_Compare_d = (rtb_LogicalOperator3 && COMR_DFC_Msg2A3Tmt);
  if (COMR_YearSet == COMR_numPackVcuMsg_C) {
    rtb_Product = COMR_tiPackVcuMsgTmt_C;
  } else {
    rtb_Product = COMR_tiVcuMsgTmt_C;
  }

  if (rtb_Compare_d) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (rtb_Product <= COMR_TimeOut_DW.Delay_DSTATE_k) {
    rtb_Product_mu = rtb_Product;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_k;
  }

  rtb_Product_mu = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Compare_d;
  COMR_TimeOut_DW.Delay_DSTATE_k = rtb_Product_mu;
  rtb_Compare_d = ((COMR_cntVcu2A3TmtDiag_CW & 16) == 16);
  COMR_bTmtVcu2A3Det = (rtb_Compare_d && (rtb_Product_mu > rtb_Product));
  rtb_Switch6 = !COMR_DFC_Msg2A3Tmt;
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (rtb_Product <= COMR_TimeOut_DW.Delay_DSTATE_gz) {
    rtb_Product_mu = rtb_Product;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_gz;
  }

  rtb_Product_mu = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_TimeOut_DW.Delay_DSTATE_gz = rtb_Product_mu;
  COMR_bTmtVcu2A3Heal = ((!rtb_Compare_d) || (rtb_Product_mu > rtb_Product));
  if (COMR_TimeOut_DW.Delay2_DSTATE_e) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2A3Tmt_ASW | 8U);
  } else if (COMR_bTmtVcu2A3Det) {
    rtb_Switch4_e4 = (uint8_T)(DFC_Msg2A3Tmt_ASW | 152U);
  } else if (COMR_bTmtVcu2A3Heal) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2A3Tmt_ASW | 16U)
      | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_k;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_e = false;
  COMR_TimeOut_DW.Delay3_DSTATE_k = rtb_Switch4_e4;
  if (COMR_bTmtVcu2A3Heal || COMR_bTmtVcu2A3Det) {
    DFC_Msg2A3Tmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_Msg2A3Tmt_ASW = 0U;
  }

  rtb_Switch6 = (rtb_LogicalOperator3 && COMR_DFC_Msg2A5Tmt);
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (rtb_Product <= COMR_TimeOut_DW.Delay_DSTATE_n) {
    rtb_Product_mu = rtb_Product;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_n;
  }

  rtb_Product_mu = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_TimeOut_DW.Delay_DSTATE_n = rtb_Product_mu;
  COMR_flgTmtVcu2A5 = (rtb_Compare_d && (rtb_Product_mu > rtb_Product));
  rtb_Switch6 = !COMR_DFC_Msg2A5Tmt;
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (rtb_Product <= COMR_TimeOut_DW.Delay_DSTATE_e) {
    rtb_Product_mu = rtb_Product;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_e;
  }

  rtb_Product_mu = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_TimeOut_DW.Delay_DSTATE_e = rtb_Product_mu;
  rtb_Switch6 = ((!rtb_Compare_d) || (rtb_Product_mu > rtb_Product));
  if (COMR_TimeOut_DW.Delay2_DSTATE_k) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2A5Tmt_ASW | 8U);
  } else if (COMR_flgTmtVcu2A5) {
    rtb_Switch4_e4 = (uint8_T)(DFC_Msg2A5Tmt_ASW | 152U);
  } else if (rtb_Switch6) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2A5Tmt_ASW | 16U)
      | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_c;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_k = false;
  COMR_TimeOut_DW.Delay3_DSTATE_c = rtb_Switch4_e4;
  if (rtb_Switch6 || COMR_flgTmtVcu2A5) {
    DFC_Msg2A5Tmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_Msg2A5Tmt_ASW = 0U;
  }

  rtb_Switch6 = (rtb_LogicalOperator3 && COMR_DFC_Msg2A7Tmt);
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (rtb_Product <= COMR_TimeOut_DW.Delay_DSTATE_ej) {
    rtb_Product_mu = rtb_Product;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_ej;
  }

  rtb_Product_mu = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_TimeOut_DW.Delay_DSTATE_ej = rtb_Product_mu;
  COMR_flgTmtVcu2A7 = (rtb_Compare_d && (rtb_Product_mu > rtb_Product));
  rtb_Switch6 = !COMR_DFC_Msg2A7Tmt;
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (rtb_Product <= COMR_TimeOut_DW.Delay_DSTATE_gc) {
    rtb_Product_mu = rtb_Product;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_gc;
  }

  rtb_Product_mu = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_TimeOut_DW.Delay_DSTATE_gc = rtb_Product_mu;
  rtb_Switch6 = ((!rtb_Compare_d) || (rtb_Product_mu > rtb_Product));
  if (COMR_TimeOut_DW.Delay2_DSTATE_em) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2A7Tmt_ASW | 8U);
  } else if (COMR_flgTmtVcu2A7) {
    rtb_Switch4_e4 = (uint8_T)(DFC_Msg2A7Tmt_ASW | 152U);
  } else if (rtb_Switch6) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2A7Tmt_ASW | 16U)
      | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_l;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_em = false;
  COMR_TimeOut_DW.Delay3_DSTATE_l = rtb_Switch4_e4;
  if (rtb_Switch6 || COMR_flgTmtVcu2A7) {
    DFC_Msg2A7Tmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_Msg2A7Tmt_ASW = 0U;
  }

  rtb_Switch6 = (rtb_LogicalOperator3 && COMR_DFC_Msg0B5Tmt);
  if (rtb_Switch6) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (rtb_Product <= COMR_TimeOut_DW.Delay_DSTATE_c) {
    rtb_Product_mu = rtb_Product;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_c;
  }

  rtb_Product_mu = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_Switch6;
  COMR_TimeOut_DW.Delay_DSTATE_c = rtb_Product_mu;
  rtb_Switch6 = (rtb_Compare_d && (rtb_Product_mu > rtb_Product));
  rtb_LogicalOperator2_h = !COMR_DFC_Msg0B5Tmt;
  if (rtb_LogicalOperator2_h) {
    rtb_LogicalOperator3_0 = 0.01F;
  } else {
    rtb_LogicalOperator3_0 = 0.0F;
  }

  if (rtb_Product <= COMR_TimeOut_DW.Delay_DSTATE_g) {
    rtb_Product_mu = rtb_Product;
  } else {
    rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_g;
  }

  rtb_Product_mu = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
    rtb_LogicalOperator2_h;
  COMR_TimeOut_DW.Delay_DSTATE_g = rtb_Product_mu;
  rtb_Compare_d = ((!rtb_Compare_d) || (rtb_Product_mu > rtb_Product));
  if (COMR_TimeOut_DW.Delay2_DSTATE_b) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_Msg0B5Tmt_ASW | 8U);
  } else if (rtb_Switch6) {
    rtb_Switch4_e4 = (uint8_T)(DFC_Msg0B5Tmt_ASW | 152U);
  } else if (rtb_Compare_d) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_Msg0B5Tmt_ASW | 16U)
      | 8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_b;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_b = false;
  COMR_TimeOut_DW.Delay3_DSTATE_b = rtb_Switch4_e4;
  if (rtb_Compare_d || rtb_Switch6) {
    DFC_Msg0B5Tmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_Msg0B5Tmt_ASW = 0U;
  }

  rtb_Compare_d = (rtb_Switch6 && COMR_flgTmtVcu2A5 && COMR_flgTmtVcu2A7 &&
                   COMR_bTmtVcu2A3Det);
  rtb_Switch6 = !rtb_Compare_d;
  if (COMR_TimeOut_DW.Delay2_DSTATE_o) {
    rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_VcuTmt_ASW | 8U);
  } else if (rtb_Compare_d) {
    rtb_Switch4_e4 = (uint8_T)(DFC_VcuTmt_ASW | 152U);
  } else if (rtb_Switch6) {
    rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_VcuTmt_ASW | 16U) |
      8U);
  } else {
    rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE;
  }

  COMR_TimeOut_DW.Delay2_DSTATE_o = false;
  COMR_TimeOut_DW.Delay3_DSTATE = rtb_Switch4_e4;
  if (rtb_Switch6 || rtb_Compare_d) {
    DFC_VcuTmt_ASW = rtb_Switch4_e4;
  } else {
    DFC_VcuTmt_ASW = 0U;
  }

  rtb_Compare_d = !COMR_TimeOut_DW.Delay1_DSTATE;
  COMR_TimeOut_DW.Delay1_DSTATE = COMR_TimeOut_DW.Delay2_DSTATE;
  if (rtb_Compare_d && COMR_TimeOut_DW.Delay2_DSTATE) {
    rtb_Product = 0.0F;
  } else {
    if (rtb_LogicalOperator4_l) {
      rtb_Product = COMR_tiTmtBase_C;
    } else {
      rtb_Product = 0.0F;
    }

    rtb_Product += COMR_TimeOut_DW.UnitDelay_DSTATE;
  }

  if (BMCR_bOutputVolt12vEna) {
    if (!COMR_TimeOut_DW.CAB_MODE) {
      COMR_TimeOut_DW.Delay_DSTATE_oa = 0.0F;
      COMR_TimeOut_DW.Delay_DSTATE_dd = 0.0F;
      COMR_TimeOut_DW.Delay2_DSTATE_kg = true;
      COMR_TimeOut_DW.Delay3_DSTATE_fog = 0U;
      COMR_TimeOut_DW.CAB_MODE = true;
    }

    rtb_Compare_d = (rtb_LogicalOperator3 && COMR_DFC_MsgCABTmt);
    if (rtb_Compare_d) {
      rtb_LogicalOperator3_0 = 0.01F;
    } else {
      rtb_LogicalOperator3_0 = 0.0F;
    }

    if (COMR_tiCabMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_oa) {
      rtb_Product_mu = COMR_tiCabMsgTmt_C;
    } else {
      rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_oa;
    }

    rtb_Product_mu = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
      rtb_Compare_d;
    COMR_TimeOut_DW.Delay_DSTATE_oa = rtb_Product_mu;
    rtb_Compare_d = ((COMR_cntObcTmtDiag_CW & 16) == 16);
    COMR_flgTmtCAB = (rtb_Compare_d && (rtb_Product_mu > COMR_tiCabMsgTmt_C));
    rtb_Switch6 = !COMR_DFC_MsgCABTmt;
    if (rtb_Switch6) {
      rtb_LogicalOperator3_0 = 0.01F;
    } else {
      rtb_LogicalOperator3_0 = 0.0F;
    }

    if (COMR_tiCabMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_dd) {
      rtb_Product_mu = COMR_tiCabMsgTmt_C;
    } else {
      rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_dd;
    }

    rtb_Product_mu = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
      rtb_Switch6;
    COMR_TimeOut_DW.Delay_DSTATE_dd = rtb_Product_mu;
    rtb_Compare_d = ((!rtb_Compare_d) || (rtb_Product_mu > COMR_tiCabMsgTmt_C));
    if (COMR_TimeOut_DW.Delay2_DSTATE_kg) {
      rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_MsgCABTmt_ASW | 8U);
    } else if (COMR_flgTmtCAB) {
      rtb_Switch4_e4 = (uint8_T)(DFC_MsgCABTmt_ASW | 152U);
    } else if (rtb_Compare_d) {
      rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_MsgCABTmt_ASW |
        16U) | 8U);
    } else {
      rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_fog;
    }

    COMR_TimeOut_DW.Delay2_DSTATE_kg = false;
    COMR_TimeOut_DW.Delay3_DSTATE_fog = rtb_Switch4_e4;
    if (rtb_Compare_d || COMR_flgTmtCAB) {
      DFC_MsgCABTmt_ASW = rtb_Switch4_e4;
    } else {
      DFC_MsgCABTmt_ASW = 0U;
    }
  } else {
    if (COMR_TimeOut_DW.CAB_MODE) {
      COMR_TimeOut_DW.CAB_MODE = false;
    }
  }

  if (BMCR_stBmsModeCtrl == 6) {
    if (!COMR_TimeOut_DW.OBC_MODE) {
      COMR_TimeOut_DW.OBC_MODE = true;
    }

    rtb_Compare_d = (rtb_LogicalOperator3 && COMR_DFC_Msg2E6Tmt);
    if (rtb_Compare_d) {
      rtb_LogicalOperator3_0 = 0.01F;
    } else {
      rtb_LogicalOperator3_0 = 0.0F;
    }

    if (COMR_tiObcMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_mc) {
      rtb_Product_mu = COMR_tiObcMsgTmt_C;
    } else {
      rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_mc;
    }

    rtb_Product_mu = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
      rtb_Compare_d;
    COMR_TimeOut_DW.Delay_DSTATE_mc = rtb_Product_mu;
    rtb_Compare_d = ((COMR_cntObcTmtDiag_CW & 16) == 16);
    COMR_bTmtObc2E0Det = (rtb_Compare_d && (rtb_Product_mu > COMR_tiObcMsgTmt_C));
    rtb_Switch6 = !COMR_DFC_Msg2E6Tmt;
    if (rtb_Switch6) {
      rtb_LogicalOperator3_0 = 0.01F;
    } else {
      rtb_LogicalOperator3_0 = 0.0F;
    }

    if (COMR_tiObcMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_a) {
      rtb_Product_mu = COMR_tiObcMsgTmt_C;
    } else {
      rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_a;
    }

    rtb_Product_mu = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
      rtb_Switch6;
    COMR_TimeOut_DW.Delay_DSTATE_a = rtb_Product_mu;
    COMR_bTmtObc2E0Heal = ((!rtb_Compare_d) || (rtb_Product_mu >
      COMR_tiObcMsgTmt_C));
    if (COMR_TimeOut_DW.Delay2_DSTATE_eq) {
      rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2E6Tmt_ASW | 8U);
    } else if (COMR_bTmtObc2E0Det) {
      rtb_Switch4_e4 = (uint8_T)(DFC_Msg2E6Tmt_ASW | 152U);
    } else if (COMR_bTmtObc2E0Heal) {
      rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2E6Tmt_ASW |
        16U) | 8U);
    } else {
      rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_c0;
    }

    COMR_TimeOut_DW.Delay2_DSTATE_eq = false;
    COMR_TimeOut_DW.Delay3_DSTATE_c0 = rtb_Switch4_e4;
    if (COMR_bTmtObc2E0Heal || COMR_bTmtObc2E0Det) {
      DFC_Msg2E6Tmt_ASW = rtb_Switch4_e4;
    } else {
      DFC_Msg2E6Tmt_ASW = 0U;
    }

    rtb_Switch6 = (rtb_LogicalOperator3 && COMR_DFC_Msg2E1Tmt);
    if (rtb_Switch6) {
      rtb_LogicalOperator3_0 = 0.01F;
    } else {
      rtb_LogicalOperator3_0 = 0.0F;
    }

    if (COMR_tiObcMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_o) {
      rtb_Product_mu = COMR_tiObcMsgTmt_C;
    } else {
      rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_o;
    }

    rtb_Product_mu = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
      rtb_Switch6;
    COMR_TimeOut_DW.Delay_DSTATE_o = rtb_Product_mu;
    rtb_Switch6 = (rtb_Compare_d && (rtb_Product_mu > COMR_tiObcMsgTmt_C));
    rtb_LogicalOperator2_h = !COMR_DFC_Msg2E1Tmt;
    if (rtb_LogicalOperator2_h) {
      rtb_LogicalOperator3_0 = 0.01F;
    } else {
      rtb_LogicalOperator3_0 = 0.0F;
    }

    if (COMR_tiObcMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_ko) {
      rtb_Product_mu = COMR_tiObcMsgTmt_C;
    } else {
      rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_ko;
    }

    rtb_Product_mu = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
      rtb_LogicalOperator2_h;
    COMR_TimeOut_DW.Delay_DSTATE_ko = rtb_Product_mu;
    rtb_LogicalOperator2_h = ((!rtb_Compare_d) || (rtb_Product_mu >
      COMR_tiObcMsgTmt_C));
    if (COMR_TimeOut_DW.Delay2_DSTATE_kv) {
      rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2E1Tmt_ASW | 8U);
    } else if (rtb_Switch6) {
      rtb_Switch4_e4 = (uint8_T)(DFC_Msg2E1Tmt_ASW | 152U);
    } else if (rtb_LogicalOperator2_h) {
      rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2E1Tmt_ASW |
        16U) | 8U);
    } else {
      rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_h;
    }

    COMR_TimeOut_DW.Delay2_DSTATE_kv = false;
    COMR_TimeOut_DW.Delay3_DSTATE_h = rtb_Switch4_e4;
    if (rtb_LogicalOperator2_h || rtb_Switch6) {
      DFC_Msg2E1Tmt_ASW = rtb_Switch4_e4;
    } else {
      DFC_Msg2E1Tmt_ASW = 0U;
    }

    rtb_LogicalOperator3 = (rtb_LogicalOperator3 && COMR_DFC_Msg2EBTmt);
    if (rtb_LogicalOperator3) {
      rtb_LogicalOperator3_0 = 0.01F;
    } else {
      rtb_LogicalOperator3_0 = 0.0F;
    }

    if (COMR_tiObcMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_d) {
      rtb_Product_mu = COMR_tiObcMsgTmt_C;
    } else {
      rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_d;
    }

    rtb_Product_mu = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
      rtb_LogicalOperator3;
    COMR_TimeOut_DW.Delay_DSTATE_d = rtb_Product_mu;
    rtb_LogicalOperator3 = (rtb_Compare_d && (rtb_Product_mu >
      COMR_tiObcMsgTmt_C));
    rtb_LogicalOperator2_h = !COMR_DFC_Msg2EBTmt;
    if (rtb_LogicalOperator2_h) {
      rtb_LogicalOperator3_0 = 0.01F;
    } else {
      rtb_LogicalOperator3_0 = 0.0F;
    }

    if (COMR_tiObcMsgTmt_C <= COMR_TimeOut_DW.Delay_DSTATE_m) {
      rtb_Product_mu = COMR_tiObcMsgTmt_C;
    } else {
      rtb_Product_mu = COMR_TimeOut_DW.Delay_DSTATE_m;
    }

    rtb_Product_mu = (rtb_LogicalOperator3_0 + rtb_Product_mu) * (real32_T)
      rtb_LogicalOperator2_h;
    COMR_TimeOut_DW.Delay_DSTATE_m = rtb_Product_mu;
    rtb_Compare_d = ((!rtb_Compare_d) || (rtb_Product_mu > COMR_tiObcMsgTmt_C));
    if (COMR_TimeOut_DW.Delay2_DSTATE_oq) {
      rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2EBTmt_ASW | 8U);
    } else if (rtb_LogicalOperator3) {
      rtb_Switch4_e4 = (uint8_T)(DFC_Msg2EBTmt_ASW | 152U);
    } else if (rtb_Compare_d) {
      rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_Msg2EBTmt_ASW |
        16U) | 8U);
    } else {
      rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_n;
    }

    COMR_TimeOut_DW.Delay2_DSTATE_oq = false;
    COMR_TimeOut_DW.Delay3_DSTATE_n = rtb_Switch4_e4;
    if (rtb_Compare_d || rtb_LogicalOperator3) {
      DFC_Msg2EBTmt_ASW = rtb_Switch4_e4;
    } else {
      DFC_Msg2EBTmt_ASW = 0U;
    }

    rtb_LogicalOperator3 = (COMR_bTmtObc2E0Det && rtb_Switch6 &&
      rtb_LogicalOperator3);
    rtb_Compare_d = !rtb_LogicalOperator3;
    if (COMR_TimeOut_DW.Delay2_DSTATE_p) {
      rtb_Switch4_e4 = (uint8_T)~(uint8_T)((uint8_T)~DFC_ObcTmt_ASW | 8U);
    } else if (rtb_LogicalOperator3) {
      rtb_Switch4_e4 = (uint8_T)(DFC_ObcTmt_ASW | 152U);
    } else if (rtb_Compare_d) {
      rtb_Switch4_e4 = (uint8_T)((uint8_T)~(uint8_T)((uint8_T)~DFC_ObcTmt_ASW | 16U)
        | 8U);
    } else {
      rtb_Switch4_e4 = COMR_TimeOut_DW.Delay3_DSTATE_cx;
    }

    COMR_TimeOut_DW.Delay2_DSTATE_p = false;
    COMR_TimeOut_DW.Delay3_DSTATE_cx = rtb_Switch4_e4;
    if (rtb_Compare_d || rtb_LogicalOperator3) {
      DFC_ObcTmt_ASW = rtb_Switch4_e4;
    } else {
      DFC_ObcTmt_ASW = 0U;
    }
  } else {
    if (COMR_TimeOut_DW.OBC_MODE) {
      COMR_bTmtObc2E0Det = false;
      COMR_bTmtObc2E0Heal = false;
      COMR_TimeOut_DW.OBC_MODE = false;
    }
  }

  COMR_TimeOut_DW.Delay_DSTATE_jm = rtb_LogicalOperator4_l;
  COMR_TimeOut_DW.Delay2_DSTATE = (rtb_Product > COMR_tiBusoffDiagEna_C);
  COMR_TimeOut_DW.UnitDelay_DSTATE = rtb_Product;
}

/* Model initialize function */
void COMR_TimeOut_initialize(void)
{
  /* Registration code */

  /* block I/O */

  /* custom signals */
  COMR_flgTmtGW2AD = false;
  COMR_flgTmtGWABM050 = false;
  COMR_flgTmtGW2BB = false;
  COMR_bTmtVcu2A3Det = false;
  COMR_bTmtVcu2A3Heal = false;
  COMR_flgTmtVcu2A5 = false;
  COMR_flgTmtVcu2A7 = false;
  COMR_bTmtObc2E0Det = false;
  COMR_bTmtObc2E0Heal = false;
  COMR_bTmtCellTmpDet = false;
  COMR_bTmtCellVolHeal = false;
  COMR_bTmtCellTmpHeal = false;
  COMR_bTmtBoardTmpHeal = false;
  COMR_bTmtBoardTmpDet = false;
  COMR_bTmtCellVolDet = false;
  COMR_flgTmtModuVol = false;
  COMR_flgTmtBalCirSta = false;
  COMR_flgTmtCAB = false;
  COMR_bTmt638Physical2Heal = false;
  COMR_bTmt638Physical1Heal = false;
  COMR_bTmt638Physical2Det = false;
  COMR_bTmt638Physical1Det = false;

  /* external inputs */
  COMR_flgDiagSlntReq = false;
  COMR_TimeOut_DW.Delay2_DSTATE_c = true;
  COMR_TimeOut_DW.Delay2_DSTATE_dx = true;
  COMR_TimeOut_DW.Delay2_DSTATE_g3 = true;
  COMR_TimeOut_DW.Delay2_DSTATE_ii = true;
  COMR_TimeOut_DW.Delay2_DSTATE_d = true;
  COMR_TimeOut_DW.Delay2_DSTATE_pz = true;
  COMR_TimeOut_DW.Delay2_DSTATE_n = true;
  COMR_TimeOut_DW.Delay2_DSTATE_bz = true;
  COMR_TimeOut_DW.Delay2_DSTATE_ck = true;
  COMR_TimeOut_DW.Delay2_DSTATE_nr = true;
  COMR_TimeOut_DW.Delay2_DSTATE_hr = true;
  COMR_TimeOut_DW.Delay2_DSTATE_i = true;
  COMR_TimeOut_DW.Delay2_DSTATE_g = true;
  COMR_TimeOut_DW.Delay2_DSTATE_j = true;
  COMR_TimeOut_DW.Delay2_DSTATE_h = true;
  COMR_TimeOut_DW.Delay2_DSTATE_m = true;
  COMR_TimeOut_DW.Delay2_DSTATE_e = true;
  COMR_TimeOut_DW.Delay2_DSTATE_k = true;
  COMR_TimeOut_DW.Delay2_DSTATE_em = true;
  COMR_TimeOut_DW.Delay2_DSTATE_b = true;
  COMR_TimeOut_DW.Delay2_DSTATE_o = true;
  COMR_TimeOut_DW.Delay1_DSTATE = true;
  COMR_TimeOut_DW.Delay2_DSTATE_kg = true;
  COMR_TimeOut_DW.Delay2_DSTATE_eq = true;
  COMR_TimeOut_DW.Delay2_DSTATE_kv = true;
  COMR_TimeOut_DW.Delay2_DSTATE_oq = true;
  COMR_TimeOut_DW.Delay2_DSTATE_p = true;
}

/*
 * File trailer for generated code.
 *
 * [EOF]
 */
