Files
slhal/X7/hal_led_set_wrapper.c
T
2020-10-18 19:46:38 +08:00

92 lines
1.8 KiB
C

/*
* Include Files
*
*/
#if defined(MATLAB_MEX_FILE)
#include "tmwtypes.h"
#include "simstruc_types.h"
#else
#include "rtwtypes.h"
#endif
#include "hal_api.h"
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
#ifdef HAL_IMPL
//#include "param_mgr.h"
extern void DrvNuaaHalLedConfigSet(int TailRed,int TailGreen ,int TailBlue);
#endif
#include <stdint.h>
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
#define u_width 1
#define y_width 1
/*
* Create external references here.
*
*/
/* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */
int is_led_init[1] = 0;
void led_set_init(uint8_t id)
{
switch (id)
{
case 0u:
if (!is_led_init[0])
{
#ifdef HAL_IMPL
//TODO
is_led_init[0] = 1;
#endif
}
break;
}
}
/* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */
/*
* Start function
*
*/
void hal_led_set_Start_wrapper(const uint8_T *id, const int_T p_width0)
{
/* %%%-SFUNWIZ_wrapper_Start_Changes_BEGIN --- EDIT HERE TO _END */
led_set_init(id[0]);
/* %%%-SFUNWIZ_wrapper_Start_Changes_END --- EDIT HERE TO _BEGIN */
}
/*
* Output function
*
*/
void hal_led_set_Outputs_wrapper(const HAL_led_color_t *color,
int32_T *ErrorCode,
const uint8_T *id, const int_T p_width0)
{
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
/*
* set LED group *id* with *color*
*
* ErrorCode - return zero on success, otherwise nonzero on failures.
*/
ErrorCode[0] = -1;
switch (id[0])
{
case 0u:
if (is_led_init[0])
{
#ifdef HAL_IMPL
// TODO set led color
DrvNuaaHalLedConfigSet(color->r, color->g, color->b);
ErrorCode[0] = 0;
#endif
}
}
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
}