/*
 * File: illumination_control_10ms.c
 *
 * Code generated for Simulink model 'P417_SWTR_App'.
 *
 * Model version                  : 1.165
 * Simulink Coder version         : 8.13 (R2017b) 24-Jul-2017
 * C/C++ source code generated on : Sun Jun 25 21:59:14 2023
 *
 * 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_SWTR_App.h"
#include "P417_SWTR_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: '<S73>/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: '<S73>/Fault_Debounce_Chart' */
  P417_SWTR__Fault_Debounce_Chart(rtu_Frame_0x30_Timeout,
    &localB->Fault_confirmed, &localDW->sf_Fault_Debounce_Chart, 3U, 3U);

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

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

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

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