菜鸟在程序中定义了这样一个结构 typedef struct { INT8U MotorDirection; INT8U PulseDirection; INT16U StepsCounter; INT16U MotorStepsSum; INT16U MotorStepsOld; INT16U Timer2Flagint; INT8U MotorStatus; INT16U Counter; INT16U Sum; INT16U TimerPulseCounter; INT16U TimeIntcount; INT32U CounterTime; INT16U MaxFrequent; INT16U MinFrequent; INT16U IntervalFrequent; } MOTOR_INFO;
extern MOTOR_INFO MotorInfo[SUMMOTOR]; 在定时中断函数中使用 void Timer2Handler (void) __irq { static INT32U timer2_counter=0; INT8U i; T2IR = 1; /* clear interrupt flag */ timer2_counter++; for(i=0;i<SUMMOTOR;i++) { MotorInfo.Timer2Flagint++; } i=0; MoveStepMotor( ); if(timer2_counter>=10000000) timer2_counter=0; VICVectAddr = 0; /* Acknowledge Interrupt */ } 可是出现这样的错误 Error : C2456E: undeclared name, inventing 'extern int MotorInfo' timer.c line 145 Project: UNIVERSAL.mcp, Target: RunInFlash, Source File: timer.c
Error : (Serious) C2947E: Illegal types for operands: <subscript> timer.c line 145 Project: UNIVERSAL.mcp, Target: RunInFlash, Source File: timer.c
Error : C2456E: undeclared name, inventing 'extern int Motornum' StepMotor.c line 266 Project: UNIVERSAL.mcp, Target: RunInFlash, Source File: StepMotor.c
怎么回事啊 大侠救命啊
|