/*
 * File: LED_Control_10ms.c
 *
 * Code generated for Simulink model 'P417_SWTL_App'.
 *
 * Model version                  : 1.148
 * Simulink Coder version         : 8.13 (R2017b) 24-Jul-2017
 * C/C++ source code generated on : Tue Dec 20 16:43:44 2022
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: Intel->x86-64 (Windows64)
 * Code generation objectives: Unspecified
 * Validation result: Not run
 */

#include "LED_Control_10ms.h"

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

/* Output and update for function-call system: '<S1>/LED_Control_10ms' */
void P417_SWTL_App_LED_Control_10ms(uint8_T rtu_ActvnOfSteerWhlIllmn_after_,
  uint8_T rtu_Day1_Night0_Mode_after_hand, uint8_T rtu_IntrBriSts_after_handle,
  DW_LED_Control_10ms_P417_SWTL_T *localDW)
{
  uint32_T rtb_NightSwitch;

  /* MultiPortSwitch: '<S12>/Night Switch' incorporates:
   *  Constant: '<S12>/Constant'
   *  Constant: '<S12>/Night1'
   *  Constant: '<S12>/Night10'
   *  Constant: '<S12>/Night11'
   *  Constant: '<S12>/Night12'
   *  Constant: '<S12>/Night13'
   *  Constant: '<S12>/Night14'
   *  Constant: '<S12>/Night15'
   *  Constant: '<S12>/Night16'
   *  Constant: '<S12>/Night2'
   *  Constant: '<S12>/Night3'
   *  Constant: '<S12>/Night4'
   *  Constant: '<S12>/Night5'
   *  Constant: '<S12>/Night6'
   *  Constant: '<S12>/Night7'
   *  Constant: '<S12>/Night8'
   *  Constant: '<S12>/Night9'
   *  Sum: '<S12>/Add'
   *  UnitDelay: '<S12>/Unit Delay'
   */
  switch ((uint8_T)(rtu_IntrBriSts_after_handle + 1U)) {
   case 1:
    rtb_NightSwitch = 625U;
    break;

   case 2:
    rtb_NightSwitch = 729U;
    break;

   case 3:
    rtb_NightSwitch = 937U;
    break;

   case 4:
    rtb_NightSwitch = 1146U;
    break;

   case 5:
    rtb_NightSwitch = 1354U;
    break;

   case 6:
    rtb_NightSwitch = 1563U;
    break;

   case 7:
    rtb_NightSwitch = 1875U;
    break;

   case 8:
    rtb_NightSwitch = 2292U;
    break;

   case 9:
    rtb_NightSwitch = 2813U;
    break;

   case 10:
    rtb_NightSwitch = 3333U;
    break;

   case 11:
    rtb_NightSwitch = 4063U;
    break;

   case 12:
    rtb_NightSwitch = 4896U;
    break;

   case 13:
    rtb_NightSwitch = 5938U;
    break;

   case 14:
    rtb_NightSwitch = 7188U;
    break;

   case 15:
    rtb_NightSwitch = 8646U;
    break;

   case 16:
    rtb_NightSwitch = 10417U;
    break;

   default:
    rtb_NightSwitch = localDW->UnitDelay_DSTATE;
    break;
  }

  /* End of MultiPortSwitch: '<S12>/Night Switch' */

  /* Switch: '<S12>/Switch' incorporates:
   *  Constant: '<S12>/Off'
   */
  if (rtu_ActvnOfSteerWhlIllmn_after_ > 0) {
    /* Switch: '<S12>/Switch1' incorporates:
     *  Constant: '<S12>/Day'
     */
    if (rtu_Day1_Night0_Mode_after_hand > 0) {
      RTE_Set_illumination_BL_PWM(100000U);
    } else {
      RTE_Set_illumination_BL_PWM(rtb_NightSwitch);
    }

    /* End of Switch: '<S12>/Switch1' */
  } else {
    RTE_Set_illumination_BL_PWM(0U);
  }

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

  /* Update for UnitDelay: '<S12>/Unit Delay' */
  localDW->UnitDelay_DSTATE = rtb_NightSwitch;
}

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