/*
 * File: TouchBoard_Y_handle_4ms.c
 *
 * Code generated for Simulink model 'P417_SWTL_App'.
 *
 * Model version                  : 1.156
 * Simulink Coder version         : 8.13 (R2017b) 24-Jul-2017
 * C/C++ source code generated on : Sun Jun 25 21:44:44 2023
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: Intel->x86-64 (Windows64)
 * Code generation objectives: Unspecified
 * Validation result: Not run
 */

#include "TouchBoard_Y_handle_4ms.h"

/* Include model header file for global data */
#include "P417_SWTL_App.h"
#include "P417_SWTL_App_private.h"

/* System initialize for function-call system: '<S2>/TouchBoard_Y_handle_4ms' */
void P4_TouchBoard_Y_handle_4ms_Init(B_TouchBoard_Y_handle_4ms_P41_T *localB)
{
  /* SystemInitialize for Atomic SubSystem: '<S32>/Subsyste_selY' */
  P417_SWTL_A_Subsystem_selX_Init(&localB->Slect);

  /* End of SystemInitialize for SubSystem: '<S32>/Subsyste_selY' */
}

/* Output and update for function-call system: '<S2>/TouchBoard_Y_handle_4ms' */
void P417_SW_TouchBoard_Y_handle_4ms(uint8_T rtu_Up_Trigg_afhd_in, uint8_T
  rtu_Down_Trigg_afhd_in, uint8_T rtu_Left_Trigg_afhd_in, uint8_T
  rtu_Right_Trigg_afhd_in, uint8_T rtu_Center_Trigg_afhd_in,
  B_TouchBoard_Y_handle_4ms_P41_T *localB, const ConstB_TouchBoard_Y_handle_4m_T
  *localC)
{
  /* Outputs for Atomic SubSystem: '<S32>/Subsyste_selY' */

  /* RelationalOperator: '<S66>/Compare' incorporates:
   *  Constant: '<S66>/Constant'
   *  Constant: '<S67>/Constant'
   *  Constant: '<S68>/Constant'
   *  Constant: '<S69>/Constant'
   *  Constant: '<S70>/Constant'
   *  RelationalOperator: '<S67>/Compare'
   *  RelationalOperator: '<S68>/Compare'
   *  RelationalOperator: '<S69>/Compare'
   *  RelationalOperator: '<S70>/Compare'
   */
  P417_SWTL_App_Subsystem_selX(localC->Compare, localC->Compare_b,
    localC->Compare_a, localC->Compare_i, (uint8_T)(rtu_Up_Trigg_afhd_in > 0),
    (uint8_T)(rtu_Down_Trigg_afhd_in > 0), (uint8_T)(rtu_Left_Trigg_afhd_in > 0),
    (uint8_T)(rtu_Right_Trigg_afhd_in > 0), (uint8_T)(rtu_Center_Trigg_afhd_in >
    0), &localB->Slect);

  /* End of Outputs for SubSystem: '<S32>/Subsyste_selY' */

  /* MultiPortSwitch: '<S32>/Multiport Switch' incorporates:
   *  Constant: '<S32>/Constant'
   *  Constant: '<S32>/Constant1'
   *  Constant: '<S32>/Constant12'
   *  Constant: '<S32>/Constant2'
   *  Constant: '<S32>/Constant3'
   *  Constant: '<S32>/Constant4'
   *  Constant: '<S32>/Constant5'
   *  Constant: '<S32>/Constant6'
   *  Constant: '<S32>/Constant7'
   */
  switch (localB->Slect) {
   case 1:
    RTE_Set_CAN_SteerWhlTouchBdLeTouchPosnY(0U);
    break;

   case 2:
    RTE_Set_CAN_SteerWhlTouchBdLeTouchPosnY(41U);
    break;

   case 3:
    RTE_Set_CAN_SteerWhlTouchBdLeTouchPosnY(125U);
    break;

   case 4:
    RTE_Set_CAN_SteerWhlTouchBdLeTouchPosnY(210U);
    break;

   case 5:
    RTE_Set_CAN_SteerWhlTouchBdLeTouchPosnY(55U);
    break;

   case 6:
    RTE_Set_CAN_SteerWhlTouchBdLeTouchPosnY(203U);
    break;

   case 7:
    RTE_Set_CAN_SteerWhlTouchBdLeTouchPosnY(130U);
    break;

   case 8:
    RTE_Set_CAN_SteerWhlTouchBdLeTouchPosnY(130U);
    break;

   case 9:
    RTE_Set_CAN_SteerWhlTouchBdLeTouchPosnY(130U);
    break;
  }

  /* End of MultiPortSwitch: '<S32>/Multiport Switch' */
}

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