bluetooth_full_duplex_sfun.c

来自「在matlab的simulink中实现的无线蓝牙模块」· C语言 代码 · 共 91 行

C
91
字号
#include "bluetooth_full_duplex_sfun.h"

/* Global machine event */
uint8_T _sfEvent_;
#include "bluetooth_full_duplex_sfun_debug_macros.h"
unsigned int _bluetooth_full_duplexMachineNumber_=UNREASONABLE_NUMBER;
unsigned int sf_bluetooth_full_duplex_process_check_sum_call( int nlhs, mxArray
 * plhs[], int nrhs, const mxArray * prhs[] )
{
#ifdef MATLAB_MEX_FILE
  char commandName[20];
  if (nrhs<1 || !mxIsChar(prhs[0]) ) return 0;
  /* Possible call to get the checksum */
  mxGetString(prhs[0], commandName,sizeof(commandName)/sizeof(char));
  commandName[(sizeof(commandName)/sizeof(char)-1)] = '\0';
  if(strcmp(commandName,"sf_get_check_sum")) return 0;
  plhs[0] = mxCreateDoubleMatrix( 1,4,mxREAL);
  if(nrhs>1 && mxIsChar(prhs[1])) {
    mxGetString(prhs[1], commandName,sizeof(commandName)/sizeof(char));
    commandName[(sizeof(commandName)/sizeof(char)-1)] = '\0';
    if(!strcmp(commandName,"machine")) {
      ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(3872798813U);
      ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(1782126408U);
      ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(2730084830U);
      ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(2687706893U);
    }else if(!strcmp(commandName,"exportedFcn")) {
      ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(0U);
      ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(0U);
      ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(0U);
      ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(0U);
    }else if(!strcmp(commandName,"makefile")) {
      ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(2744231750U);
      ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(3804038909U);
      ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(1195894002U);
      ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(2466858600U);
    }else if(nrhs==3 && !strcmp(commandName,"chart")) {
      unsigned int chartFileNumber;
      chartFileNumber = (unsigned int)mxGetScalar(prhs[2]);
      switch(chartFileNumber) {
       default:
        ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(0.0);
        ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(0.0);
        ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(0.0);
        ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(0.0);
      }
    }else if(!strcmp(commandName,"target")) {
      ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(173858259U);
      ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(4204470301U);
      ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(2250071944U);
      ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(1234161203U);
    }else {
      return 0;
    }
  } else{
    ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(1229879481U);
    ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(3860913203U);
    ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(1682366864U);
    ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(1493790697U);
  }
  return 1;
#else
  return 0;
#endif
}
/* Stateflow time variable */
real_T _sfTime_;

/* Machine initialize */
void bluetooth_full_duplex_initializer(void)
{
  _bluetooth_full_duplexMachineNumber_ =
    sf_debug_initialize_machine("bluetooth_full_duplex","sfun",0,0,0,0,0);
  sf_debug_set_machine_event_thresholds(_bluetooth_full_duplexMachineNumber_,0,0);
  sf_debug_set_machine_data_thresholds(_bluetooth_full_duplexMachineNumber_,0);
}

unsigned int bluetooth_full_duplex_registry(SimStruct *simstructPtr,char
 *chartName, int initializeFlag)
{
  return 0;
}
unsigned int bluetooth_full_duplex_sizes_registry(SimStruct *simstructPtr,char
 *chartName)
{
  return 0;
}
void bluetooth_full_duplex_terminator(void)
{
}

⌨️ 快捷键说明

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