2016-10-23 106 views

回答

1

声明当 '结构Raw_data_struct' 的错误是由于该混合物。你可以看看帖子typedef struct vs struct definitions [duplicate]

要声明你的结构,你必须使用:

struct Raw_data_struct { 
    uint8_t time; 
    uint8_t type; 
    uint8_t phase; 
    uint8_t status; 
}; 

相反的:

struct { 
    uint8_t time; 
    uint8_t type; 
    uint8_t phase; 
    uint8_t status; 
} Raw_data_struct; 

如果要声明这两个结构和类型定义,你必须使用:

typedef struct Raw_data_struct { 
    uint8_t time; 
    uint8_t type; 
    uint8_t phase; 
    uint8_t status; 
} Getst_struct; 
+0

你说得对!非常感谢! –

相关问题