/*
 * File: P417_SWTR_App.c
 *
 * Code generated for Simulink model 'P417_SWTR_App'.
 *
 * Model version                  : 1.150
 * Simulink Coder version         : 8.13 (R2017b) 24-Jul-2017
 * C/C++ source code generated on : Thu Dec 15 23:34:40 2022
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: Intel->x86-64 (Windows64)
 * Code generation objectives: Unspecified
 * Validation result: Not run
 */

#include "P417_SWTR_App.h"
#include "P417_SWTR_App_private.h"

/* Block signals (auto storage) */
B_P417_SWTR_App_T P417_SWTR_App_B;

/* Block states (auto storage) */
DW_P417_SWTR_App_T P417_SWTR_App_DW;

/* Real-time model */
RT_MODEL_P417_SWTR_App_T P417_SWTR_App_M_;
RT_MODEL_P417_SWTR_App_T *const P417_SWTR_App_M = &P417_SWTR_App_M_;

/* Model step function */
void P417_SWTR_App_step(void)
{
  uint8_T Switch;
  uint8_T Switch_p;
  uint8_T tmp;

  /* S-Function (fcncallgen): '<Root>/Function-Call Generator' incorporates:
   *  Chart: '<Root>/Task Scheduler'
   */
  /* Chart: '<Root>/Task Scheduler' incorporates:
   *  Inport: '<Root>/In1'
   *  Inport: '<Root>/In10'
   *  Inport: '<Root>/In11'
   *  Inport: '<Root>/In12'
   *  Inport: '<Root>/In13'
   *  Inport: '<Root>/In14'
   *  Inport: '<Root>/In15'
   *  Inport: '<Root>/In17'
   *  Inport: '<Root>/In18'
   *  Inport: '<Root>/In19'
   *  Inport: '<Root>/In20'
   *  Inport: '<Root>/In21'
   *  Inport: '<Root>/In22'
   *  Inport: '<Root>/In23'
   *  Inport: '<Root>/In24'
   *  Inport: '<Root>/In3'
   *  Inport: '<Root>/In4'
   *  Inport: '<Root>/In5'
   *  Inport: '<Root>/In6'
   *  Inport: '<Root>/In7'
   *  Inport: '<Root>/In8'
   *  Inport: '<Root>/In9'
   *  Switch: '<S13>/Switch1'
   */
  if (P417_SWTR_App_DW.temporalCounter_i1 < 4) {
    P417_SWTR_App_DW.temporalCounter_i1++;
  }

  if (P417_SWTR_App_DW.temporalCounter_i2 < 10) {
    P417_SWTR_App_DW.temporalCounter_i2++;
  }

  if (P417_SWTR_App_DW.temporalCounter_i3 < 20) {
    P417_SWTR_App_DW.temporalCounter_i3++;
  }

  if (P417_SWTR_App_DW.temporalCounter_i4 < 25) {
    P417_SWTR_App_DW.temporalCounter_i4++;
  }

  if (P417_SWTR_App_DW.temporalCounter_i5 < 1000) {
    P417_SWTR_App_DW.temporalCounter_i5++;
  }

  if (P417_SWTR_App_DW.temporalCounter_i1 == 4) {
    /* Outputs for Function Call SubSystem: '<S2>/TouchBoard_up_handle_4ms' */
    P417_S_TouchBoard_up_handle_4ms(RTE_Get_TouchBoard_Up_Sts(),
      &P417_SWTR_App_B.output_c, &P417_SWTR_App_DW.TouchBoard_up_handle_4ms);

    /* End of Outputs for SubSystem: '<S2>/TouchBoard_up_handle_4ms' */

    /* Outputs for Function Call SubSystem: '<S2>/TouchBoard_Down_handle_4ms' */
    P417_TouchBoard_Down_handle_4ms(RTE_Get_TouchBoard_Down_Sts(),
      &P417_SWTR_App_B.output_p, &P417_SWTR_App_DW.TouchBoard_Down_handle_4ms);

    /* End of Outputs for SubSystem: '<S2>/TouchBoard_Down_handle_4ms' */

    /* Outputs for Function Call SubSystem: '<S2>/TouchBoard_Left_handle_4ms' */
    P417_TouchBoard_Left_handle_4ms(RTE_Get_TouchBoard_Left_Sts(),
      &P417_SWTR_App_B.output_np, &P417_SWTR_App_DW.TouchBoard_Left_handle_4ms);

    /* End of Outputs for SubSystem: '<S2>/TouchBoard_Left_handle_4ms' */

    /* Outputs for Function Call SubSystem: '<S2>/TouchBoard_Right_handle_4ms' */
    P41_TouchBoard_Right_handle_4ms(RTE_Get_TouchBoard_Right_Sts(),
      &P417_SWTR_App_B.output_fx, &P417_SWTR_App_DW.TouchBoard_Right_handle_4ms);

    /* End of Outputs for SubSystem: '<S2>/TouchBoard_Right_handle_4ms' */

    /* Outputs for Function Call SubSystem: '<S2>/TouchBoard_Center_handle_4ms' */
    P4_TouchBoard_Center_handle_4ms(RTE_Get_TouchBoard_Center_Sts(),
      &P417_SWTR_App_B.output_ju, &P417_SWTR_App_DW.TouchBoard_Center_handle_4ms);

    /* End of Outputs for SubSystem: '<S2>/TouchBoard_Center_handle_4ms' */

    /* Outputs for Function Call SubSystem: '<S2>/TouchBoard_VOICE_handle_4ms' */
    P41_TouchBoard_VOICE_handle_4ms(RTE_Get_TouchBoard_VOICE1_Sts(),
      RTE_Get_Voice_XY_trig(), &P417_SWTR_App_B.output_g,
      &P417_SWTR_App_B.output_i, &P417_SWTR_App_DW.TouchBoard_VOICE_handle_4ms);

    /* End of Outputs for SubSystem: '<S2>/TouchBoard_VOICE_handle_4ms' */

    /* Outputs for Function Call SubSystem: '<S2>/TouchBoard_MENU_handle_4ms' */
    P417_TouchBoard_MENU_handle_4ms(RTE_Get_TouchBoard_MENU1_Sts(),
      RTE_Get_Menu_XY_trig(), &P417_SWTR_App_B.output_o2,
      &P417_SWTR_App_B.output_m, &P417_SWTR_App_DW.TouchBoard_MENU_handle_4ms);

    /* End of Outputs for SubSystem: '<S2>/TouchBoard_MENU_handle_4ms' */

    /* Outputs for Function Call SubSystem: '<S2>/TouchBoard_VOL_handle_4ms' */
    P417__TouchBoard_VOL_handle_4ms(RTE_Get_TouchBoard_VOL1_Sts(),
      RTE_Get_Vol_XY_trig(), RTE_Get_Pad_XY_trig(), &P417_SWTR_App_B.output_fp,
      &P417_SWTR_App_B.output_n, &P417_SWTR_App_B.output_a,
      &P417_SWTR_App_DW.TouchBoard_VOL_handle_4ms);

    /* End of Outputs for SubSystem: '<S2>/TouchBoard_VOL_handle_4ms' */

    /* Outputs for Function Call SubSystem: '<S2>/TouchBoard_Left_Right_Slide_handle_4ms' */
    TouchBoard_Left_Right_Slide_han(RTE_Get_TouchBoard_Left_Right_Slide_Sts(),
      &P417_SWTR_App_B.output_j,
      &P417_SWTR_App_DW.TouchBoard_Left_Right_Slide_h_a);

    /* End of Outputs for SubSystem: '<S2>/TouchBoard_Left_Right_Slide_handle_4ms' */

    /* Outputs for Function Call SubSystem: '<S2>/TouchBoard_Up_Down_Slide_handle_4ms' */
    TouchBoard_Up_Down_Slide_handle(RTE_Get_TouchBoard_Up_Down_Slide_Sts(),
      RTE_Get_SldVolCtrlSts(), &P417_SWTR_App_B.output_o,
      &P417_SWTR_App_B.output_f,
      &P417_SWTR_App_DW.TouchBoard_Up_Down_Slide_hand_p);

    /* End of Outputs for SubSystem: '<S2>/TouchBoard_Up_Down_Slide_handle_4ms' */

    /* Outputs for Function Call SubSystem: '<S2>/TouchBoardXY_handle_4ms' */
    P417_SW_TouchBoardXY_handle_4ms(RTE_Get_TouchBoard_XY_Sts(),
      P417_SWTR_App_B.output_g, P417_SWTR_App_B.output_fp,
      P417_SWTR_App_B.output_o2, RTE_Get_TouchBoard_XY_Touch_And_Below_1N(),
      &P417_SWTR_App_B.MultiportSwitch, &P417_SWTR_App_B.output,
      &P417_SWTR_App_B.TouchBoardXY_handle_4ms,
      &P417_SWTR_App_DW.TouchBoardXY_handle_4ms);

    /* End of Outputs for SubSystem: '<S2>/TouchBoardXY_handle_4ms' */

    /* Outputs for Function Call SubSystem: '<S2>/TouchBoard_0x307_Send_And_ACT_Req_4ms' */
    TouchBoard_0x307_Send_And_ACT_R(P417_SWTR_App_B.output_c,
      P417_SWTR_App_B.output_p, P417_SWTR_App_B.output_np,
      P417_SWTR_App_B.output_fx, P417_SWTR_App_B.output_ju,
      P417_SWTR_App_B.output_o, P417_SWTR_App_B.output_j,
      P417_SWTR_App_B.output_o2, P417_SWTR_App_B.output_g,
      P417_SWTR_App_B.output_fp, &P417_SWTR_App_B.DataTypeConversion);

    /* End of Outputs for SubSystem: '<S2>/TouchBoard_0x307_Send_And_ACT_Req_4ms' */
  }

  if (P417_SWTR_App_DW.temporalCounter_i2 == 10) {
    /* Outputs for Function Call SubSystem: '<S2>/illumination_control_10ms' */
    P417__illumination_control_10ms(RTE_Get_CAN_ActvnOfSteerWhlIllmn(),
      RTE_Get_CAN_IhuPrivateDHUCanFr01_Frame_Timeout(), &Switch_p,
      &P417_SWTR_App_B.illumination_control_10ms,
      &P417_SWTR_App_DW.illumination_control_10ms);

    /* End of Outputs for SubSystem: '<S2>/illumination_control_10ms' */

    /* Outputs for Function Call SubSystem: '<S2>/Day_Night_handle_10ms' */

    /* Chart: '<S31>/Fault_Debounce_Chart' incorporates:
     *  Inport: '<Root>/In1'
     *  Inport: '<Root>/In3'
     */
    P417_SWTR__Fault_Debounce_Chart
      (RTE_Get_CAN_IhuPrivateDHUCanFr01_Frame_Timeout(),
       &P417_SWTR_App_B.Fault_confirmed_i,
       &P417_SWTR_App_DW.sf_Fault_Debounce_Chart, 3U, 3U);

    /* End of Outputs for SubSystem: '<S2>/Day_Night_handle_10ms' */

    /* Outputs for Function Call SubSystem: '<S2>/IntrBriSts_handle_10ms' */
    /* Chart: '<S33>/Fault_Debounce_Chart' incorporates:
     *  Inport: '<Root>/In3'
     */
    P417_SWTR__Fault_Debounce_Chart
      (RTE_Get_CAN_IhuPrivateDHUCanFr01_Frame_Timeout(),
       &P417_SWTR_App_B.Fault_confirmed,
       &P417_SWTR_App_DW.sf_Fault_Debounce_Chart_d, 3U, 3U);

    /* Switch: '<S14>/Switch' incorporates:
     *  Inport: '<Root>/In16'
     *  UnitDelay: '<S14>/Unit Delay'
     */
    if (P417_SWTR_App_B.Fault_confirmed > 0) {
      Switch = P417_SWTR_App_DW.UnitDelay_DSTATE;
    } else {
      Switch = RTE_Get_CAN_IntrBriSts();
    }

    /* End of Switch: '<S14>/Switch' */

    /* Update for UnitDelay: '<S14>/Unit Delay' */
    P417_SWTR_App_DW.UnitDelay_DSTATE = Switch;

    /* End of Outputs for SubSystem: '<S2>/IntrBriSts_handle_10ms' */

    /* Outputs for Function Call SubSystem: '<S2>/TouchBoard_X_handle_10ms' */
    P417_S_TouchBoard_X_handle_10ms(RTE_Get_X_SNS(), P417_SWTR_App_B.output_a,
      P417_SWTR_App_B.output_i, P417_SWTR_App_B.output_n,
      P417_SWTR_App_B.output_m, &P417_SWTR_App_B.TouchBoard_X_handle_10ms);

    /* End of Outputs for SubSystem: '<S2>/TouchBoard_X_handle_10ms' */

    /* Outputs for Function Call SubSystem: '<S2>/TouchBoard_Y_handle_10ms' */
    P417_S_TouchBoard_Y_handle_10ms(RTE_Get_Y_SNS(), P417_SWTR_App_B.output_a,
      P417_SWTR_App_B.output_i, P417_SWTR_App_B.output_n,
      P417_SWTR_App_B.output_m, &P417_SWTR_App_B.TouchBoard_Y_handle_10ms);

    /* End of Outputs for SubSystem: '<S2>/TouchBoard_Y_handle_10ms' */

    /* Outputs for Function Call SubSystem: '<S2>/Day_Night_handle_10ms' */
    /* Switch: '<S13>/Switch' incorporates:
     *  Constant: '<S13>/ Default'
     *  Inport: '<Root>/In14'
     *  Inport: '<Root>/In15'
     *  Inport: '<Root>/In2'
     */
    if (P417_SWTR_App_B.Fault_confirmed_i > 0) {
      tmp = 0U;
    } else {
      tmp = RTE_Get_CAN_TwliBriSts();
    }

    /* End of Switch: '<S13>/Switch' */

    /* Outputs for Function Call SubSystem: '<S1>/LED_Control_10ms' */
    P417_SWTR_App_LED_Control_10ms(Switch_p, (uint8_T)(tmp > 0), Switch,
      &P417_SWTR_App_DW.LED_Control_10ms);

    /* End of Outputs for SubSystem: '<S1>/LED_Control_10ms' */

    /* End of Outputs for SubSystem: '<S2>/Day_Night_handle_10ms' */

    /* Outputs for Function Call SubSystem: '<S1>/Set_0x309_RC_10ms' */
    P417_SWTR_App_Set_0x309_RC_10ms(P417_SWTR_App_B.Gain1);

    /* End of Outputs for SubSystem: '<S1>/Set_0x309_RC_10ms' */

    /* Outputs for Function Call SubSystem: '<S1>/Get_0x309_CRC_10ms' */
    P417_SWTR_Ap_Get_0x309_CRC_10ms(RTE_Get_TouchBoard_CRC());

    /* End of Outputs for SubSystem: '<S1>/Get_0x309_CRC_10ms' */

    /* Outputs for Function Call SubSystem: '<S2>/TouchBoard_0x309_Send_And_ACT_Req_10ms' */
    TouchBoard_0x309_Send_And_ACT_R(P417_SWTR_App_B.output,
      &P417_SWTR_App_B.DataTypeConversion_g, &P417_SWTR_App_B.Gain1);

    /* End of Outputs for SubSystem: '<S2>/TouchBoard_0x309_Send_And_ACT_Req_10ms' */
  }

  if (P417_SWTR_App_DW.temporalCounter_i3 == 20) {
    /* Outputs for Function Call SubSystem: '<S1>/Set_Diag_20ms' */
    P417_SWTR_App_Set_Diag_20ms(&P417_SWTR_App_ConstB.Set_Diag_20ms);

    /* End of Outputs for SubSystem: '<S1>/Set_Diag_20ms' */

    /* Outputs for Function Call SubSystem: '<S1>/ACT_control_20ms' */
    P417_SWTR_App_ACT_control_20ms(P417_SWTR_App_B.DataTypeConversion,
      P417_SWTR_App_B.DataTypeConversion_g);

    /* End of Outputs for SubSystem: '<S1>/ACT_control_20ms' */
  }

  if (P417_SWTR_App_DW.temporalCounter_i4 == 25) {
    /* Outputs for Function Call SubSystem: '<S1>/CAN_0x307_25ms_Control' */
    P417_SWT_CAN_0x307_25ms_Control(P417_SWTR_App_B.DataTypeConversion);

    /* End of Outputs for SubSystem: '<S1>/CAN_0x307_25ms_Control' */
  }

  if (P417_SWTR_App_DW.temporalCounter_i5 == 1000) {
    /* Outputs for Function Call SubSystem: '<S1>/CAN_0x307_1000ms_Control' */
    P417_S_CAN_0x307_1000ms_Control(P417_SWTR_App_B.DataTypeConversion);

    /* End of Outputs for SubSystem: '<S1>/CAN_0x307_1000ms_Control' */
  }

  if (P417_SWTR_App_DW.temporalCounter_i1 == 4) {
    P417_SWTR_App_DW.temporalCounter_i1 = 0U;
  }

  if (P417_SWTR_App_DW.temporalCounter_i2 == 10) {
    P417_SWTR_App_DW.temporalCounter_i2 = 0U;
  }

  if (P417_SWTR_App_DW.temporalCounter_i3 == 20) {
    P417_SWTR_App_DW.temporalCounter_i3 = 0U;
  }

  if (P417_SWTR_App_DW.temporalCounter_i4 == 25) {
    P417_SWTR_App_DW.temporalCounter_i4 = 0U;
  }

  if (P417_SWTR_App_DW.temporalCounter_i5 == 1000) {
    P417_SWTR_App_DW.temporalCounter_i5 = 0U;
  }

  /* End of Chart: '<Root>/Task Scheduler' */
  /* End of Outputs for S-Function (fcncallgen): '<Root>/Function-Call Generator' */

  /* Gain: '<S2>/Gain4' */
  RTE_Set_CAN_RiMFctActSgCe(P417_SWTR_App_B.output_ju);

  /* Gain: '<S2>/Gain1' */
  RTE_Set_CAN_RiMFctActSgDn(P417_SWTR_App_B.output_p);

  /* Gain: '<S2>/Gain2' */
  RTE_Set_CAN_RiMFctActSgLe(P417_SWTR_App_B.output_np);

  /* Gain: '<S2>/Gain3' */
  RTE_Set_CAN_RiMFctActSgRi(P417_SWTR_App_B.output_fx);

  /* Gain: '<S2>/Gain' */
  RTE_Set_CAN_RiMFctActSgUp(P417_SWTR_App_B.output_c);

  /* Gain: '<S2>/Gain5' */
  RTE_Set_CAN_SteerWhlTouchBdVoice(P417_SWTR_App_B.output_g);

  /* Gain: '<S2>/Gain9' */
  RTE_Set_CAN_SwpLeRiStsRi(P417_SWTR_App_B.output_j);

  /* Gain: '<S2>/Gain8' */
  RTE_Set_CAN_SwpUpDwnStsRi(P417_SWTR_App_B.output_o);

  /* Gain: '<S2>/Gain6' */
  RTE_Set_CAN_SteerWhlTouchBdMenu(P417_SWTR_App_B.output_o2);

  /* Gain: '<S2>/Gain7' */
  RTE_Set_CAN_SteerWhlTouchBdDn(P417_SWTR_App_B.output_fp);

  /* Gain: '<S2>/Gain10' */
  RTE_Set_CAN_SteerWhlTouchBdRiSteerWhlTouchBdSts
    (P417_SWTR_App_B.MultiportSwitch);

  /* Gain: '<S2>/Gain11' */
  RTE_Set_CAN_SldVolCtrlSts(P417_SWTR_App_B.output_f);
}

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

  /* initialize error status */
  rtmSetErrorStatus(P417_SWTR_App_M, (NULL));

  /* block I/O */
  (void) memset(((void *) &P417_SWTR_App_B), 0,
                sizeof(B_P417_SWTR_App_T));

  /* states (dwork) */
  (void) memset((void *)&P417_SWTR_App_DW, 0,
                sizeof(DW_P417_SWTR_App_T));

  /* SystemInitialize for S-Function (fcncallgen): '<Root>/Function-Call Generator' incorporates:
   *  Chart: '<Root>/Task Scheduler'
   */
  /* Chart: '<Root>/Task Scheduler' */
  /* Chart: '<Root>/Task Scheduler' */
  P417_SWTR_App_DW.temporalCounter_i1 = 0U;
  P417_SWTR_App_DW.temporalCounter_i2 = 0U;
  P417_SWTR_App_DW.temporalCounter_i3 = 0U;
  P417_SWTR_App_DW.temporalCounter_i4 = 0U;
  P417_SWTR_App_DW.temporalCounter_i5 = 0U;

  /* SystemInitialize for Chart: '<Root>/Task Scheduler' incorporates:
   *  SubSystem: '<S2>/illumination_control_10ms'
   */
  illumination_control_10ms_Init(&P417_SWTR_App_B.illumination_control_10ms,
    &P417_SWTR_App_DW.illumination_control_10ms);

  /* SystemInitialize for Chart: '<Root>/Task Scheduler' incorporates:
   *  SubSystem: '<S2>/Day_Night_handle_10ms'
   */
  /* SystemInitialize for Chart: '<S31>/Fault_Debounce_Chart' */
  P417__Fault_Debounce_Chart_Init(&P417_SWTR_App_B.Fault_confirmed_i,
    &P417_SWTR_App_DW.sf_Fault_Debounce_Chart);

  /* SystemInitialize for Chart: '<Root>/Task Scheduler' incorporates:
   *  SubSystem: '<S2>/IntrBriSts_handle_10ms'
   */
  /* SystemInitialize for Chart: '<S33>/Fault_Debounce_Chart' */
  P417__Fault_Debounce_Chart_Init(&P417_SWTR_App_B.Fault_confirmed,
    &P417_SWTR_App_DW.sf_Fault_Debounce_Chart_d);

  /* SystemInitialize for Chart: '<Root>/Task Scheduler' incorporates:
   *  SubSystem: '<S2>/TouchBoard_X_handle_10ms'
   */
  P_TouchBoard_X_handle_10ms_Init(&P417_SWTR_App_B.TouchBoard_X_handle_10ms);

  /* SystemInitialize for Chart: '<Root>/Task Scheduler' incorporates:
   *  SubSystem: '<S2>/TouchBoard_Y_handle_10ms'
   */
  P_TouchBoard_Y_handle_10ms_Init(&P417_SWTR_App_B.TouchBoard_Y_handle_10ms);

  /* SystemInitialize for Chart: '<Root>/Task Scheduler' incorporates:
   *  SubSystem: '<S1>/Set_Diag_20ms'
   */
  P417_SWTR_Ap_Set_Diag_20ms_Init(&P417_SWTR_App_ConstB.Set_Diag_20ms);

  /* SystemInitialize for Chart: '<Root>/Task Scheduler' incorporates:
   *  SubSystem: '<S2>/TouchBoard_up_handle_4ms'
   */
  P_TouchBoard_up_handle_4ms_Init(&P417_SWTR_App_B.output_c,
    &P417_SWTR_App_DW.TouchBoard_up_handle_4ms);

  /* SystemInitialize for Chart: '<Root>/Task Scheduler' incorporates:
   *  SubSystem: '<S2>/TouchBoard_Down_handle_4ms'
   */
  TouchBoard_Down_handle_4ms_Init(&P417_SWTR_App_B.output_p,
    &P417_SWTR_App_DW.TouchBoard_Down_handle_4ms);

  /* SystemInitialize for Chart: '<Root>/Task Scheduler' incorporates:
   *  SubSystem: '<S2>/TouchBoard_Left_handle_4ms'
   */
  TouchBoard_Left_handle_4ms_Init(&P417_SWTR_App_B.output_np,
    &P417_SWTR_App_DW.TouchBoard_Left_handle_4ms);

  /* SystemInitialize for Chart: '<Root>/Task Scheduler' incorporates:
   *  SubSystem: '<S2>/TouchBoard_Right_handle_4ms'
   */
  TouchBoard_Right_handle_4m_Init(&P417_SWTR_App_B.output_fx,
    &P417_SWTR_App_DW.TouchBoard_Right_handle_4ms);

  /* SystemInitialize for Chart: '<Root>/Task Scheduler' incorporates:
   *  SubSystem: '<S2>/TouchBoard_Center_handle_4ms'
   */
  TouchBoard_Center_handle_4_Init(&P417_SWTR_App_B.output_ju,
    &P417_SWTR_App_DW.TouchBoard_Center_handle_4ms);

  /* SystemInitialize for Chart: '<Root>/Task Scheduler' incorporates:
   *  SubSystem: '<S2>/TouchBoard_VOICE_handle_4ms'
   */
  TouchBoard_VOICE_handle_4m_Init(&P417_SWTR_App_B.output_g,
    &P417_SWTR_App_B.output_i, &P417_SWTR_App_DW.TouchBoard_VOICE_handle_4ms);

  /* SystemInitialize for Chart: '<Root>/Task Scheduler' incorporates:
   *  SubSystem: '<S2>/TouchBoard_MENU_handle_4ms'
   */
  TouchBoard_MENU_handle_4ms_Init(&P417_SWTR_App_B.output_o2,
    &P417_SWTR_App_B.output_m, &P417_SWTR_App_DW.TouchBoard_MENU_handle_4ms);

  /* SystemInitialize for Chart: '<Root>/Task Scheduler' incorporates:
   *  SubSystem: '<S2>/TouchBoard_VOL_handle_4ms'
   */
  TouchBoard_VOL_handle_4ms_Init(&P417_SWTR_App_B.output_fp,
    &P417_SWTR_App_B.output_n, &P417_SWTR_App_B.output_a,
    &P417_SWTR_App_DW.TouchBoard_VOL_handle_4ms);

  /* SystemInitialize for Chart: '<Root>/Task Scheduler' incorporates:
   *  SubSystem: '<S2>/TouchBoard_Left_Right_Slide_handle_4ms'
   */
  TouchBoard_Left_Right_Slid_Init(&P417_SWTR_App_B.output_j,
    &P417_SWTR_App_DW.TouchBoard_Left_Right_Slide_h_a);

  /* SystemInitialize for Chart: '<Root>/Task Scheduler' incorporates:
   *  SubSystem: '<S2>/TouchBoard_Up_Down_Slide_handle_4ms'
   */
  TouchBoard_Up_Down_Slide_h_Init(&P417_SWTR_App_B.output_o,
    &P417_SWTR_App_B.output_f, &P417_SWTR_App_DW.TouchBoard_Up_Down_Slide_hand_p);

  /* SystemInitialize for Chart: '<Root>/Task Scheduler' incorporates:
   *  SubSystem: '<S2>/TouchBoardXY_handle_4ms'
   */
  P4_TouchBoardXY_handle_4ms_Init(&P417_SWTR_App_B.output,
    &P417_SWTR_App_B.TouchBoardXY_handle_4ms,
    &P417_SWTR_App_DW.TouchBoardXY_handle_4ms);

  /* End of SystemInitialize for S-Function (fcncallgen): '<Root>/Function-Call Generator' */
}

/* Model terminate function */
void P417_SWTR_App_terminate(void)
{
  /* (no terminate code required) */
}

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