/*
 * File: illumination_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 "illumination_control_10ms.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>/illumination_control_10ms' */
void illumination_control_10ms_Init(B_illumination_control_10ms_P_T *localB,
  DW_illumination_control_10ms__T *localDW)
{
  /* SystemInitialize for Chart: '<S87>/Fault_Debounce_Chart' */
  P417__Fault_Debounce_Chart_Init(&localB->Fault_confirmed,
    &localDW->sf_Fault_Debounce_Chart);
}

/* Output and update for function-call system: '<S2>/illumination_control_10ms' */
void P417__illumination_control_10ms(uint8_T rtu_ActvnOfSteerWhlIllmn_input,
  uint8_T rtu_Frame_0x30_Timeout, uint8_T *rty_ActvnOfSteerWhlIllmn_after_,
  B_illumination_control_10ms_P_T *localB, DW_illumination_control_10ms__T
  *localDW)
{
  /* Chart: '<S87>/Fault_Debounce_Chart' */
  P417_SWTL__Fault_Debounce_Chart(rtu_Frame_0x30_Timeout,
    &localB->Fault_confirmed, &localDW->sf_Fault_Debounce_Chart, 3U, 3U);

  /* Switch: '<S34>/Switch' incorporates:
   *  UnitDelay: '<S34>/Unit Delay'
   */
  if (localB->Fault_confirmed > 0) {
    *rty_ActvnOfSteerWhlIllmn_after_ = localDW->UnitDelay_DSTATE;
  } else {
    *rty_ActvnOfSteerWhlIllmn_after_ = rtu_ActvnOfSteerWhlIllmn_input;
  }

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

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

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