/*
 * File: TouchBoard_VOL_handle_4ms.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 "TouchBoard_VOL_handle_4ms.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>/TouchBoard_VOL_handle_4ms' */
void TouchBoard_VOL_handle_4ms_Init(uint8_T *rty_TouchBoard_VOL_Sts_after_ha,
  uint8_T *rty_Vol_XY_trig_afhd, uint8_T *rty_Pad_XY_trig_afhd,
  DW_TouchBoard_VOL_handle_4ms__T *localDW)
{
  /* SystemInitialize for Chart: '<S90>/Value_Debounce_Chart' */
  P417__Value_Debounce_Chart_Init(rty_TouchBoard_VOL_Sts_after_ha,
    &localDW->sf_Value_Debounce_Chart);

  /* SystemInitialize for Chart: '<S91>/Value_Debounce_Chart' */
  P417__Value_Debounce_Chart_Init(rty_Vol_XY_trig_afhd,
    &localDW->sf_Value_Debounce_Chart_o);

  /* SystemInitialize for Chart: '<S92>/Value_Debounce_Chart' */
  P417__Value_Debounce_Chart_Init(rty_Pad_XY_trig_afhd,
    &localDW->sf_Value_Debounce_Chart_h);
}

/* Output and update for function-call system: '<S2>/TouchBoard_VOL_handle_4ms' */
void P417__TouchBoard_VOL_handle_4ms(uint8_T rtu_TouchBoard_VOL_Sts_input,
  uint8_T rtu_Vol_XY_trig_in, uint8_T rtu_Pad_XY_trig_in, uint8_T
  *rty_TouchBoard_VOL_Sts_after_ha, uint8_T *rty_Vol_XY_trig_afhd, uint8_T
  *rty_Pad_XY_trig_afhd, DW_TouchBoard_VOL_handle_4ms__T *localDW)
{
  /* Chart: '<S90>/Value_Debounce_Chart' incorporates:
   *  RelationalOperator: '<S93>/FixPt Relational Operator'
   *  UnitDelay: '<S93>/Delay Input1'
   *
   * Block description for '<S93>/Delay Input1':
   *
   *  Store in Global RAM
   */
  P417_SWTR__Value_Debounce_Chart(rtu_TouchBoard_VOL_Sts_input, (uint8_T)
    (rtu_TouchBoard_VOL_Sts_input != localDW->DelayInput1_DSTATE),
    rty_TouchBoard_VOL_Sts_after_ha, &localDW->sf_Value_Debounce_Chart, 3U);

  /* Chart: '<S91>/Value_Debounce_Chart' incorporates:
   *  RelationalOperator: '<S95>/FixPt Relational Operator'
   *  UnitDelay: '<S95>/Delay Input1'
   *
   * Block description for '<S95>/Delay Input1':
   *
   *  Store in Global RAM
   */
  P417_SWTR__Value_Debounce_Chart(rtu_Vol_XY_trig_in, (uint8_T)
    (rtu_Vol_XY_trig_in != localDW->DelayInput1_DSTATE_c), rty_Vol_XY_trig_afhd,
    &localDW->sf_Value_Debounce_Chart_o, 3U);

  /* Chart: '<S92>/Value_Debounce_Chart' incorporates:
   *  RelationalOperator: '<S97>/FixPt Relational Operator'
   *  UnitDelay: '<S97>/Delay Input1'
   *
   * Block description for '<S97>/Delay Input1':
   *
   *  Store in Global RAM
   */
  P417_SWTR__Value_Debounce_Chart(rtu_Pad_XY_trig_in, (uint8_T)
    (rtu_Pad_XY_trig_in != localDW->DelayInput1_DSTATE_o), rty_Pad_XY_trig_afhd,
    &localDW->sf_Value_Debounce_Chart_h, 3U);

  /* Update for UnitDelay: '<S93>/Delay Input1'
   *
   * Block description for '<S93>/Delay Input1':
   *
   *  Store in Global RAM
   */
  localDW->DelayInput1_DSTATE = rtu_TouchBoard_VOL_Sts_input;

  /* Update for UnitDelay: '<S95>/Delay Input1'
   *
   * Block description for '<S95>/Delay Input1':
   *
   *  Store in Global RAM
   */
  localDW->DelayInput1_DSTATE_c = rtu_Vol_XY_trig_in;

  /* Update for UnitDelay: '<S97>/Delay Input1'
   *
   * Block description for '<S97>/Delay Input1':
   *
   *  Store in Global RAM
   */
  localDW->DelayInput1_DSTATE_o = rtu_Pad_XY_trig_in;
}

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