Files
sunny360vfe_proj/controllers/ascll_num_wrapper.c
T
2025-06-10 14:39:20 +08:00

63 lines
1.2 KiB
C

/*
* 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 */
#include <math.h>
#include <stdio.h>
#include <string.h>
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
#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 ascll_num_Outputs_wrapper(const uint8_T *string,
uint8_T *head,
uint8_T *sign,
uint8_T *id,
real32_T *value,
uint32_T *error_code,
const int_T u_width)
{
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
unsigned char m_head[1], m_sign[3];
int m_id;
int m_value;
int m_a;
error_code[0] = sscanf( string,"%s %s %d %d.%d", m_head, m_sign,&m_id,&m_value,&m_a);
head[0] = m_head[0];
sign[0] = m_sign[0];
sign[1] = m_sign[1];
sign[2] = m_sign[2];
id[0] = m_id;
value[0] = m_value + (float)m_a*0.01;
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
}