mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
fix(coex): fix 802.15.4 external coexistence
This commit is contained in:
parent
78a4ea29f3
commit
aa67538038
@ -18,6 +18,8 @@ typedef enum {
|
||||
void esp_coex_ieee802154_txrx_pti_set(ieee802154_coex_event_t event);
|
||||
void esp_coex_ieee802154_ack_pti_set(ieee802154_coex_event_t event);
|
||||
void esp_coex_ieee802154_coex_break_notify(void);
|
||||
void esp_coex_ieee802154_extcoex_tx_stage(void);
|
||||
void esp_coex_ieee802154_extcoex_rx_stage(void);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 97df1ca6cbfb8105ed3121e72a73591a36220b33
|
||||
Subproject commit b6082e49c47f42cf43db7dad7eac395365912b5a
|
@ -341,8 +341,23 @@ IEEE802154_NOINLINE IEEE802154_STATIC bool stop_current_operation(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
FORCE_INLINE_ATTR void extcoex_tx_stage_start(void)
|
||||
{
|
||||
#if CONFIG_ESP_COEX_EXTERNAL_COEXIST_ENABLE
|
||||
esp_coex_ieee802154_extcoex_tx_stage();
|
||||
#endif
|
||||
}
|
||||
|
||||
FORCE_INLINE_ATTR void extcoex_rx_stage_start(void)
|
||||
{
|
||||
#if CONFIG_ESP_COEX_EXTERNAL_COEXIST_ENABLE
|
||||
esp_coex_ieee802154_extcoex_rx_stage();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void enable_rx(void)
|
||||
{
|
||||
extcoex_rx_stage_start();
|
||||
set_next_rx_buffer();
|
||||
IEEE802154_SET_TXRX_PTI(IEEE802154_SCENE_RX);
|
||||
|
||||
@ -403,6 +418,7 @@ static IRAM_ATTR void isr_handle_tx_done(void)
|
||||
NEEDS_NEXT_OPT(true);
|
||||
} else if (s_ieee802154_state == IEEE802154_STATE_TX || s_ieee802154_state == IEEE802154_STATE_TX_CCA) {
|
||||
if (ieee802154_frame_is_ack_required(s_tx_frame) && ieee802154_ll_get_rx_auto_ack()) {
|
||||
extcoex_rx_stage_start();
|
||||
ieee802154_set_state(IEEE802154_STATE_RX_ACK);
|
||||
#if !CONFIG_IEEE802154_TEST
|
||||
receive_ack_timeout_timer_start(200000); // 200ms for receive ack timeout
|
||||
@ -423,6 +439,7 @@ static IRAM_ATTR void isr_handle_rx_done(void)
|
||||
if (s_ieee802154_state == IEEE802154_STATE_RX) {
|
||||
if (ieee802154_frame_is_ack_required(s_rx_frame[s_rx_index]) && ieee802154_frame_get_version(s_rx_frame[s_rx_index]) <= IEEE802154_FRAME_VERSION_1
|
||||
&& ieee802154_ll_get_tx_auto_ack()) {
|
||||
extcoex_tx_stage_start();
|
||||
// auto tx ack only works for the frame with version 0b00 and 0b01
|
||||
s_rx_frame_info[s_rx_index].pending = ieee802154_ack_config_pending_bit(s_rx_frame[s_rx_index]);
|
||||
ieee802154_set_state(IEEE802154_STATE_TX_ACK);
|
||||
@ -432,6 +449,7 @@ static IRAM_ATTR void isr_handle_rx_done(void)
|
||||
s_rx_frame_info[s_rx_index].pending = ieee802154_ack_config_pending_bit(s_rx_frame[s_rx_index]);
|
||||
// For 2015 enh-ack, SW should generate an enh-ack then send it manually
|
||||
if (esp_ieee802154_enh_ack_generator(s_rx_frame[s_rx_index], &s_rx_frame_info[s_rx_index], s_enh_ack_frame) == ESP_OK) {
|
||||
extcoex_tx_stage_start();
|
||||
#if !CONFIG_IEEE802154_TEST
|
||||
// Send the Enh-Ack frame if generator succeeds.
|
||||
ieee802154_ll_set_tx_addr(s_enh_ack_frame);
|
||||
@ -456,6 +474,7 @@ static IRAM_ATTR void isr_handle_rx_done(void)
|
||||
|
||||
static IRAM_ATTR void isr_handle_ack_tx_done(void)
|
||||
{
|
||||
extcoex_rx_stage_start();
|
||||
ieee802154_receive_done((uint8_t *)s_rx_frame[s_rx_index], &s_rx_frame_info[s_rx_index]);
|
||||
NEEDS_NEXT_OPT(true);
|
||||
}
|
||||
@ -831,6 +850,7 @@ IEEE802154_STATIC void tx_init(const uint8_t *frame)
|
||||
// set rx pointer for ack frame
|
||||
set_next_rx_buffer();
|
||||
}
|
||||
extcoex_tx_stage_start();
|
||||
}
|
||||
|
||||
static inline esp_err_t ieee802154_transmit_internal(const uint8_t *frame, bool cca)
|
||||
|
Loading…
x
Reference in New Issue
Block a user