⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demo1103_io_ad_pwm3_v7_main.c

📁 代码由matlab自动生成
💻 C
字号:
/*
 * File: Demo1103_IO_AD_PWM3_V7_main.c
 *
 * Real-Time Workshop code generated for Simulink model Demo1103_IO_AD_PWM3_V7.
 *
 * Model version                        : 1.103
 * Real-Time Workshop file version      : 6.6  (R2007a)  01-Feb-2007
 * Real-Time Workshop file generated on : Thu Apr 10 19:48:30 2008
 * TLC version                          : 6.6 (Jan 16 2007)
 * C source code generated on           : Thu Apr 10 19:48:31 2008
 */

#include "Demo1103_IO_AD_PWM3_V7.h"
#include "Demo1103_IO_AD_PWM3_V7_private.h"
#include "rtwtypes.h"
#include "c2000_main.h"
#include "DSP281x_Device.h"
#include "DSP281x_Examples.h"

volatile int IsrOverrun = 0;
static boolean_T OverrunFlag = 0;

/* Associating rt_OneStep with a real-time clock or interrupt service routine
 * is what makes the generated code "real-time".  The function rt_OneStep is
 * always associated with the base rate of the model.  Subrates are managed
 * by the base rate from inside the generated code.  Enabling/disabling
 * interrupts and floating point context switches are target specific.  This
 * example code indicates where these should take place relative to executing
 * the generated code step function.  Overrun behavior should be tailored to
 * your application needs.  This example simply sets an error status in the
 * real-time model and returns from rt_OneStep.
 */
void rt_OneStep(void)
{
  // Check for overrun. Protect OverrunFlag against
  // pre-emption
  asm(" SETC INTM");
  if (OverrunFlag++) {
    IsrOverrun = 1;
    OverrunFlag--;
    asm(" CLRC INTM");
    return;
  }

  asm(" CLRC INTM");
  Demo1103_IO_AD_PWM3_V7_step();
  OverrunFlag--;
}

//
// Entry point into the code
//
void main(void)
{
  volatile boolean_T noErr;
  init_board();
  Demo1103_IO_AD_PWM3_V7_initialize(1);
  enable_interrupts();
  config_schedulerTimer();
  noErr =
    rtmGetErrorStatus(Demo1103_IO_AD_PWM3_V7_M) == NULL;
  while (noErr ) {
    noErr =
      rtmGetErrorStatus(Demo1103_IO_AD_PWM3_V7_M) == NULL;
  }

  /* Disable rt_OneStep() here */

  /* Terminate model */
  Demo1103_IO_AD_PWM3_V7_terminate();
  disable_interrupts();
}

/* File trailer for Real-Time Workshop generated code.
 *
 * [EOF]
 */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -