我在头文件中编写了结构体,在编译时老是出现问题,以下是我用的头文件:
#ifndef __CLARKE_H__
#define __CLARKE_H__
typedef struct {
void (*calc)(void *); // Pointer to calculation function
long As; // Input: phase-a stator variable
long Bs; // Input: phase-b stator variable
long Cs; // Input: phase-b stator variable
long Alpha_clarke; // Output: stationary d-axis stator variable
long Beta_clarke; // Output: stationary q-axis stator variable
} CLARKE;
/*-----------------------------------------------------------------------------
Default initalizer for the CLARKE object.
-----------------------------------------------------------------------------*/
#define CLARKE_DEFAULTS { \
(void (*)(void *))clarke_calc, \
0, \
0, \
0 \
0, \
0, \
}
typedef CLARKE *CLARKE_Handle;
void clarke_calc(CLARKE_Handle);
#endif // __CLARKE_H__
在中断函数里编写:
#include "clarke.h"
CLARKE clarke = CLARKE_DEFAULTS;
但是为什么老是出现下面的错误,这是什么原因呢?
[interrupt.c]
"interrupt.c", line 12: [F001] syntax error at or near symbol ';' |