Пример #1
0
void powerwindow_PSG_BackL_main(void)
{

    static powerwindow_boolean_T OverrunFlag = 0;

    /* Disable interrupts here */

    /* Check for overrun */
    if (OverrunFlag) {
    	powerwindow_PW_PSG_BackL_rtmSetErrorStatus(powerwindow_PW_Control_PSG_BackL_M, "Overrun");

        return;
    }


    OverrunFlag = true;

    /* Save FPU context here (if necessary) */
    /* Re-enable timer or interrupt here */
    /* Set model inputs here */


    powerwindow_PW_Control_PSG_BackL_main();

    /* Get model outputs here */


    /* Indicate task complete */
    OverrunFlag = false;

    /* Disable interrupts here */
    /* Restore FPU context here (if necessary) */
    /* Enable interrupts here */

}
/* Model initialize function */
void powerwindow_PW_Control_PSG_BackL_initialize(void)
{
  /* Registration code */

  /* initialize error status */
  powerwindow_PW_PSG_BackL_rtmSetErrorStatus(powerwindow_PW_Control_PSG_BackL_M, (NULL));

  /* states (dwork) */
  (void) memset((void *)&powerwindow_PW_Control_PSG_BackL_DWork, 0,
                sizeof(powerwindow_D_Work_PW_Control_PSG_BackL));

  /* external inputs */
  (void) memset((void *)&powerwindow_PW_Control_PSG_BackL_U, 0,
                sizeof(powerwindow_ExternalInputs_PW_Control_PSG_BackL));

  /* external outputs */
  (void) memset((void *)&powerwindow_PW_Control_PSG_BackL_Y, 0,
                sizeof(powerwindow_ExternalOutputs_PW_Control_PSG_BackL));

  /* Model Initialize fcn for ModelReference Block: '<S1>/ControlEx_PSG_BackL' */
  powerwindow_controlexclusion_initialize();

  /* Model Initialize fcn for ModelReference Block: '<S2>/debounce_Down' */
  powerwindow_debounce_initialize(powerwindow_PW_PSG_BackL_rtmGetErrorStatusPointer(powerwindow_PW_Control_PSG_BackL_M),
                      &(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtm),
                      &(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtb),
                      &(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtdw),
                      &(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtzce));

  /* Model Initialize fcn for ModelReference Block: '<S2>/debounce_Up' */
  powerwindow_debounce_initialize(powerwindow_PW_PSG_BackL_rtmGetErrorStatusPointer(powerwindow_PW_Control_PSG_BackL_M),
                      &(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtm),
                      &(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtb),
                      &(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtdw),
                      &(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtzce));

  /* Model Initialize fcn for ModelReference Block: '<S1>/PW_PSG_BackL' */
  powerwindow_powerwindow_control_initialize(powerwindow_PW_PSG_BackL_rtmGetErrorStatusPointer(powerwindow_PW_Control_PSG_BackL_M),
    &(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtm),
    &(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtb),
    &(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtdw),
    &(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtzce));

  /* Start for ModelReference: '<S2>/debounce_Up' */
  powerwindow_debounce_Start(&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtdw));

  /* Start for ModelReference: '<S2>/debounce_Down' */
  powerwindow_debounce_Start(&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtdw));

  /* Start for ModelReference: '<S1>/PW_PSG_BackL' */
  powerwindow_powerwindow_control_Start(&(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtdw));

  /* InitializeConditions for ModelReference: '<S2>/debounce_Up' */
  powerwindow_debounce_Init(&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtb),
                &(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Up_DWORK1.rtdw));

  /* InitializeConditions for ModelReference: '<S2>/debounce_Down' */
  powerwindow_debounce_Init(&(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtb),
                &(powerwindow_PW_Control_PSG_BackL_DWork.Debounce_Down_DWORK1.rtdw));

  /* InitializeConditions for ModelReference: '<S1>/PW_PSG_BackL' */
  powerwindow_powerwindow_control_Init(&powerwindow_PW_Control_PSG_BackL_Y.window_up,
    &powerwindow_PW_Control_PSG_BackL_Y.window_down, &powerwindow_PW_Control_PSG_BackL_Y.overcurrent,
    &powerwindow_PW_Control_PSG_BackL_Y.pinch, &powerwindow_PW_Control_PSG_BackL_Y.wake,
    &(powerwindow_PW_Control_PSG_BackL_DWork.PW_PSG_BackL_DWORK1.rtdw));
}