2011-07-13 79 views
2

編譯我的程序時出現問題。它是這樣寫的:爲函數調用編譯錯誤,Arduino

AP_Var(AP_Var_group *group, Key index, const prog_char_t *name, Flags flags = k_flags_none); 

編譯器告訴我,

AP_Var.h:163: error: expected ',' or '...' before '*' token

我所知,prog_char_t來自名爲Betterstream.h另一個文件,但究竟是什麼prog_char_t

回答

1

prog_char_t被定義爲在ArducopterAP_Common.h如下。

// prog_char_t is used as a wrapper type for prog_char, which is 
// a character stored in flash. By using this wrapper type we can 
// auto-detect at compile time if a call to a string function is using 
// a flash-stored string or not 
typedef struct { 
     char c; 
} prog_char_t; 

即,它定義了存儲在微控制器AVR的程序存儲器中的char

標準的Arduino環境使用avr-libc,它定義了prog_char用於相同的目的。我不清楚爲什麼Arducopter團隊選擇自己定義這個。

+0

哦,我明白了。所以prog_char_t就像int或float或char?它用於定義一個聲明? – Chang

+0

是的,這是Arducopter源代碼中定義的自定義類型。 –

+0

好吧thnx很多。 – Chang