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.

Z_Stack_Home_1.2.2a中怎么使用osal_start_timerEx函数

Other Parts Discussed in Thread: CC2530, CC2630

使用的芯片是CC2630,协议栈是Z_Stack_Home_1.2.2a,在SampleSwitch工程中,怎么设置一个定时事件触发,以前使用CC2530是用osal_start_timerEx函数,现在想使用这个函数,发现找不到他的第一个参数,不知道怎么设置。

  • /*********************************************************************
     * @fn      osal_start_timerEx
     *
     * @brief
     *
     *   This function is called to start a timer to expire in n mSecs.
     *   When the timer expires, the calling task will get the specified event.
     *
     * @param   uint8 taskID - task id to set timer for
     * @param   uint16 event_id - event to be notified with
     * @param   UNINT16 timeout_value - in milliseconds.
     *
     * @return  SUCCESS, or NO_TIMER_AVAIL.
     */
    uint8 osal_start_timerEx( uint8 taskID, uint16 event_id, uint16 timeout_value )
    {
      halIntState_t intState;
      osalTimerRec_t *newTimer;
    
      1.HAL_ENTER_CRITICAL_SECTION( intState );  // Hold off interrupts.
    
      // Add timer
      2.newTimer = osalAddTimer( taskID, event_id, timeout_value );
    
      3.HAL_EXIT_CRITICAL_SECTION( intState );   // Re-enable interrupts.
    
      return ( (newTimer != NULL) ? SUCCESS : NO_TIMER_AVAIL );
    }

    你是找这个函数吗

  • 恩,本来想找定时的方法的,后面找到一种软件定时的方法,就不用这个函数了,以前用CC2530的时候,都是用这个函数来定时的。