开发者

Compiling error for a function call, Arduino

开发者 https://www.devze.com 2023-03-20 02:54 出处:网络
I have a problem when I compile my program. It is written like this: AP_Var(AP_Var_group *group, Key index, const prog开发者_开发知识库_char_t *name, Flags flags = k_flags_none);

I have a problem when I compile my program. It is written like this:

 AP_Var(AP_Var_group *group, Key index, const prog开发者_开发知识库_char_t *name, Flags flags = k_flags_none);

The compiler tells me that

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

To what I know, prog_char_t comes from another file called Betterstream.h, but what exactly is prog_char_t?


prog_char_t is defined as follows in AP_Common.h in the Arducopter source.

// 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;

i.e. it defines a char which is stored in the program memory of an AVR microcontroller.

The standard Arduino environment uses avr-libc which defines prog_char for the same purpose. It's not clear to me why the Arducopter team chose to define this themselves.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号