新手入门
- 积分
- 19
- 金钱
- 19
- 注册时间
- 2022-11-11
- 在线时间
- 2 小时
|
1金钱
在捕获实验中,中断服务函数中TIM_OC1PolarityConfig()函数更改捕获极性
void TIM_OC1PolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPolarity)
{
uint16_t tmpccer = 0;
/* Check the parameters */
assert_param(IS_TIM_LIST8_PERIPH(TIMx));
assert_param(IS_TIM_OC_POLARITY(TIM_OCPolarity));
tmpccer = TIMx->CCER;
/* Set or Reset the CC1P Bit */
tmpccer &= (uint16_t)~((uint16_t)TIM_CCER_CC1P);
tmpccer |= TIM_OCPolarity;
/* Write to TIMx CCER register */
TIMx->CCER = tmpccer;
}
对assert_param(IS_TIM_OC_POLARITY(TIM_OCPolarity));进行go to defination
结果是跳转的是:
#define TIM_OCPolarity_High ((uint16_t)0x0000)
#define TIM_OCPolarity_Low ((uint16_t)0x0002)
#define IS_TIM_OC_POLARITY(POLARITY) (((POLARITY) == TIM_OCPolarity_High) || \
((POLARITY) == TIM_OCPolarity_Low))
而例程中写的是TIM_OC1PolarityConfig(TIM5,TIM_ICPolarity_Falling);
这是stm32f10x_tim.c文件写错了吗?
还是例程写错了?
|
|