在线时间71 小时
UID3175716
注册时间2018-5-14
NXP金币0
TA的每日心情 | 开心 2021-4-15 09:26 |
---|
签到天数: 98 天 连续签到: 1 天 [LV.6]常住居民II
高级会员

- 积分
- 623
- 最后登录
- 2021-6-15
|
#if !defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE
/*!
* brief Setup the capture.
*
* param base Ctimer peripheral base address
* param capture Capture channel to configure
* param edge Edge on the channel that will trigger a capture
* param enableInt Flag to enable channel interrupts, if enabled then the registered call back
* is called upon capture
*/
void CTIMER_SetupCapture(CTIMER_Type *base,
ctimer_capture_channel_t capture,
ctimer_capture_edge_t edge,
bool enableInt)
{
uint32_t reg = base->CCR;
uint32_t index = CTIMER_GetInstance(base);
/* Set the capture edge */
reg &= ~((CTIMER_CCR_CAP0RE_MASK | CTIMER_CCR_CAP0FE_MASK | CTIMER_CCR_CAP0I_MASK) << (capture * 3));
reg |= (uint32_t)edge << (CTIMER_CCR_CAP0RE_SHIFT + (capture * 3));
/* Clear status flags */
CTIMER_ClearStatusFlags(base, (kCTIMER_Capture0Flag << capture));
/* If call back function is valid then enable capture interrupt for the channel and update the call back function */
if (enableInt)
{
reg |= CTIMER_CCR_CAP0I_MASK << (capture * 3);
EnableIRQ(s_ctimerIRQ[index]);
}
base->CCR = reg;
}
#endif
最近在使用最新的SDK2.5时,发现在CTIMER接口中,紫色部分的条件编译有错误,我觉得应该修改为
#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)
|
|