查看: 3137|回复: 1

[分享] LPC54608最新SDK2.5问题

[复制链接]
  • TA的每日心情
    开心
    2021-4-15 09:26
  • 签到天数: 98 天

    连续签到: 1 天

    [LV.6]常住居民II

    14

    主题

    187

    帖子

    2

    高级会员

    Rank: 4

    积分
    623
    最后登录
    2021-6-15
    发表于 2019-1-18 11:38:06 | 显示全部楼层 |阅读模式
    #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)

    该会员没有填写今日想说内容.
    回复

    使用道具 举报

    该用户从未签到

    712

    主题

    6371

    帖子

    0

    超级版主

    Rank: 8Rank: 8

    积分
    24883
    最后登录
    2025-7-20
    发表于 2019-1-21 10:09:01 | 显示全部楼层
    谢谢分享!!
    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /3 下一条

    Archiver|手机版|小黑屋|恩智浦技术社区

    GMT+8, 2025-7-21 03:01 , Processed in 0.079172 second(s), 20 queries , MemCache On.

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.

    快速回复 返回顶部 返回列表