mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
IEEE802154: match C6 max txpower value with datasheet
This commit is contained in:
@ -9,5 +9,6 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "hal/ieee802154_common_ll.h"
|
#include "hal/ieee802154_common_ll.h"
|
||||||
|
|
||||||
#define IEEE802154_TXPOWER_VALUE_MAX 21
|
#define IEEE802154_TXPOWER_VALUE_MAX 20
|
||||||
#define IEEE802154_TXPOWER_VALUE_MIN -24
|
#define IEEE802154_TXPOWER_VALUE_MIN -15
|
||||||
|
#define IEEE802154_TXPOWER_INDEX_MIN 3
|
||||||
|
@ -9,5 +9,6 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "hal/ieee802154_common_ll.h"
|
#include "hal/ieee802154_common_ll.h"
|
||||||
|
|
||||||
#define IEEE802154_TXPOWER_VALUE_MAX 21
|
#define IEEE802154_TXPOWER_VALUE_MAX 20
|
||||||
#define IEEE802154_TXPOWER_VALUE_MIN -24
|
#define IEEE802154_TXPOWER_VALUE_MIN -24
|
||||||
|
#define IEEE802154_TXPOWER_INDEX_MIN 0
|
||||||
|
@ -47,15 +47,15 @@ void ieee802154_pib_init(void)
|
|||||||
|
|
||||||
static uint8_t ieee802154_txpower_convert(int8_t txpower)
|
static uint8_t ieee802154_txpower_convert(int8_t txpower)
|
||||||
{
|
{
|
||||||
uint8_t ieee820154_txpower_value = 0;
|
uint8_t ieee820154_txpower_index = 0;
|
||||||
if (txpower > IEEE802154_TXPOWER_VALUE_MAX) {
|
if (txpower >= IEEE802154_TXPOWER_VALUE_MAX) {
|
||||||
ieee820154_txpower_value = 15;
|
ieee820154_txpower_index = 15;
|
||||||
} else if (txpower < IEEE802154_TXPOWER_VALUE_MIN) {
|
} else if (txpower <= IEEE802154_TXPOWER_VALUE_MIN) {
|
||||||
ieee820154_txpower_value = 0;
|
ieee820154_txpower_index = IEEE802154_TXPOWER_INDEX_MIN;
|
||||||
} else {
|
} else {
|
||||||
ieee820154_txpower_value = (uint8_t)((txpower - IEEE802154_TXPOWER_VALUE_MIN) / 3);
|
ieee820154_txpower_index = (uint8_t)((txpower - IEEE802154_TXPOWER_VALUE_MIN) / 3) + IEEE802154_TXPOWER_INDEX_MIN;
|
||||||
}
|
}
|
||||||
return ieee820154_txpower_value;
|
return ieee820154_txpower_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ieee802154_pib_update(void)
|
void ieee802154_pib_update(void)
|
||||||
|
Reference in New Issue
Block a user