mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-02 07:20:16 +00:00
stm32-sx1280: ignore empty packets
This commit is contained in:
parent
9c622d6f86
commit
ba57c415a5
@ -620,16 +620,23 @@ static void radio_fetch_rx_pdu(void){
|
|||||||
// fetch reserved rx pdu
|
// fetch reserved rx pdu
|
||||||
ll_pdu_t * rx_packet = ctx.rx_pdu;
|
ll_pdu_t * rx_packet = ctx.rx_pdu;
|
||||||
btstack_assert(rx_packet != NULL);
|
btstack_assert(rx_packet != NULL);
|
||||||
ctx.rx_pdu = NULL;
|
|
||||||
|
|
||||||
// mark as data packet
|
// read max packet
|
||||||
rx_packet->flags |= LL_PDU_FLAG_DATA_PDU;
|
|
||||||
uint16_t max_packet_len = 2 + 27;
|
uint16_t max_packet_len = 2 + 27;
|
||||||
|
|
||||||
SX1280HalReadBuffer( SX1280_RX0_OFFSET, &rx_packet->header, max_packet_len);
|
SX1280HalReadBuffer( SX1280_RX0_OFFSET, &rx_packet->header, max_packet_len);
|
||||||
|
|
||||||
// queue received packet
|
// queue if not empty
|
||||||
btstack_linked_queue_enqueue(&ctx.rx_queue, (btstack_linked_item_t *) rx_packet);
|
if (rx_packet->len != 0){
|
||||||
|
|
||||||
|
// packet used
|
||||||
|
ctx.rx_pdu = NULL;
|
||||||
|
|
||||||
|
// mark as data packet
|
||||||
|
rx_packet->flags |= LL_PDU_FLAG_DATA_PDU;
|
||||||
|
|
||||||
|
// queue received packet
|
||||||
|
btstack_linked_queue_enqueue(&ctx.rx_queue, (btstack_linked_item_t *) rx_packet);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Radio IRQ handlers */
|
/** Radio IRQ handlers */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user