64 lines
1.5 KiB
C
64 lines
1.5 KiB
C
|
|
/*
|
|
* Include Files
|
|
*
|
|
*/
|
|
#if defined(MATLAB_MEX_FILE)
|
|
#include "tmwtypes.h"
|
|
#include "simstruc_types.h"
|
|
#else
|
|
#define SIMPLIFIED_RTWTYPES_COMPATIBILITY
|
|
#include "rtwtypes.h"
|
|
#undef SIMPLIFIED_RTWTYPES_COMPATIBILITY
|
|
#endif
|
|
|
|
#include "canReceive_bus.h"
|
|
|
|
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
|
|
#include <math.h>
|
|
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
|
|
#define u_width 1
|
|
#define u_1_width 1
|
|
#define u_2_width 8
|
|
#define y_width 1
|
|
|
|
/*
|
|
* Create external references here.
|
|
*
|
|
*/
|
|
/* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */
|
|
/* extern double func(double a); */
|
|
/* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */
|
|
|
|
/*
|
|
* Output function
|
|
*
|
|
*/
|
|
void canReceive_Outputs_wrapper(const uint32_T *id,
|
|
const uint8_T *dlc,
|
|
const uint8_T *data,
|
|
CAN_MESSAGE_BUS *canFrame)
|
|
{
|
|
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
|
|
/* This sample sets the output equal to the input
|
|
y0[0] = u0[0];
|
|
For complex signals use: y0[0].re = u0[0].re;
|
|
y0[0].im = u0[0].im;
|
|
y1[0].re = u1[0].re;
|
|
y1[0].im = u1[0].im;
|
|
*/
|
|
canFrame->ID = *(id);
|
|
canFrame->Length = *(dlc);
|
|
for(int ijk = 0; ijk < (*dlc); ijk++)
|
|
canFrame->Data[ijk] = data[ijk];
|
|
if( canFrame->ID > 0x7FF )
|
|
canFrame->Extended = 1;
|
|
else
|
|
canFrame->Extended = 0;
|
|
|
|
// memcpy(canFrame->Data, data, *(dlc));
|
|
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
|
|
}
|
|
|
|
|