GPTimer采用边沿计时模式,请问GPTimerCC26XX_getValue()函数和GPTimerCC26XX_getFreeRunValue() 函数有什么区别?
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.
看下这里的解释
/*! * @brief Function to retrieve the current free-running value of timer * * @pre GPTimerCC26XX_open() has to be called first successfully * * @param handle A GPTimerCC26XX handle returned from GPTimerCC26XX_open * * @return Current free-running timer value for all modes * * @sa GPTimerCC26XX_open() */ extern GPTimerCC26XX_Value GPTimerCC26XX_getFreeRunValue(GPTimerCC26XX_Handle handle); /*! * @brief Function to retrieve the current value of timer * This returns the value of the timer in all modes except for * input edge count and input edge time mode. * In edge count mode, this register contains the number of edges that * have occurred. In input edge time, this register contains the * timer value at which the last edge event took place. * * * @pre GPTimerCC26XX_open() has to be called first successfully * * @param handle A GPTimerCC26XX handle returned from GPTimerCC26XX_open * * @return Current free-running timer value for all modes * * @sa GPTimerCC26XX_open() */ extern GPTimerCC26XX_Value GPTimerCC26XX_getValue(GPTimerCC26XX_Handle handle);
GPT优先级修改下面intPriority 的值,BLE只有一个任务,优先级是1
// Task configuration
#define SP_TASK_PRIORITY 1
const GPTimerCC26XX_HWAttrs gptimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_GPTIMERPARTSCOUNT] = { { .baseAddr = GPT0_BASE, .intNum = INT_GPT0A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0A, }, { .baseAddr = GPT0_BASE, .intNum = INT_GPT0B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0B, }, { .baseAddr = GPT1_BASE, .intNum = INT_GPT1A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1A, }, { .baseAddr = GPT1_BASE, .intNum = INT_GPT1B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1B, }, { .baseAddr = GPT2_BASE, .intNum = INT_GPT2A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2A, }, { .baseAddr = GPT2_BASE, .intNum = INT_GPT2B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2B, }, { .baseAddr = GPT3_BASE, .intNum = INT_GPT3A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3A, }, { .baseAddr = GPT3_BASE, .intNum = INT_GPT3B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3B, }, };