/* This file is part of X2C. http://x2c.lcm.at/                                                                       */

/* Model: Application                                                                                                 */
/* Date:  2022-05-16 17:51                                                                                            */

/* X2C-Version: 6.2.1835                                                                                              */
/* X2C-Edition: Educational                                                                                           */

/* Common includes                                                                                                    */
#include "TableStruct.h"
/* Generated file includes                                                                                            */
#include "FlashTable.h"
#include "RamTable.h"
#include "X2C.h"

/**********************************************************************************************************************/
/**                                                       Model                                                      **/
/**********************************************************************************************************************/
struct x2cModel x2cModel;

/**********************************************************************************************************************/
/**                                                       Scope                                                      **/
/**********************************************************************************************************************/
SCOPE_MAIN x2cScope;



/* Block function table                                                                                               */
#define END_BLOCKFUNCTIONS { (uint16)0, (void (*)(void*))0, (void (*)(void*))0, \
    (tLoadImplementationParameter)0, (tSaveImplementationParameter)0, (void* (*)(const void*, uint16))0 }
const tBlockFunctions blockFunctionTable[] = {
    FUNCTIONS,
    END_BLOCKFUNCTIONS
};

/* Parameter identifier table                                                                                         */
#define END_PARAMETERTABLE { (uint16)0, (void*)0 }
const tParameterTable parameterIdTable[] = {
    PARAMETER_TABLE,
    END_PARAMETERTABLE
};

/* Inport Parameter identifier table                                                                                  */
#define END_PARAMID_IO_TABLE { 0, 0, (void*)0 }
const tIoParamIdEntry inportParamIdTable[] = {
    INPORT_PARAMID_TABLE, 
    END_PARAMID_IO_TABLE
};

/* Outport Parameter identifier table                                                                                 */
const tIoParamIdEntry outportParamIdTable[] = {
    OUTPORT_PARAMID_TABLE, 
    END_PARAMID_IO_TABLE
};
/* Mask Parameter identifier table                                                                                    */
#define END_MASKPARAMID_TABLE { 0, (void*)0, (void*)0, (tSaveMaskParameter)0, (tLoadMaskParameter)0 }
static const tMaskParameterEntry maskParamIdTable[] = {
    END_MASKPARAMID_TABLE
};

/**********************************************************************************************************************/
/** Model Sample Time                                                                                                **/
/**********************************************************************************************************************/
float_CoT getModelSampleTime()
{
    return ((float_CoT)1.0E-4);
}

/**********************************************************************************************************************/
/**                                                  Initialization                                                  **/
/**********************************************************************************************************************/
void X2C_Init()
{
    /******************************************************************************************************************/
    /**                                          Initialize Block Parameters                                         **/
    /******************************************************************************************************************/

    /* Block: And                                                                                                     */

    /* Block: And1                                                                                                    */

    /* Block: Duty_PFC                                                                                                */
    /* Value = 0.0                                                                                                    */
    x2cModel.blocks.bDuty_PFC.K = 0;

    /* Block: Duty_RB                                                                                                 */
    /* Value = 0.0                                                                                                    */
    x2cModel.blocks.bDuty_RB.K = 0;

    /* Block: EnableSwitch                                                                                            */

    /* Block: Enable_PFC                                                                                              */
    /* Value = 0.0                                                                                                    */
    x2cModel.blocks.bEnable_PFC.K = 0;

    /* Block: Enable_RB                                                                                               */
    /* Value = 0.0                                                                                                    */
    x2cModel.blocks.bEnable_RB.K = 0;

    /* Block: Gain2                                                                                                   */
    /* Gain = -1.0                                                                                                    */
    x2cModel.blocks.bGain2.V = -1;

    /* Block: Gain4                                                                                                   */
    /* Gain = 100.0                                                                                                   */
    x2cModel.blocks.bGain4.V = 100;

    /* Block: Not                                                                                                     */

    /* Block: Or                                                                                                      */

    /* Block: PT1                                                                                                     */
    /* V = 1.0                                                                                                        */
    /* fc = 200.0                                                                                                     */
    /* ts_fact = 1.0                                                                                                  */
    /* method = zoh                                                                                                   */
    x2cModel.blocks.bPT1.b0 = .1180886217018237;
    x2cModel.blocks.bPT1.b1 = 0;
    x2cModel.blocks.bPT1.a0 = -.8819113782981763;
    x2cModel.blocks.bPT1.in_old = 0;

    /* Block: RG_Enable1                                                                                              */
    /* Value = 1.0                                                                                                    */
    x2cModel.blocks.bRG_Enable1.K = 1;

    /* Block: RG_Reload1                                                                                              */
    /* Value = 0.0                                                                                                    */
    x2cModel.blocks.bRG_Reload1.K = 0;

    /* Block: RSFlipFlop                                                                                              */

    /* Block: RateLimiter                                                                                             */
    /* Tr = 1.0                                                                                                       */
    /* Tf = 1.0                                                                                                       */
    /* ts_fact = 1.0                                                                                                  */
    x2cModel.blocks.bRateLimiter.RateUp = .0001;
    x2cModel.blocks.bRateLimiter.RateDown = .0001;
    x2cModel.blocks.bRateLimiter.enable_old = 0;

    /* Block: Saturation                                                                                              */
    /* max = 450.0                                                                                                    */
    /* min = 250.0                                                                                                    */
    x2cModel.blocks.bSaturation.max = 450;
    x2cModel.blocks.bSaturation.min = 250;

    /* Block: Saturation1                                                                                             */
    /* max = 1.0                                                                                                      */
    /* min = -1.0                                                                                                     */
    x2cModel.blocks.bSaturation1.max = 1;
    x2cModel.blocks.bSaturation1.min = -1;

    /* Block: Sin3Gen                                                                                                 */
    /* fmax = 1000.0                                                                                                  */
    /* Offset = 0.0                                                                                                   */
    /* ts_fact = 1.0                                                                                                  */
    x2cModel.blocks.bSin3Gen.delta_phi = .000628318530718;
    x2cModel.blocks.bSin3Gen.offset = 0;
    x2cModel.blocks.bSin3Gen.phi = 0;

    /* Block: Toggle/And2                                                                                             */

    /* Block: Toggle/And3                                                                                             */

    /* Block: Toggle/And4                                                                                             */

    /* Block: Toggle/LoopBreaker                                                                                      */

    /* Block: Toggle/LoopBreaker1                                                                                     */

    /* Block: Toggle/LoopBreaker2                                                                                     */

    /* Block: Toggle/Not1                                                                                             */

    /* Block: Toggle/Not2                                                                                             */

    /* Block: Toggle/RSFlipFlop1                                                                                      */

    /* Block: Toggle1/And2                                                                                            */

    /* Block: Toggle1/And3                                                                                            */

    /* Block: Toggle1/And4                                                                                            */

    /* Block: Toggle1/LoopBreaker                                                                                     */

    /* Block: Toggle1/LoopBreaker1                                                                                    */

    /* Block: Toggle1/LoopBreaker2                                                                                    */

    /* Block: Toggle1/Not1                                                                                            */

    /* Block: Toggle1/Not2                                                                                            */

    /* Block: Toggle1/RSFlipFlop1                                                                                     */

    /* Block: U/f/Abs                                                                                                 */

    /* Block: U/f/Div                                                                                                 */

    /* Block: U/f/Gain3                                                                                               */
    /* Gain = 325.269                                                                                                 */
    x2cModel.blocks.sU_f.bGain3.V = 325.2691;

    /* Block: U/f/LookupTable1D1                                                                                      */
    /* TableData = [real 1x129 row vector]                                                                            */
    /* DimX = 129                                                                                                     */
    x2cModel.blocks.sU_f.bLookupTable1D1.Table = &FlashTable_float32[0];
    x2cModel.blocks.sU_f.bLookupTable1D1.dimX = 128;


    /******************************************************************************************************************/
    /**                                              Initialize Inports                                              **/
    /******************************************************************************************************************/
    x2cModel.inports.bInDir = false;
    x2cModel.inports.bInIL1 = (float32)0;
    x2cModel.inports.bInIPB4 = false;
    x2cModel.inports.bInIPB5 = false;
    x2cModel.inports.bInIPB8 = false;
    x2cModel.inports.bInIPB9 = false;
    x2cModel.inports.bInIRAMYOverCurrent = false;
    x2cModel.inports.bInIRAMYOverTemp = false;
    x2cModel.inports.bInIdc = (float32)0;
    x2cModel.inports.bInIph1 = (float32)0;
    x2cModel.inports.bInIph2 = (float32)0;
    x2cModel.inports.bInIph3 = (float32)0;
    x2cModel.inports.bInPot = (float32)0;
    x2cModel.inports.bInVL1 = (float32)0;
    x2cModel.inports.bInVdc = (float32)0;

    /******************************************************************************************************************/
    /**                                               Link Block Inputs                                              **/
    /******************************************************************************************************************/

    /* Block And                                                                                                      */
    x2cModel.blocks.bAnd.In1 =
        &x2cModel.blocks.bNot.Out;
    x2cModel.blocks.bAnd.In2 =
        &x2cModel.inports.bInIPB4;

    /* Block And1                                                                                                     */
    x2cModel.blocks.bAnd1.In1 =
        &x2cModel.blocks.bAnd.Out;
    x2cModel.blocks.bAnd1.In2 =
        &x2cModel.blocks.sToggle.bRSFlipFlop1.Q;

    /* Block Duty_PFC                                                                                                 */

    /* Block Duty_RB                                                                                                  */

    /* Block EnableSwitch                                                                                             */
    x2cModel.blocks.bEnableSwitch.In1 =
        &x2cModel.blocks.bGain2.Out;
    x2cModel.blocks.bEnableSwitch.Enable =
        &x2cModel.inports.bInDir;
    x2cModel.blocks.bEnableSwitch.In3 =
        &x2cModel.inports.bInPot;

    /* Block Enable_PFC                                                                                               */

    /* Block Enable_RB                                                                                                */

    /* Block Gain2                                                                                                    */
    x2cModel.blocks.bGain2.In =
        &x2cModel.inports.bInPot;

    /* Block Gain4                                                                                                    */
    x2cModel.blocks.bGain4.In =
        &x2cModel.blocks.bRateLimiter.Out;

    /* Block Not                                                                                                      */
    x2cModel.blocks.bNot.In =
        &x2cModel.blocks.bRSFlipFlop.Q;

    /* Block Or                                                                                                       */
    x2cModel.blocks.bOr.In1 =
        &x2cModel.inports.bInIRAMYOverCurrent;
    x2cModel.blocks.bOr.In2 =
        &x2cModel.inports.bInIRAMYOverTemp;

    /* Block PT1                                                                                                      */
    x2cModel.blocks.bPT1.In =
        &x2cModel.inports.bInVdc;

    /* Block RG_Enable1                                                                                               */

    /* Block RG_Reload1                                                                                               */

    /* Block RSFlipFlop                                                                                               */
    x2cModel.blocks.bRSFlipFlop.S =
        &x2cModel.blocks.bOr.Out;
    x2cModel.blocks.bRSFlipFlop.R =
        &x2cModel.inports.bInIPB9;

    /* Block RateLimiter                                                                                              */
    x2cModel.blocks.bRateLimiter.In =
        &x2cModel.blocks.bEnableSwitch.Out;
    x2cModel.blocks.bRateLimiter.Init =
        &x2cModel.blocks.bRG_Reload1.Out;
    x2cModel.blocks.bRateLimiter.Enable =
        &x2cModel.blocks.bRG_Enable1.Out;

    /* Block Saturation                                                                                               */
    x2cModel.blocks.bSaturation.In =
        &x2cModel.blocks.bPT1.Out;

    /* Block Saturation1                                                                                              */
    x2cModel.blocks.bSaturation1.In =
        &x2cModel.blocks.sU_f.bDiv.Out;

    /* Block Sin3Gen                                                                                                  */
    x2cModel.blocks.bSin3Gen.A =
        &x2cModel.blocks.bSaturation1.Out;
    x2cModel.blocks.bSin3Gen.f =
        &x2cModel.blocks.bGain4.Out;

    /* Block And2                                                                                                     */
    x2cModel.blocks.sToggle.bAnd2.In1 =
        &x2cModel.blocks.sToggle.bNot1.Out;
    x2cModel.blocks.sToggle.bAnd2.In2 =
        &x2cModel.blocks.sToggle.bAnd4.Out;

    /* Block And3                                                                                                     */
    x2cModel.blocks.sToggle.bAnd3.In1 =
        &x2cModel.blocks.sToggle.bAnd4.Out;
    x2cModel.blocks.sToggle.bAnd3.In2 =
        &x2cModel.blocks.sToggle.bLoopBreaker.Out;

    /* Block And4                                                                                                     */
    x2cModel.blocks.sToggle.bAnd4.In1 =
        &x2cModel.blocks.sToggle.bNot2.Out;
    x2cModel.blocks.sToggle.bAnd4.In2 =
        &x2cModel.inports.bInIPB5;

    /* Block LoopBreaker                                                                                              */
    x2cModel.blocks.sToggle.bLoopBreaker.In =
        &x2cModel.blocks.sToggle.bRSFlipFlop1.Q;

    /* Block LoopBreaker1                                                                                             */
    x2cModel.blocks.sToggle.bLoopBreaker1.In =
        &x2cModel.blocks.sToggle.bRSFlipFlop1.Q;

    /* Block LoopBreaker2                                                                                             */
    x2cModel.blocks.sToggle.bLoopBreaker2.In =
        &x2cModel.blocks.sToggle.bAnd4.Out;

    /* Block Not1                                                                                                     */
    x2cModel.blocks.sToggle.bNot1.In =
        &x2cModel.blocks.sToggle.bLoopBreaker1.Out;

    /* Block Not2                                                                                                     */
    x2cModel.blocks.sToggle.bNot2.In =
        &x2cModel.blocks.sToggle.bLoopBreaker2.Out;

    /* Block RSFlipFlop1                                                                                              */
    x2cModel.blocks.sToggle.bRSFlipFlop1.S =
        &x2cModel.blocks.sToggle.bAnd2.Out;
    x2cModel.blocks.sToggle.bRSFlipFlop1.R =
        &x2cModel.blocks.sToggle.bAnd3.Out;

    /* Block And2                                                                                                     */
    x2cModel.blocks.sToggle1.bAnd2.In1 =
        &x2cModel.blocks.sToggle1.bNot1.Out;
    x2cModel.blocks.sToggle1.bAnd2.In2 =
        &x2cModel.blocks.sToggle1.bAnd4.Out;

    /* Block And3                                                                                                     */
    x2cModel.blocks.sToggle1.bAnd3.In1 =
        &x2cModel.blocks.sToggle1.bAnd4.Out;
    x2cModel.blocks.sToggle1.bAnd3.In2 =
        &x2cModel.blocks.sToggle1.bLoopBreaker.Out;

    /* Block And4                                                                                                     */
    x2cModel.blocks.sToggle1.bAnd4.In1 =
        &x2cModel.blocks.sToggle1.bNot2.Out;
    x2cModel.blocks.sToggle1.bAnd4.In2 =
        &x2cModel.inports.bInIPB8;

    /* Block LoopBreaker                                                                                              */
    x2cModel.blocks.sToggle1.bLoopBreaker.In =
        &x2cModel.blocks.sToggle1.bRSFlipFlop1.Q;

    /* Block LoopBreaker1                                                                                             */
    x2cModel.blocks.sToggle1.bLoopBreaker1.In =
        &x2cModel.blocks.sToggle1.bRSFlipFlop1.Q;

    /* Block LoopBreaker2                                                                                             */
    x2cModel.blocks.sToggle1.bLoopBreaker2.In =
        &x2cModel.blocks.sToggle1.bAnd4.Out;

    /* Block Not1                                                                                                     */
    x2cModel.blocks.sToggle1.bNot1.In =
        &x2cModel.blocks.sToggle1.bLoopBreaker1.Out;

    /* Block Not2                                                                                                     */
    x2cModel.blocks.sToggle1.bNot2.In =
        &x2cModel.blocks.sToggle1.bLoopBreaker2.Out;

    /* Block RSFlipFlop1                                                                                              */
    x2cModel.blocks.sToggle1.bRSFlipFlop1.S =
        &x2cModel.blocks.sToggle1.bAnd2.Out;
    x2cModel.blocks.sToggle1.bRSFlipFlop1.R =
        &x2cModel.blocks.sToggle1.bAnd3.Out;

    /* Block Abs                                                                                                      */
    x2cModel.blocks.sU_f.bAbs.In =
        &x2cModel.blocks.bGain4.Out;

    /* Block Div                                                                                                      */
    x2cModel.blocks.sU_f.bDiv.Num =
        &x2cModel.blocks.sU_f.bGain3.Out;
    x2cModel.blocks.sU_f.bDiv.Den =
        &x2cModel.blocks.bSaturation.Out;

    /* Block Gain3                                                                                                    */
    x2cModel.blocks.sU_f.bGain3.In =
        &x2cModel.blocks.sU_f.bLookupTable1D1.Out;

    /* Block LookupTable1D1                                                                                           */
    x2cModel.blocks.sU_f.bLookupTable1D1.x =
        &x2cModel.blocks.sU_f.bAbs.Out;

    /******************************************************************************************************************/
    /**                                                 Link Outports                                                **/
    /******************************************************************************************************************/
    x2cModel.outports.bOutDir =
        &x2cModel.blocks.sToggle1.bRSFlipFlop1.Q;
    x2cModel.outports.bOutDuty1 =
        &x2cModel.blocks.bSin3Gen.u;
    x2cModel.outports.bOutDuty2 =
        &x2cModel.blocks.bSin3Gen.v;
    x2cModel.outports.bOutDuty3 =
        &x2cModel.blocks.bSin3Gen.w;
    x2cModel.outports.bOutDutyPFC =
        &x2cModel.blocks.bDuty_PFC.Out;
    x2cModel.outports.bOutDutyRB =
        &x2cModel.blocks.bDuty_RB.Out;
    x2cModel.outports.bOutIRAMYEnable =
        &x2cModel.blocks.bAnd1.Out;
    x2cModel.outports.bOutPB7_Green =
        &x2cModel.inports.bInDir;
    x2cModel.outports.bOutPC11_Green =
        &x2cModel.blocks.bAnd1.Out;
    x2cModel.outports.bOutPC6_Red =
        &x2cModel.blocks.bRSFlipFlop.Q;
    x2cModel.outports.bOutPFCEnable =
        &x2cModel.blocks.bEnable_PFC.Out;
    x2cModel.outports.bOutRBEnable =
        &x2cModel.blocks.bEnable_RB.Out;

    /******************************************************************************************************************/
    /**                                           Run Block Init Functions                                           **/
    /******************************************************************************************************************/
    And_Bool_Init(&x2cModel.blocks.bAnd);
    And_Bool_Init(&x2cModel.blocks.bAnd1);
    Constant_Float32_Init(&x2cModel.blocks.bDuty_PFC);
    Constant_Float32_Init(&x2cModel.blocks.bDuty_RB);
    EnableSwitch_Float32_Init(&x2cModel.blocks.bEnableSwitch);
    Constant_Bool_Init(&x2cModel.blocks.bEnable_PFC);
    Constant_Bool_Init(&x2cModel.blocks.bEnable_RB);
    Gain_Float32_Init(&x2cModel.blocks.bGain2);
    Gain_Float32_Init(&x2cModel.blocks.bGain4);
    Not_Bool_Init(&x2cModel.blocks.bNot);
    Or_Bool_Init(&x2cModel.blocks.bOr);
    PT1_Float32_Init(&x2cModel.blocks.bPT1);
    Constant_Bool_Init(&x2cModel.blocks.bRG_Enable1);
    Constant_Float32_Init(&x2cModel.blocks.bRG_Reload1);
    RSFlipFlop_Bool_Init(&x2cModel.blocks.bRSFlipFlop);
    RateLimiter_Float32_Init(&x2cModel.blocks.bRateLimiter);
    Saturation_Float32_Init(&x2cModel.blocks.bSaturation);
    Saturation_Float32_Init(&x2cModel.blocks.bSaturation1);
    Sin3Gen_Float32_Init(&x2cModel.blocks.bSin3Gen);
    And_Bool_Init(&x2cModel.blocks.sToggle.bAnd2);
    And_Bool_Init(&x2cModel.blocks.sToggle.bAnd3);
    And_Bool_Init(&x2cModel.blocks.sToggle.bAnd4);
    LoopBreaker_Bool_Init(&x2cModel.blocks.sToggle.bLoopBreaker);
    LoopBreaker_Bool_Init(&x2cModel.blocks.sToggle.bLoopBreaker1);
    LoopBreaker_Bool_Init(&x2cModel.blocks.sToggle.bLoopBreaker2);
    Not_Bool_Init(&x2cModel.blocks.sToggle.bNot1);
    Not_Bool_Init(&x2cModel.blocks.sToggle.bNot2);
    RSFlipFlop_Bool_Init(&x2cModel.blocks.sToggle.bRSFlipFlop1);
    And_Bool_Init(&x2cModel.blocks.sToggle1.bAnd2);
    And_Bool_Init(&x2cModel.blocks.sToggle1.bAnd3);
    And_Bool_Init(&x2cModel.blocks.sToggle1.bAnd4);
    LoopBreaker_Bool_Init(&x2cModel.blocks.sToggle1.bLoopBreaker);
    LoopBreaker_Bool_Init(&x2cModel.blocks.sToggle1.bLoopBreaker1);
    LoopBreaker_Bool_Init(&x2cModel.blocks.sToggle1.bLoopBreaker2);
    Not_Bool_Init(&x2cModel.blocks.sToggle1.bNot1);
    Not_Bool_Init(&x2cModel.blocks.sToggle1.bNot2);
    RSFlipFlop_Bool_Init(&x2cModel.blocks.sToggle1.bRSFlipFlop1);
    Abs_Float32_Init(&x2cModel.blocks.sU_f.bAbs);
    Div_Float32_Init(&x2cModel.blocks.sU_f.bDiv);
    Gain_Float32_Init(&x2cModel.blocks.sU_f.bGain3);
    LookupTable1D_Float32_Init(&x2cModel.blocks.sU_f.bLookupTable1D1);
    Scope_Main_Init(&x2cScope);

    /* Initialize Mask parameter structures                                                                           */

    /* Initialize Implementation parameters of Conversion-on-Target blocks                                            */

    /* Initialize TableStruct tables                                                                                  */
    TableStruct->TFncTable = blockFunctionTable;
    TableStruct->TParamTable = parameterIdTable;
    TableStruct->inportParamTable = inportParamIdTable;
    TableStruct->outportParamTable = outportParamIdTable;
    TableStruct->maskParameterTable = maskParamIdTable;
}

/**********************************************************************************************************************/
/**                                            Run Block Update Functions                                            **/
/**********************************************************************************************************************/

/* X2C_Update for blocks with 1*Ts                                                                                    */
void X2C_Update_1(void)
{
    Gain_Float32_Update(&x2cModel.blocks.bGain2);
    EnableSwitch_Float32_Update(&x2cModel.blocks.bEnableSwitch);
    RateLimiter_Float32_Update(&x2cModel.blocks.bRateLimiter);
    Gain_Float32_Update(&x2cModel.blocks.bGain4);
    Abs_Float32_Update(&x2cModel.blocks.sU_f.bAbs);
    PT1_Float32_Update(&x2cModel.blocks.bPT1);
    LookupTable1D_Float32_Update(&x2cModel.blocks.sU_f.bLookupTable1D1);
    Saturation_Float32_Update(&x2cModel.blocks.bSaturation);
    Gain_Float32_Update(&x2cModel.blocks.sU_f.bGain3);
    Div_Float32_Update(&x2cModel.blocks.sU_f.bDiv);
    Saturation_Float32_Update(&x2cModel.blocks.bSaturation1);
    Sin3Gen_Float32_Update(&x2cModel.blocks.bSin3Gen);
    Scope_Main_Update(&x2cScope);
}

/* X2C_Update for blocks with 100*Ts                                                                                  */
void X2C_Update_100(void)
{
    LoopBreaker_Bool_Update(&x2cModel.blocks.sToggle.bLoopBreaker);
    LoopBreaker_Bool_Update(&x2cModel.blocks.sToggle.bLoopBreaker1);
    LoopBreaker_Bool_Update(&x2cModel.blocks.sToggle.bLoopBreaker2);
    LoopBreaker_Bool_Update(&x2cModel.blocks.sToggle1.bLoopBreaker);
    LoopBreaker_Bool_Update(&x2cModel.blocks.sToggle1.bLoopBreaker1);
    LoopBreaker_Bool_Update(&x2cModel.blocks.sToggle1.bLoopBreaker2);
    Or_Bool_Update(&x2cModel.blocks.bOr);
    RSFlipFlop_Bool_Update(&x2cModel.blocks.bRSFlipFlop);
    Not_Bool_Update(&x2cModel.blocks.sToggle.bNot2);
    Not_Bool_Update(&x2cModel.blocks.sToggle1.bNot2);
    Not_Bool_Update(&x2cModel.blocks.bNot);
    And_Bool_Update(&x2cModel.blocks.sToggle.bAnd4);
    Not_Bool_Update(&x2cModel.blocks.sToggle.bNot1);
    And_Bool_Update(&x2cModel.blocks.sToggle1.bAnd4);
    Not_Bool_Update(&x2cModel.blocks.sToggle1.bNot1);
    And_Bool_Update(&x2cModel.blocks.bAnd);
    And_Bool_Update(&x2cModel.blocks.sToggle.bAnd2);
    And_Bool_Update(&x2cModel.blocks.sToggle1.bAnd2);
    And_Bool_Update(&x2cModel.blocks.sToggle.bAnd3);
    And_Bool_Update(&x2cModel.blocks.sToggle1.bAnd3);
    RSFlipFlop_Bool_Update(&x2cModel.blocks.sToggle.bRSFlipFlop1);
    RSFlipFlop_Bool_Update(&x2cModel.blocks.sToggle1.bRSFlipFlop1);
    And_Bool_Update(&x2cModel.blocks.bAnd1);
}

