unknown type name 'blink_step_t'
Posted: Fri Apr 28, 2023 1:27 am
有谁用过ESP-IOT-Solution里的LED Indicator, 里面的结构体变量引用一直报错,component应该已经正常导入了, 用button组件都没有问题,LED这个组件一直会报错,引用方式上是不是要注意什么
unknown type name 'blink_step_t'
led_indicator.h 以下结构体存在于led_indicator.h
typedef struct {
blink_step_type_t type; /*!< action type in this step */
uint8_t value; /*!< hold on or off, set NULL if LED_BLINK_STOP or LED_BLINK_LOOP */
uint32_t hold_time_ms; /*!< hold time(ms), set NULL if not LED_BLINK_HOLD,*/
} blink_step_t;
main.c 但是main里引用还是会出现unknown type name 'blink_step_t'
#include "led_indicator.h"
static const blink_step_t double_blink[] = {
{LED_BLINK_HOLD, LED_STATE_ON, 500},
{LED_BLINK_HOLD, LED_STATE_OFF, 500},
{LED_BLINK_HOLD, LED_STATE_ON, 500},
{LED_BLINK_HOLD, LED_STATE_OFF, 500},
{LED_BLINK_STOP, 0, 0},
};
unknown type name 'blink_step_t'
led_indicator.h 以下结构体存在于led_indicator.h
typedef struct {
blink_step_type_t type; /*!< action type in this step */
uint8_t value; /*!< hold on or off, set NULL if LED_BLINK_STOP or LED_BLINK_LOOP */
uint32_t hold_time_ms; /*!< hold time(ms), set NULL if not LED_BLINK_HOLD,*/
} blink_step_t;
main.c 但是main里引用还是会出现unknown type name 'blink_step_t'
#include "led_indicator.h"
static const blink_step_t double_blink[] = {
{LED_BLINK_HOLD, LED_STATE_ON, 500},
{LED_BLINK_HOLD, LED_STATE_OFF, 500},
{LED_BLINK_HOLD, LED_STATE_ON, 500},
{LED_BLINK_HOLD, LED_STATE_OFF, 500},
{LED_BLINK_STOP, 0, 0},
};