update template

This commit is contained in:
matt
2020-10-14 11:54:01 +08:00
parent e6a8a6172c
commit 6889af5575
+33 -17
View File
@@ -10,10 +10,10 @@
#include "rtwtypes.h" #include "rtwtypes.h"
#endif #endif
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */ /* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
#ifdef HAL_IMPL
#include "param_pre.h"
#endif
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */ /* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
#define u_width 1 #define u_width 1
@@ -22,7 +22,23 @@
* *
*/ */
/* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */ /* %%%-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 *src, uint16_T length)
{
uint8_T sum;
int16_T i;
if (length > y_width - 1)
{
length = y_width - 1;
}
sum = 0;
for (i = 0; i < length; ++i)
{
pkg[i] = src[i];
sum += src[i];
}
pkg[i] = sum;
len[0] = length+1;
}
/* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */ /* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */
/* /*
@@ -30,20 +46,20 @@
* *
*/ */
void hal_rec_Outputs_wrapper(const uint8_T *id, void hal_rec_Outputs_wrapper(const uint8_T *id,
uint8_T *pkg, uint8_T *pkg,
uint16_T *len, uint16_T *len,
const int_T y_width) const int_T y_width)
{
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
len[0] = 0;
switch (id[0])
{ {
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
len[0] = 0;
#ifdef HAL_IMPL
uint8_T *src;
switch (id[0])
{
case 1: case 1:
pkg[0] = 0xEB; pack(pkg, len, y_width, (uint8_t *)&rec_hi, sizeof(rec_hi));
pkg[1] = 0x90;
break; break;
}
#endif
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
} }
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
}