2020-12-20 15:19:07 +08:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Include Files
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
#if defined(MATLAB_MEX_FILE)
|
|
|
|
|
#include "tmwtypes.h"
|
|
|
|
|
#include "simstruc_types.h"
|
|
|
|
|
#else
|
|
|
|
|
#include "rtwtypes.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
|
2020-12-27 11:24:31 +08:00
|
|
|
#include <stddef.h>
|
2020-12-20 15:19:07 +08:00
|
|
|
#ifdef HAL_IMPL
|
|
|
|
|
#include "param_pre.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
|
|
|
|
|
#define u_width 1
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Create external references here.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
/* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */
|
|
|
|
|
static void pack(uint8_T *pkg, uint16_T *len, const int_T y_width, uint8_T *ts, uint8_T *src, uint16_T length)
|
|
|
|
|
{
|
|
|
|
|
uint8_T sum;
|
|
|
|
|
int16_T i,j;
|
|
|
|
|
sum = 0;
|
|
|
|
|
for (i = 0; i < 4; ++i)
|
|
|
|
|
{
|
|
|
|
|
pkg[i] = ts[i];
|
|
|
|
|
sum += ts[i];
|
|
|
|
|
}
|
|
|
|
|
if (length > y_width - 5)
|
|
|
|
|
{
|
|
|
|
|
length = y_width - 5;
|
|
|
|
|
}
|
|
|
|
|
for (i = 0, j = 4; i < length; ++i,++j)
|
|
|
|
|
{
|
|
|
|
|
pkg[j] = src[i];
|
|
|
|
|
sum += src[i];
|
|
|
|
|
}
|
|
|
|
|
pkg[j] = sum;
|
|
|
|
|
len[0] = length+4;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Output function
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void hal_rec_Outputs_wrapper(const uint8_T *id,
|
|
|
|
|
const uint32_T *time_stamp,
|
|
|
|
|
uint8_T *pkg,
|
|
|
|
|
uint16_T *len,
|
|
|
|
|
const int_T y_width)
|
|
|
|
|
{
|
|
|
|
|
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
|
|
|
|
|
switch (id[0])
|
|
|
|
|
{
|
|
|
|
|
#ifdef HAL_IMPL
|
|
|
|
|
case 1:
|
|
|
|
|
pack(pkg, len, y_width, (uint8_T *)time_stamp, (uint8_T *)&rec_hi, sizeof(rec_hi));
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
default:
|
2020-12-27 11:24:31 +08:00
|
|
|
pack(pkg, len, y_width, (uint8_T *)time_stamp, NULL, 0u);
|
2020-12-20 15:19:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|