请问香主16搂的代码复制到我的IAR测试工程中(在未添加16楼代码时编译通过),就将它作为一个函数来使用,但Rebuildall 后其中有写语句出错不知道是为什么?
不能通过的语句有:
//TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;
//TIM_OCInitStructure.TIM_OutputNState = TIM_OutputState_Disable;
//TIM_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_Low;
//TIM_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Reset;
//TIM_OCInitStructure.TIM_OCNIdleState = TIM_OCIdleState_Reset;
//TIM_TimeBaseStructure.TIM_RepetitionCounter = 0;
可以通过的语句有:
TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;
TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High;
TIM_OCInitStructure.TIM_Pulse = (((Fsys/2) / Fpwm) * PWM_DUTY) / 100;
是不是跟我的硬件库版本有关啊!请教香主. |