This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC1310延时函数

Other Parts Discussed in Thread: CC1310, SYSBIOS

CC1310的两个延时函数:CPUdelay(8000*50);和Task_sleep(1000);有什么区别。一般用那个好?

谢谢

  • Task_sleep会放弃执行本任务,转去执行其他任务;CPUdelay只是延迟执行时间。一般来说两个都能用

  • 他们延时的单位是啥?

  • CPUdelay使用delay loop来实现延时,其延时单位为指令周期。

    //*****************************************************************************
    //
    //! \brief Provide a small delay.
    //!
    //! This function provides means for generating a constant length delay. It
    //! is written in assembly to keep the delay consistent across tool chains,
    //! avoiding the need to tune the delay based on the tool chain in use.
    //!
    //! The loop takes 3 cycles/loop.
    //!
    //! \param ui32Count is the number of delay loop iterations to perform.
    //!
    //! \return None
    //
    //*****************************************************************************
    extern void CPUdelay(uint32_t ui32Count);

    Task_sleep是让出对MCU的占用,可以让其他task得到执行或者执行idle task从而进入低功耗状态。它的计时单位是systick,默认为10us。

  • 你好,那个函数是是定时器重启函数?即定每次调用都是从0开始计时。是Clock_start();吗?能给一个介绍定时器相关函数资料吗?

  • 在SDK中的配套文档中,有关于clock模块的详细介绍

    file:///C:/TI/simplelink_cc13x0_sdk_1_40_00_10/docs/tirtos/sysbios/docs/cdoc/index.html#ti/sysbios/knl/Clock.html