CC2541怎样做到微秒延时?

2019-07-25 14:15发布

本帖最后由 右岸 于 2015-10-27 14:58 编辑

本人新手,刚玩CC2541,想实现一个1500微秒的延时,发现OSAL下有下面的定时函数,但是毫秒级的:
  1. /*********************************************************************
  2. * @fn      osal_start_timerEx
  3. *
  4. * @brief
  5. *
  6. *   This function is called to start a timer to expire in n mSecs.
  7. *   When the timer expires, the calling task will get the specified event.
  8. *
  9. * @param   uint8 taskID - task id to set timer for
  10. * @param   uint16 event_id - event to be notified with
  11. * @param   uint32 timeout_value - in milliseconds.
  12. *
  13. * [url=home.php?mod=space&uid=266161]@return[/url]  SUCCESS, or NO_TIMER_AVAIL.
  14. */
  15. uint8 osal_start_timerEx( uint8 taskID, uint16 event_id, uint32 timeout_value )
  16. {
  17.   halIntState_t intState;
  18.   osalTimerRec_t *newTimer;

  19.   HAL_ENTER_CRITICAL_SECTION( intState );  // Hold off interrupts.

  20.   // Add timer
  21.   newTimer = osalAddTimer( taskID, event_id, timeout_value );

  22.   HAL_EXIT_CRITICAL_SECTION( intState );   // Re-enable interrupts.

  23.   return ( (newTimer != NULL) ? SUCCESS : NO_TIMER_AVAIL );
  24. }

  25. /*********************************************************************
复制代码希望前辈们指点一二,是不是我没有找到微秒的延时函数??该怎样使用OSAL库函数写出微秒的延时函数??

友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。