在Z-STACK中怎样设置功率

来源:学生作业帮助网 编辑:作业帮 时间:2024/07/14 12:43:05
在Z-STACK中怎样设置功率
xՔϋ@{ikB6 ܶKE0i^LLRe {ؿ@Уk] '$]AA$0 |ջ.\<{{}zeU GcplwBϹ>f__Bdᑘ UXl0䔫;^ZzZ+\|E @qm&V.J@FoA.Z`BT@ B60gi 5d懣qj B޸1Mh%aPV>3|f8V:vJg`|TRJrPT,5džzMFUM(+Wh%Jjvt-`B|uR]=d{%H ("}6T__lB\<ɠ/S‡;ٞ

在Z-STACK中怎样设置功率
在Z-STACK中怎样设置功率

在Z-STACK中怎样设置功率
/
*/
#ifndef HAL_MAC_USE_REGISTER_POWER_VALUES
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void macRadioSetTxPower(uint8 txPower)
{
halIntState_t s;
/* if the selected dBm is out of range, use the closest available */
if (txPower > MAC_RADIO_TX_POWER_MAX_MINUS_DBM)
{
txPower = MAC_RADIO_TX_POWER_MAX_MINUS_DBM;
}
/*
* Set the global variable reqTxPower. This variable is referenced
* by the function macRadioUpdateTxPower() to write the radio register.
*
* A lookup table is used to translate the power level to the register
* value.
*/
HAL_ENTER_CRITICAL_SECTION(s);
reqTxPower = macRadioDefsTxPowerTable[txPower];
HAL_EXIT_CRITICAL_SECTION(s);
/* update the radio power setting */
macRadioUpdateTxPower();
}
#else
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void macRadioSetTxPower(uint8 txPower)
{
halIntState_t s;
/* same as above but with no lookup table, use raw register value */
HAL_ENTER_CRITICAL_SECTION(s);
reqTxPower = txPower;
HAL_EXIT_CRITICAL_SECTION(s);
/* update the radio power setting */
macRadioUpdateTxPower();
}
#endif