2016-10-23 109 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

你說得對!非常感謝! –

相關問題