mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-29 18:27:20 +02:00
feat(802.15.4): IEEE802.15.4 add some minor edits for readability
This commit is contained in:
@ -375,6 +375,7 @@ void ieee802154_txrx_statistic_print(void)
|
||||
#define IEEE802154_RX_BUFFER_GET_USED_LEVEL(a) (((a) * IEEE802154_RX_BUFFER_USED_TOTAL_LEVEL) / (CONFIG_IEEE802154_RX_BUFFER_SIZE + 1))
|
||||
static uint16_t s_rx_buffer_used_nums = 0;
|
||||
static uint64_t s_rx_buffer_used_water_level[IEEE802154_RX_BUFFER_USED_TOTAL_LEVEL + 1];
|
||||
|
||||
void ieee802154_rx_buffer_statistic_is_free(bool is_free)
|
||||
{
|
||||
if (is_free) {
|
||||
@ -394,7 +395,7 @@ void ieee802154_rx_buffer_statistic_clear(void)
|
||||
memset((void*)s_rx_buffer_used_water_level, 0, sizeof(uint64_t)*(IEEE802154_RX_BUFFER_USED_TOTAL_LEVEL + 1));
|
||||
}
|
||||
|
||||
void ieee802154_rx_buffer_statistic_printf(void)
|
||||
void ieee802154_rx_buffer_statistic_print(void)
|
||||
{
|
||||
uint64_t total_times = 0;
|
||||
for (uint8_t i = 0; i < (IEEE802154_RX_BUFFER_USED_TOTAL_LEVEL + 1); i++) {
|
||||
|
@ -88,9 +88,7 @@ static void ieee802154_receive_done(uint8_t *data, esp_ieee802154_frame_info_t *
|
||||
{
|
||||
// If the RX done packet is written in the stub buffer, drop it silently.
|
||||
IEEE802154_RX_BUFFER_STAT_IS_FREE(false);
|
||||
if (s_rx_index == CONFIG_IEEE802154_RX_BUFFER_SIZE) {
|
||||
esp_rom_printf("receive buffer full, drop the current frame.\n");
|
||||
} else {
|
||||
if (s_rx_index != CONFIG_IEEE802154_RX_BUFFER_SIZE) {
|
||||
// Otherwise, post it to the upper layer.
|
||||
// Ignore bit8 for the frame length, due to the max frame length is 127 based 802.15.4 spec.
|
||||
data[0] = data[0] & 0x7f;
|
||||
|
@ -423,9 +423,9 @@ void esp_ieee802154_rx_buffer_statistic_clear(void)
|
||||
ieee802154_rx_buffer_statistic_clear();
|
||||
}
|
||||
|
||||
void esp_ieee802154_rx_buffer_statistic_printf(void)
|
||||
void esp_ieee802154_rx_buffer_statistic_print(void)
|
||||
{
|
||||
ieee802154_rx_buffer_statistic_printf();
|
||||
ieee802154_rx_buffer_statistic_print();
|
||||
}
|
||||
#endif // CONFIG_IEEE802154_RX_BUFFER_STATISTIC
|
||||
|
||||
|
@ -635,7 +635,7 @@ void esp_ieee802154_rx_buffer_statistic_clear(void);
|
||||
* @brief Clear the current IEEE802.15.4 rx buffer statistic.
|
||||
*
|
||||
*/
|
||||
void esp_ieee802154_rx_buffer_statistic_printf(void);
|
||||
void esp_ieee802154_rx_buffer_statistic_print(void);
|
||||
#endif // CONFIG_IEEE802154_RX_BUFFER_STATISTIC
|
||||
|
||||
#if CONFIG_IEEE802154_RECORD
|
||||
|
@ -277,12 +277,12 @@ void ieee802154_rx_buffer_statistic_clear(void);
|
||||
* @brief Print the current IEEE802.15.4 rx buffer statistic.
|
||||
*
|
||||
*/
|
||||
void ieee802154_rx_buffer_statistic_printf(void);
|
||||
void ieee802154_rx_buffer_statistic_print(void);
|
||||
|
||||
#define IEEE802154_RX_BUFFER_STAT_IS_FREE(a) ieee802154_rx_buffer_statistic_is_free(a)
|
||||
#else
|
||||
#define IEEE802154_RX_BUFFER_STAT_IS_FREE(a)
|
||||
#endif
|
||||
#endif // CONFIG_IEEE802154_RX_BUFFER_STATISTIC
|
||||
|
||||
// TODO: replace etm code using common interface
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
|
@ -56,7 +56,7 @@ static int process_rx_buffer_statistic(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
if (rx_buff_stat_args.print->count) {
|
||||
esp_ieee802154_rx_buffer_statistic_printf();
|
||||
esp_ieee802154_rx_buffer_statistic_print();
|
||||
}
|
||||
if (rx_buff_stat_args.clear->count) {
|
||||
esp_ieee802154_rx_buffer_statistic_clear();
|
||||
|
Reference in New Issue
Block a user